Page 1 of 1

Cant edit source.list

Posted: Sun Apr 21, 2013 12:38 am
by peterfurfari
Hello all! I have read half of the Debian Administrators Handbook and I still do not know how to edit my /etc/apt/source.list. I tried sudo nano /etc/apt/source.list but my changes did not appear when I approached it from the file manager. I am trying to get to the raspbian repository and i have spent the better part of two days chasing snipes. Help would be much appreciated.
Sincerely,
Peter

Re: Cant edit source.list

Posted: Sun Apr 21, 2013 8:23 am
by DeeJay
Presumably related to a similar post about apt-get?

The name of the file is
/etc/apt/sources.list
But for a fresh installation of Raspbian there should be no need to 'fiddle' - the correct default repository is pre-configured.

Re: Cant edit source.list

Posted: Sun Apr 21, 2013 12:17 pm
by peterfurfari
Thank you,
ethernet cable connection was partly to blame. I am able to update and use Midori, however I am getting this message ;
W: Failed to fetch http://mirrordirector.raspbian.org/rasp ... f/Packages 404 Not Found

Should I edit the line in the sources.list using nano?

Re: Cant edit source.list

Posted: Sun Apr 21, 2013 12:51 pm
by rpdom
Could you copy/paste the contents of your current sources.list file (preferably in a Code block to make it more readable), so we can compare it with ours?

Mine is

Code: Select all

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
I think you might be missing a space between the end of "raspbian/" and "wheezy"?

Re: Cant edit source.list

Posted: Thu Apr 25, 2013 2:32 am
by peterfurfari
Thank you, rpdom. You were right. I was missing the space. I wish i understood more about the workings of writing in the terminal. Any recommendations?

Re: Cant edit source.list

Posted: Sat Mar 24, 2018 3:10 pm
by uroborous
i know i am resurrecting a zombie thread but... i am having the same problem. i am trying to upgrade to stretch but when i follow the directions posted on: https://www.raspberrypi.org/blog/raspbian-stretch/
where it tells the user to edit every instance of the word "jessie" to the word "stretch" when i go to save my changes i get the error message: "cant open file to write"
i have tried making a whole new sources.list file and then copy pasting the contents of the old one into the new one with changes made, and that will save just fine. but when i go to replace or delete the old one it tells me "permission denied"
i am stuck. i have also tried right clicking on the file and altering the permissions but i once again get "permission denied"
please help.

Re: Cant edit source.list

Posted: Sat Mar 24, 2018 3:17 pm
by KLL
better just get a new system from https://www.raspberrypi.org/downloads/raspbian/
and burn it with https://etcher.io/ over that old sd card / or a new card.

system files are owned by root / protected,
user pi can write them with

sudo nano /etc/dhcpcd.conf
to config fix IP... example
but actually that was mentioned here
(Both files will require sudo to edit.)

but, as you installed your RASPBIAN via NOOBS 2.7 only 2 days ago, how you can have JESSIE and need dist-upgrade to STRETCH?

Re: Cant edit source.list

Posted: Sat Mar 24, 2018 5:34 pm
by HawaiianPi
To edit any file outside your home directory you need elevated privileges (you need to edit them as root).

To do that you can open the editor using the "sudo" command.

For example, sudo nano /etc/apt/sources.list will open it in the command line nano editor.

Code: Select all

sudo nano /etc/apt/sources.list
For the GUI (Desktop) text editor use:

Code: Select all

gksudo leafpad /etc/apt/sources.list
Note that it is recommended to start over with a clean install. Upgrading from one version to the next can cause issues which are difficult to troubleshoot.

Re: Cant edit source.list

Posted: Mon Apr 02, 2018 8:25 pm
by liambedded
Hello!

I think I have a similar issue. and i am not sure how to solve it. I opened the souce list with

Code: Select all

sudo vim /etc/apt/sources.list.d/raspi.list
When I try to edit it in order to add the source, I just cannot edit it. The text I need to add is

Code: Select all

 deb http://ftp.debian.org/debian jessie-backports main 
at the end of the source.

Hope somebody can help me. Thanks in advance.