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.

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

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.

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
3  
gksu please. unix.stackexchange.com/questions/2958/… –  andrewsomething Dec 5 '11 at 15:01
    
Thank you. So is it gksudo or gksu? –  jasoncruz98 Dec 6 '11 at 3:03
1  
In Ubuntu, those are actually the same thing: askubuntu.com/questions/21033/… –  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/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.

share|improve this answer

Your Answer

 
discard

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.