0

as written here, I should put this lines:

deb mirror://mirrors.ubuntu.com/mirrors.txt precise main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-updates main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-backports main restricted universe multiverse
deb mirror://mirrors.ubuntu.com/mirrors.txt precise-security main restricted universe multiverse

on the top in my /etc/apt/sources.list file, and this should be all that is needed to make it automatically pick a mirror for me based on my geographical location.

because the file sources.list is read-only, what should I do?
tried
$ sudo mount -o rw,remount /etc/apt/sources.list
but it wasn't found..

Tzahi Leh
  • 261

2 Answers2

3

Let's check the default permission of /etc/apt/sources.list:

-rw-rw-r-- 1 root root 2563 Aug 21 04:24 /etc/apt/sources.list 

As you can see only user root and the members of group root can write to the file, all other users while trying to edit the file will get a message saying that the file is read only for them.

To edit the file, just use sudo to impersonate root e.g. using nano :

sudo nano /etc/apt/sources.list

or gedit:

sudo -H gedit /etc/apt/sources.list
heemayl
  • 91,753
  • Do you really think that OP will be able to use vim? – Pilot6 Sep 11 '15 at 21:16
  • 1
    @Pilot6 That goes as an example as you can see i.e. i am not telling OP to use vim, its merely an example..on a different note how come you are confident about what they are comfortable with ? – heemayl Sep 11 '15 at 21:18
  • I know. But OP does not know anything about permissions or sudo. So this is not a good example. Even nano will cause problems how to paste there. – Pilot6 Sep 11 '15 at 21:19
  • actually I do understand the sudo command, I know it is like "open as manager" in windows.. I did it and opened it with gedit, added the code and it worked. thanks! – Tzahi Leh Sep 11 '15 at 21:28
  • @TzahiLeh Glad it helped :) – heemayl Sep 11 '15 at 21:29
1

You do not have yo edit the /etc/apt/sources.list manually.

You can go to System Settings -> Software & Updates and setup your mirror there in GUI. It is "Download from" drop down menu.

Pilot6
  • 90,100
  • 91
  • 213
  • 324