Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Whenever trying to install any software and update manger,

I get an error stating

Package operation failed
The installation or removal of a software package failed

When I run sudo apt-get update I got this result:

conan51xd@conan51xd-Lenovo-B470:~$ sudo apt-get -f install
[sudo] password for conan51xd: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
conan51xd@conan51xd-Lenovo-B470:~$ apt-get update
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
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?
share|improve this question
run sudo apt-get update in terminal and post its output in your question by editing it. – tijybba Jul 12 '12 at 17:30
a sudo apt-get -f install entered into the terminal often works but tijybba is right; post the output of apt-get update if my tip does not work. – onse Jul 12 '12 at 17:32
Thank you,I have posted the output – user66498 Jul 12 '12 at 17:37
The best advice is to reboot , and try it will run just fine. Don't use update manager , Ubuntu software center or apt-get through command line at the same time. – tijybba Jul 12 '12 at 17:42
yes,I know,I don't have use all of them at same times but the problem is when I finish updata,I will get this every times. – user66498 Jul 12 '12 at 17:49
show 2 more comments

2 Answers

up vote 1 down vote accepted

Run this command:
sudo mv /var/lib/apt/lists{,july12}

sudo apt-get update
Then sudo apt-get upgrade

share|improve this answer

E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

This line says you are not authorized to install/update. You need to be root to do it....

You can add sudo before apt-get or you can do sudo -s to be root.

Example: sudo apt-get update

or

sudo -s will consider you as root until you close your terminal.

Then

apt-get update

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.