Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43788 (apt-get

Asked by madhu

 apt-get dist-upgrade
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43788 (apt-get)
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?

I am trying to upgrade a server Ubuntu 20 to 22 .I am facing an issue as above.

How to fix it?

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu update-manager-core Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

1. There is neither an "Ubuntu 20" nor "Ubuntu 22", but each year there are two independent Ubuntu releases, e.g. 20.04, 20.10, ..., 22.04 and 22.10. I assume that you intend to do a release-upgrade from 20.04 to 22.04

2. The package management system makes sure that at a certain moment only one process can update software packages (imagine that in one window you install package A that depends on already-installed package B, but in a second window you uninstall package B at the same time - what do you expect that the package management system should do?)

Apparently there is one apt-get process already running, and thus you have to wait for it to finish, before you can start another "apt-get dist-upgrade".

Revision history for this message
Eric Macharia (b14) said :
#2

You need administrator rights. Run with "sudo apt-get dist-upgrade"

Revision history for this message
madhu (madhureddy7396) said :
#3

root@cxo-ibd-kafka-test-producer:~# sudo apt-get dist-upgrade
E: Could not get lock /var/lib/dpkg/lock-frontend. It is held by process 43788 (apt-get)
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?
root@cxo-ibd-kafka-test-producer:~#

Revision history for this message
Manfred Hampl (m-hampl) said :
#4

What is the output of the command

ps ax --pid 43788

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

  43788 ? S 0:38 apt-get dist-upgrade

Some user has started the "apt-get dist-upgrade" command and it is still not complete.
It seems that that process is somewhat stalled.
You might try ending the process, either by killing it or by a complete reboot.

Can you help with this problem?

Provide an answer of your own, or ask madhu for more information if necessary.

To post a message you must log in.