Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I need to alter sources.list I am able to make the changes but it will not save, keeps saying I don't have the permissions to do that.

share|improve this question
Welcome to Ask Ubuntu! What program/utility are you using to edit sources.list? – Christopher Kyle Horton Dec 5 '11 at 14:02
It would be much safer to edit using Ubuntu Tweak (my preferred) or Ubuntu Software Center. – david6 Dec 8 '11 at 1:54

You need root privileges to edit that file. Open the file from a terminal and type "sudo" in front of your editor of choice. More on sudo:

For example:

sudo nano /etc/apt/sources.list

Nano is a fairly simple editor. See this question How to edit files in a terminal with nano? if you want to know more on how to use it.

share|improve this answer

You can use gedit as your text editor, which is the default text editor on Ubuntu 11.10 and edit the /etc/apt/sources.list file by running this command:

gksudo gedit /etc/apt/sources.list

What this does is it opens the file with root privileges using gedit, which is your default text editor.

share|improve this answer
gksu please.… – andrewsomething Dec 5 '11 at 15:01
Thank you. So is it gksudo or gksu? – jasoncruz98 Dec 6 '11 at 3:03
In Ubuntu, those are actually the same thing:… – andrewsomething Dec 7 '11 at 17:49

To be able to edit files with root privileges directly from the standard file browser, Nautilus, install nautilus-gksu. This will add a "Open as administrator" entry to the context (right click) menu in Nautilus.

enter image description here

To install, in a terminal, type

sudo apt-get install nautilus-gksu

To get the entry to show in 11.10 also run

sudo cp /usr/lib/nautilus/extensions-2.0/ /usr/lib/nautilus/extensions-3.0/

Then log out and in again, and go to the sources.list file in Nautilus. Right click it, choose "Open as Administrator", authenticate and the text file will open in gedit with superuser rights.

share|improve this answer

Your Answer


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.