Linux Error: Could not open lock file - Permission denied
Question by Guest | Last update on 2021-05-17 | Created on 2016-10-31
I have just tried to install a package on Linux. For this, I have typed the following command into the terminal:
apt-get install packagename
However, the installation fails. I get the following error message:
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administrator directory (/var/lib/dpkg/), are you root?
I have no idea what that could mean or what is going wrong here.
What can I do to fix that?
Related Topics
Lazarus: Program without GUI - Many WSRegister Errors
Question | 6 Answers
XAMPP: How to set up SSL/HTTPS for local Projects
Tutorial | 4 Comments
Linux: Mark Program File as executable
Tutorial | 0 Comments
Android SDK Manager: Problem with installing packages "File not Found (Access is denied) Done. Nothing was installed"
Question | 4 Answers
Linux: Program is not executed - Permission denied
Question | 1 Answer
VirtualBox: Change Date and Time
Tutorial | 10 Comments
How to resize Image before Upload in Browser
Tutorial | 13 Comments
Important Note
Please note: The contributions published on askingbox.com are contributions of users and should not substitute professional advice. They are not verified by independents and do not necessarily reflect the opinion of askingbox.com. Learn more.
Participate
Ask your own question or write your own article on askingbox.com. That’s how it’s done.
You have to execute the command as administrator to make it work. This is also the reason why there is the question "are you root".
Instead of "apt-get" you have to write "sudo apt-get". With adding "sudo", you are running the following command as admin respectively root.
After pressing the enter key, the terminal will ask you for your root password. If you have entered and confirmed it, the package installation will proceed.
Last update on 2021-05-17 | Created on 2016-11-01
That is brilliant. I had cancelled an operation just prior so I was sure the lock was stuck in an inconsistent state and spent ages trying to fix that non-existent problem. Thanks so much!!!
2021-03-04 at 19:31