E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

Asked by dexter holmes

Unable to download any software - just given the above.

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu update-manager Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
marcobra (Marco Braida) (marcobra) said :
#1

Reboot your pc...

Open a Terminal from the menu Applications->Accessories->Terminal

**Tip: right click with mouse on the top terminal windows title caption and select the menu item "Always on Top"
doing this you will force the terminal window to stay on top of the other windows and you will find very easy
to copy single row from this web page into the terminal...
Something more about using the terminal https://help.ubuntu.com/community/UsingTheTerminal

Then type or better copy and paste a row a time then press enter:
(Tip: select the single row to copy from this page then right click and select copy then click into the terminal window
and to quick paste click with middle button of mouse )

Copy and paste the rows below, copy and paste one row a time (see the **Tip) then press enter:

sudo dpkg --configure -a
sudo apt-get -f install
sudo apt-get --fix-missing install
sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update

give your user password when requested, you don't see nothing when you type it, then press enter.

Then retry...

Hope this helps

Revision history for this message
A. Denton (aquina) said :
#2

Also run: «dpkg --purge `dpkg --get-selections | grep deinstall | cut -f1`» to get rid of old packages. By the way: I think unsing sudo would have been sufficient. The error message already made it very clear ([..] Permission denied [..] Are you root?). In case you use Synaptic run it with sudo as well!

Can you help with this problem?

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

To post a message you must log in.