1

After I login ubuntu, as usual, I check upgradable packages by running: sudo apt update. Then the result is:

36 packages can be upgraded. Run 'apt list --upgradable' to see them.

I continue with the command:sudo apt upgrade but I got error:

E: Could not get lock /var/lib/dpkg/lock-frontend - open (11: Resource temporarily unavailable) E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), is another process using it?

I waited for a few moments and then I rerun the previous command and it told me:

2 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. Is it an apt error or there's an update process running on the background?

Newbie
  • 113
  • yes there is a background process doing the upgrade ... by the sounds of it you are fine ... if you reissue same command it will be OK now – Scott Stensland Aug 21 '19 at 13:15

2 Answers2

1

You are duplicating the work being done by Unattended Upgrades, so encountering interference is expected behavior.

Take a look at the Software & Updates control panel, the 'Updates' tab:

enter image description here

Look at the line: When there are security updates

Those security updates are downloaded-and-installed-automatically using apt...just like updates that you initiate. Security updates can occur at any time, but often occur just after startup.

Since only one apt session can run at a time, one of you gets locked out with an error message until the current apt session completes. That lockout is the classic error message you encountered. Another process was indeed using apt at the time.

If you want to verify, look at /var/log/apt/history.log. You will likely see two sessions, one that installed the security updates, and another (yours) that installed the rest.

Interfering with Unattended Upgrades causes no damage. The same packages get installed regardless of who initiates the upgrade or when.

user535733
  • 62,253
0

It is the most common error and question while installing an application in ubuntu :) You can use the below references. I hope these are useful to you.

  • 1
    Can you link the references by name instead of "this" and "this"? Would also be nice to briefly describe their contents. – xiota Aug 21 '19 at 13:30
  • Naked URLs aren't great either. What makes these particular links applicable to the question? A brief summary of the proposed solution would be helpful. – xiota Aug 21 '19 at 13:46