I've been having a lot of trouble using apt to apply software updates to my Raspberry Pi systems. Most of them are running the ARM version of Ubuntu 22.04.1 LTS and the Pi-Zero system is using the latest "bullseye" flavor of "Pi OS".
Often when I try to do an "apt upgrade", it will lock up downloading the package files. My network and local wi-fi is super reliable with high download speeds and my ssh session within my local network is rock solid even when apt becomes hung. Most of the Pi systems are wi-fi connected, but one is directly hardwired with CAT-5. (I also know that the Internet connection is working perfectly too, by the video streams and other applications running on every other device in the house). In those cases, apt's downloads will be flying along and then suddenly stop downloading, sometimes in the middle of an individual package download. The download will never recover themselves at all - ever. The more updated packages apt is trying to process, the more likely it is to lock up like this.
I had to totally re-build the two Pi-4 Ubuntu systems (4GB and 8GB models with 64GB SD cards for the file system) a few months ago, because one of the standard apt updates removed my physical display monitors from the system configuration back in December 2022. (I use them for security camera displays, so no longer having a display was a big problem). Since then, I've had to totally stop trying to install any apt upgrades at all on those systems because I had no idea which update broke the displays or what to do about it. Snap still works for upgrading Firefox. Even if I was to take a gamble and try to run a full "apt upgrade" again, given this hanging behavior would certinally occur with the over 200 missing updates - there is no way it would actually work.
I've tried upgrading individual packages on the Pi-Zero (only 1GB memory but still with a 64GB SD card for the file system) by manually running "apt install" on each upgraded package, but even this hangs and goes off into the weeds much of the time.
I've seen this same problem occur with the GUI software update utility too, so it is not just limited to the command line apt command either.
I'm puzzled that apt doesn't seem to notice that its I/O is totally hung and does nothing to recover from it. Indeed, it'll sit there for hours in a hung state until I usually have to do a hard power reset to reboot the system to recover from this.
I've used rpm and yum on other systems over the years and have never seen these types of "run like a rabbit into a brick wall" problems. I've no idea how to diagnose these problems further, especially given that it's clearly not any problem with my local network or its connection to the Internet. Usually the mirror repositories that apt is downloading from are homed by a big school that is fairly local to me, with pretty fast 5 to 15MB/sec downloads right up until the I/O hangs.
Any thoughts, suggestions, or alternate maintenance tools that I could try would be welcome! Thanks!