Permission denied, are you root?

The solution is to read the error message: are you root?. Use sudo to run a command with root privileges, like so: sudo apt-get update


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.


Before running any administrative task: installing, removing, changing system wide preferences, etc. you need to be root. This is specially true for apt-get. The message itself tells you where the problem is:

are you root?

If you are not root, the install command will not work at all.

The way to fix this is using sudo before the command:

➜  ~  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?
➜  ~  sudo apt-get update
Fetched 616 kB in 25s (23.9 kB/s)

As you can notice, it completed without problems when I used sudo. If you have any open (13: Permission denied) it is almost sure that you are not root and need to use sudo.

Tags:

Apt