Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Possible Duplicate:
Error when enter a command - Permission denied, are you root?

I tried to install gcc and other packages on ubuntu booted from a live usb stick. All I see is the following error

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

I think this might be because I have not installed ubuntu on my system, its just booted from a usb stick. If that is really the problem here then could someone please give me a solution to install packages in such a scenario. I cannot install ubuntu on my system as I dont have any free partition and I cannot delete the existing ones as I don't have an external storage device to back up my data. Thank you.

share|improve this question
    
if you have space free on an existent partition, the ubuntu installer can resize it and make another partition using the freed space (or you can do that manually with gparted from your live USB). –  laurent Jan 2 '13 at 12:32
add comment

marked as duplicate by gertvdijk, hhlp, Ringtail, Stephen Myall, raaz Jan 2 '13 at 16:20

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

1 Answer

You need to use sudo apt-get install gcc or sudo apt-get install build-essential

obs: the error message asks "are you root?". You need to be root or use sudo to use the apt-get command.

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.