Score:3

Ubuntu freezes on boot whenever there are packages to be upgraded

es flag

It get's stuck on the boot screen with the Ubuntu spiral thing.
This happens whenever there are packages to be upgraded (via sudo apt-get upgrade)
Why does this happen and how to fix it?
Version: 20.04

Edits: (based on Bruni's comment)

How do you know there are packages to be upgraded if you are hang on the boot screen? How do you overcome this?

I boot into recovery mode, run dpkg over there to find that some packages need upgrades. The upgrades here (in the recovery mode) fail due to some network related issue. Then I update the grub through the recovery mode itself, this works fine. After this I resume, it get's stuck on a black screen with a blinking cursor. Then I force shutdown and power it back on. This time it boots perfectly. Then I run sudo apt-get upgrade normally. The boot problem doesn't happen anymore (whenever it happens, there are some upgrades to install).

What is your disc setup (e.g. are there any partitions mounted that are on external disks)

I'm on a dual-boot system with UEFI secure-boot enabled. Windows is on SSD. I have partitioned the HDD into 2 parts. One part is used by Windows. The remaining is entirely for Ubuntu. Apart from the bootloader, I don't think there's any interaction between windows and ubuntu whatsoever.

Does this occur irrespective of the type of packages that are to be upgraded?

Yes

Bruni avatar
cn flag
Hello, could you elaborate a bit. How do you know there are packages to be upgraded if you are hang on the boot screen? How do you overcome this? What is your disc setup (e.g. are there any partitions mounted that are on external disks). Does this occur irrespective of the type of packages that are to be upgraded?
es flag
@Bruni I have edited my question to include these details
Score:0
pl flag

Disable automatic updates if they are not yet disabled. Edit /etc/apt/apt.conf.d/20auto-upgrades and change contents from

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Unattended-Upgrade "1";

to

APT::Periodic::Update-Package-Lists "0";
APT::Periodic::Download-Upgradeable-Packages "0";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "1";

(source). This is an attempt at a workaround. You shouldn't see this problem even with automatic updates enabled. But it may work.

You can also do that via GUI. Go to Activities (at the top left corner, or Win key -> software (in the search bar) -> Software & Updates -> Updates -> Automatically ...

es flag
That would probably fix it, but why does it happen in the first place?
sancho.s ReinstateMonicaCellio avatar
pl flag
@helperFunction - I wouldn't know, but it is useful to begin with if you posted the results of this attempt. It can even be helpful for tracking down the cause.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.