Raspian & APT

I had big problems with APT, (the advanced packaging tool) updating Jessie to Jessie last, and then taking it onto Stretch on my Raspberry Pi. I must have needed to download and update over 2000 packages.  Some of this is documented in Raspberry PI Part Deux but I have created this snip to make it easier for others to find in order to help those that follow me. I found that an apt transaction would either hang, or cause the machine to reboot. I have not found a compelling solution but I have now completed the exercise. Here are my notes. … 

I used the apt tools either apt or apt-get. I used the CLI. I eventually uninstalled wolfram-engine because it was so big; its size jeopardised the downloads becase I have a small SD card. (You might like to uninstall libreoffice as it’s so large and pretty unused on a Pi, at least by me.) Stretch is quite big.

This article at the Raspberry PI site  describes upgrading the distro.

Bloody hell. Is nice the answer to apt’s bad behaviour? It would seem not.

I should document the hardware version, Raspberry Pi 3 Model B Rev 1.2

As I said, as I moved forward from a two year old Jessie OS image to Stretch, I find that often apt-get causes a hang or a reboot. There’s some stuff on google, but nothing fabulously compelling. Using nice still had problems. I used a combination of the following commands

# dpkg --configure -a
$ sudo nice apt-get dist-upgrade
# apt-get update && apt-get upgrade
# reboot
# apt --fix-broken install
# apt autoremove

Anecdotally it seemed to often fail when updating systemd files

Complete pain in the bum, it’d be useful to know why it fails in this way, so if you know add a comment.

I wrote a script in the hope it might be volume based, and needed to be reminded of apt-get’s interactive & batch switches


DEBIAN_FRONTEND=noninteractive apt-get -y update

It also has a -q switch

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.