Linux Error: Could not open lock file - Permission denied
Question by Guest | 2016-10-31 at 23:09
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
Linux: Program is not executed - Permission denied
Question | 1 Answer
Lazarus Application not running on Linux
Question | 2 Answers
Linux: Mark program file as executable
Tutorial | 0 Comments
Linux Batch Script does not execute
Question | 1 Answer
Linux: Program file not found although existing (No such file or directory)
Question | 1 Answer
Excel Error when opening CSV File: File was detected as SYLK File!
Question | 1 Answer
Linux/Ubuntu: Open current Directory of File Browser in Terminal
Tip | 0 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.
2016-11-01 at 16:30
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