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

I get this error whenever I try to install programs using the terminal:

home@ubuntu:~$ apt-get install myunity
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?

Also I'm unable to install updates using the terminal.

share|improve this question
2  
This isn't a duplicate, same error, but different reasons. – Jorge Castro Dec 1 '12 at 18:56

2 Answers

According to the community documentation about using the terminal,

sudo: Executing Commands with Elevated Privileges

  1. Most of the following commands will need to be prefaced with the sudo command. This elevates privileges to the root-user administrative level temporarily, which is necessary when working with directories or files not owned by your user account. When using sudo you will be prompted for your password. Only users with sudo (administrative) privileges will be able to use this command. You should never use normal sudo to start graphical applications as Root (Please see RootSudo for more information on using sudo correctly.)

So, because apt-get installs software and thus affects the system, you need to use the sudo command to give yourself administrator privilages.

Thus, you command should be sudo apt-get install myunity

If you want to update your system, run

sudo apt-get update
sudo apt-get dist-upgrade

This will update your system's package database and then install any upgrades.

share|improve this answer
@Raghav if this is correct answer, can you please mark it as your accepted answer. – iBelieve Nov 30 '12 at 16:11

Just read the error output: are you root? because you are not. As a regular user you don't have enough privileges to install packages.

Prepend sudo to the command to elevate the privileges. Provided that account has sudo privileges that will work.

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.