peterfurfari
Posts: 4
Joined: Sun Apr 21, 2013 12:24 am

Cant edit source.list

Sun Apr 21, 2013 12:38 am

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

User avatar
DeeJay
Posts: 2027
Joined: Tue Jan 01, 2013 9:33 pm
Location: East Midlands, UK

Re: Cant edit source.list

Sun Apr 21, 2013 8:23 am

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.
How To Ask Questions The Smart Way: http://www.catb.org/~esr/faqs/smart-questions.html
How to Report Bugs Effectively: http://www.chiark.greenend.org.uk/~sgtatham/bugs.html

peterfurfari
Posts: 4
Joined: Sun Apr 21, 2013 12:24 am

Re: Cant edit source.list

Sun Apr 21, 2013 12:17 pm

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?

User avatar
rpdom
Posts: 17170
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Cant edit source.list

Sun Apr 21, 2013 12:51 pm

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"?

peterfurfari
Posts: 4
Joined: Sun Apr 21, 2013 12:24 am

Re: Cant edit source.list

Thu Apr 25, 2013 2:32 am

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?

uroborous
Posts: 5
Joined: Wed Jan 25, 2017 7:18 am

Re: Cant edit source.list

Sat Mar 24, 2018 3:10 pm

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.

User avatar
KLL
Posts: 1453
Joined: Wed Jan 09, 2013 3:05 pm
Location: thailand
Contact: Website

Re: Cant edit source.list

Sat Mar 24, 2018 3:17 pm

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?

User avatar
HawaiianPi
Posts: 5838
Joined: Mon Apr 08, 2013 4:53 am
Location: Aloha, Oregon USA

Re: Cant edit source.list

Sat Mar 24, 2018 5:34 pm

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.
My mind is like a browser. 27 tabs are open, 9 aren't responding,
lots of pop-ups...and where is that annoying music coming from?

liambedded
Posts: 1
Joined: Mon Apr 02, 2018 7:53 pm

Re: Cant edit source.list

Mon Apr 02, 2018 8:25 pm

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.

Return to “Beginners”