Are you root?

Asked by Michelle Walker

I had a problem with Adobe Flash on YouTube. The problem is soved but I also got the message that the following program were installed but are no longer needed and to remove them. These are the programs and solutions the terminal offered:

libxine1-x libxine1-misc-plugins libxcb-xv0 libxine1-bin libxcb-shape0
  phonon-backend-xine libxcb-shm0 libxine1-console libxine1
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

And this is what happened when I put in the command:

michelle@michelle-desktop:~$ apt-get autoremove
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?

What does this mean? First time I have seen this message.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Eliah Kagan
Solved:
Last query:
Last reply:
Revision history for this message
Best Eliah Kagan (degeneracypressure) said :
#1

Run this instead:

sudo apt-get autoremove

If you're asked for your password, type it in. Don't worry that nothing appears to change on the screen as you're typing it. Once you've typed it in, press enter.

You are right not to run all commands with sudo, as that is often not appropriate and can cause problems. But when a command needs to be run as root (which is what that message is trying to remind you), you should prepend "sudo " to the beginning of it.

Revision history for this message
Michelle Walker (milore55) said :
#2

Thanks that solved my problem.

Revision history for this message
Michelle Walker (milore55) said :
#3

Ok that worked, but the instructions I wrote in my question were actually
the instructions I got from the terminal (I copied and pasted it into the
question)...there was no 'sudo' in the instructions. Interesting. Still
learning about this OS!

Thanks

On Mon, Mar 21, 2011 at 9:53 PM, Eliah Kagan <
<email address hidden>> wrote:

> Your question #149964 on Ubuntu changed:
> https://answers.launchpad.net/ubuntu/+question/149964
>
> Status: Open => Answered
>
> Eliah Kagan proposed the following answer:
> Run this instead:
>
> sudo apt-get autoremove
>
> If you're asked for your password, type it in. Don't worry that nothing
> appears to change on the screen as you're typing it. Once you've typed
> it in, press enter.
>
> You are right not to run all commands with sudo, as that is often not
> appropriate and can cause problems. But when a command needs to be run
> as root (which is what that message is trying to remind you), you should
> prepend "sudo " to the beginning of it.
>
> --
> If this answers your question, please go to the following page to let us
> know that it is solved:
> https://answers.launchpad.net/ubuntu/+question/149964/+confirm?answer_id=0
>
> If you still need help, you can reply to this email or go to the
> following page to enter your feedback:
> https://answers.launchpad.net/ubuntu/+question/149964
>
> You received this question notification because you are a direct
> subscriber of the question.
>

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#4

Yes, the instructions from the Terminal ("Use 'apt-get autoremove' to remove them.") were correct. Commands that change what packages are installed on your computer have to be run as root, and running the command

sudo apt-get autoremove

causes the program 'sudo' to run the command

apt-get autoremove

as root.

It is perhaps relevant to add that there are other ways to run commands as root besides sudo (and other ways than that, to use sudo to run commands as root), though most of those ways are not used, and not recommended for use, in Ubuntu. When apt-get gives you the message about running "apt-get autoremove", it doesn't know what method you are going to use to run it as root. The developers probably figured that, since the user was able to run "apt-get" as root the first time (to see that message), the user is also able to run "apt-get autoremove" as root.

If you feel that it should explicitly indicate that "apt-get autoremove" should be run as root, then while I suspect you'd be in the minority, you can get this idea heard and considered by filing a bug on Launchpad about it, against the package apt in Ubuntu. If you want to do that, it is important to read https://help.ubuntu.com/community/ReportingBugs carefully first. This is a highly specific feature request, and http://brainstorm.ubuntu.com is typically used for wider-ranging matters, but you could post there too (or instead of filing the bug), if you wish. If you do both, you should link the bug report and the brainstorm post to each other. If you file a bug, you can link this question to it using the "Link existing bug" link on this page (i.e. at https://answers.launchpad.net/ubuntu/+source/sudo/+question/149964), but the bug report should be self-contained; it should not be necessary for the Ubuntu developers to refer to this question in order to understand and appreciate the idea presented in your bug report.