How do I change my user permissions to edit /etc/apt/sources.list?

62,546

Solution 1

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.

Solution 2

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:
62,546

Related videos on Youtube

Jorge Castro
Author by

Jorge Castro

Updated on September 18, 2022

Comments

  • Jorge Castro
    Jorge Castro over 1 year

    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.

    • Knowledge Cube
      Knowledge Cube over 12 years
      Welcome to Ask Ubuntu! What program/utility are you using to edit sources.list?
    • david6
      david6 over 12 years
      It would be much safer to edit using Ubuntu Tweak (my preferred) or Ubuntu Software Center.
  • red.clover
    red.clover over 12 years
  • user85343
    user85343 over 12 years
    Thank you. So is it gksudo or gksu?
  • red.clover
    red.clover over 12 years
    In Ubuntu, those are actually the same thing: askubuntu.com/questions/21033/…