Whenever I try to get my system up-to-date in Ubuntu 18.04, it stops:
whenever it reaches Setting up linux-headers-<version>-generic
. I cannot cancel the upgrading from there, but even when you and leave it for hours, it doesn't change anything. If I check the process in htop
it shows it now doing anything. If I force the upgrade to end and try to restart it, when I retry the upgrade it says a previous one has been interrupted and I should try it with sudo dpkg --configure -a
which fixes the problem.
I just find it very annoying to have to do this every time there is a header-upgrade available, especially because I feel like it shouldn't happen and there should be a more permanent fix available. What am I missing or doing wrong?
TLDR: Disable Secure Boot.
I started having this same issue about a month ago. For me it turns out the solution was disabling Secure Boot. I've had Secure Boot disabled since I installed Ubuntu 18.04 and it's upgraded without any problems. However, about a month ago, I updated my BIOS which re-enabled Secure Boot (I didn't know this at the time). It was frustrating having the upgrades freeze and I finally figured it out because my VirtualBox installation was also not working. The fix for VirtualBox was disabling Secure Boot which also fixed my
linux-headers-<version>-generic
upgrades.As noted in the question, it would freeze here:
After disabling Secure Boot, I get:
My solution;
You may check the answer on
/var/log/apt/term.log
. This is the location for theapt-get
log. You can also check thedpkg
log file/var/log/dpkg.log
apt
orapt-get
you are using are based ondpkg
internal.One more thing you can identify the process by ID and run
strace -p
to check exactly why it stops.This is rather a general answer to this or similar questions.