apt-get upgrade Ubuntu 21.10

I run apt-get upgrade and I am getting this message:


update-initramfs: Generating /boot/initrd.img-5.13.0-28-generic
I: The initramfs will attempt to resume from /dev/sdb
I: (UUID=2f2bee3d-0f54-4997-9070-d739b82b3616)
I.: Set the RESUME variable to override this.


root@localhost:~# apt-get upgrade
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 1149 (apt- 
N: Be aware that removing the lock file is not a solution and may break your system.
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is 
another process using it?

2 Replies

The error messages regarding initramfs should be safe to ignore, but you can try using sudo apt-get auto-remove to resolve them. There's a bit more information in this other Linode Community Questions post regarding that error, specifically this part:

While I don't have a concrete answer whether multiple kernels exist within your Linode, this sort of situation is typically caused by the apt package manager not cleaning up pre-existing files during the upgrade process. After upgrading to a new Linux kernel, old kernels are not automatically deleted. They remain in your disk (/boot partition) and you have to delete them manually. From reviewing the text file and outputs you've shared this appears to be the likely culprit behind the behavior you are experiencing.

With regards to the "could not get lock" error, this indicates that the apt-get process is still running and trying to update the system. This makes sure that two processes can't make edits to the same files at the same time, which can cause inconsistencies. You can wait for the process to finish running, or you can reboot your Linode if the process seems to be stalled. Alternatively, you can kill the process using sudo kill $processID, where $processID is the ID for the process as identified by the command ps aux | grep -i apt. This AskUbuntu post has more information about this error as well.

Try using apt instead of apt-get. It's been a couple years since I last used Ubuntu, but I seem to rember when first installing and using Ubuntu 16 that the system had a lot more complaints when using the deprecated apt-get command (mainly because it is no longer maintained/supported)


Please enter an answer

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct