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.

  • Welcome to Ask Ubuntu! What program/utility are you using to edit sources.list? Dec 5, 2011 at 14:02
  • It would be much safer to edit using Ubuntu Tweak (my preferred) or Ubuntu Software Center.
    – david6
    Dec 8, 2011 at 1:54

3 Answers 3


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: http://en.wikipedia.org/wiki/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.


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.


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/libnautilus-gksu.so /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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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