Could not open lock file. Are you root?

Hi everyone, I’m having trouble with my Linux mint in which I wanted to install odoo13 but I got these errors:

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

Previously I already kill the apt command just like in the tutorials but I still get this type of errors. Can anyone suggest me other ways to fix these errors ? Thank you in advance

Did you try apt install instead of apt-get install?

What are the results of:
ps aux | grep -i apt
sudo lsof /var/lib/dpkg/lock-frontend
whilst having this issue?

That wasn’t a good idea. That’s why I do not recommend such tutorials that just casually recommend to execute very dangerous actions.

  1. Just killing apt does not remove the lock.
  2. If you want to remove the lock, due to the problem in point 1, you are in extremely dangerous territories.

If you manually delete the APT lock, you may break your entire operating system!

Never run such commands, if you have little Linux knowledge. Especially not, if it involves manually deleting the APT lock.

In your specific case, I would recommend restoring the operating system from a backup, to be safe. Do not fiddle around further in the wrong direction, like removing the APT lock manually, if you do not want to lose all your data and be forced to install the entire operating system anew.

1 Like

Personally I would simply reboot before doing anything to my operating system.

1 Like

You missed sudo in the second command. You used:

sudo apt-get update && apt-get install odoo

The && combines two commands and run them one after another.

When it tries to run apt-get install odoo, it complains about not being root because, well, you are not root. You should have used sudo apt-get install odoo instead.

Correct command will be:

sudo apt-get update && sudo apt-get install odoo

1 Like

Well, I should’ve looked at the picture a bit longer…

Good point!

1 Like

I completely overlooked this. Good, that @abhishek has better eyes.

However: I never try to do stuff like this in one command. I think, it’s preferable to do it step by step.
Besides: It’s always a good idea to set up timeshift for daily backups in case something goes wrong.

@Mina better eyes? Nope. Better spectacles perhaps :eyeglasses:

@Akito I guess my mystery reading and watching experience helps me to find clues like this one :male_detective:


I fully agree to that.
And I will politely add, that some of us ( me include) often jump the gun too fast. :grin: