nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Editing /etc/apt/sources.list file

Wed Jul 24, 2013 6:26 am

Hi,

I'm trying to follow the instructions on this page refering to a uv4l driver: http://www.linux-projects.org/modules/s ... e&artid=14

It says that I need to add a line to the etc/apt/sources.list file. After looking around for hours I found 4 ways to do it and none of them work.

Option 1: $ echo " deb http://www.linux-projects.org/listing/u ... /raspbian/ wheezy main" | sudo tee -a etc/apt/sources.list
Result: Couldn't do it because my keyboard wont make a pipe symbol for some reason.

Option 2: $ sudo add-apt-repository " deb http://www.linux-projects.org/listing/u ... /raspbian/ wheezy main"
Result: command not found apt-repository

Option 3: Manually found the file opened it and wrote in " deb http://www.linux-projects.org/listing/u ... /raspbian/ wheezy main"
Result: File wont save saying "Can't open file to write"

Option 4: gksudo gedit /etc/apt/sources.list
Result: Should ask for password, but instead gives me a lengthy explanation about how I am accessing the sources.list file without a password and am allowed to due to some root thing, but overall nothing happens its just a information box that I can close and then im back at the terminal.

Can anyone tell me a way to add that line to the sources.list file because everything says to "just add this line" but "just adding a line" is way harder than I could have ever imagined.

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

Re: Editing /etc/apt/sources.list file

Wed Jul 24, 2013 7:15 am

I'd recommend just using "sudo nano /etc/apt/sources.list".

Actually, I'd use vi instead of nano, as that is what I'm used to, but nano is easier to get started with. :)

nickneubrand
Posts: 29
Joined: Fri Apr 26, 2013 4:54 am

Re: Editing /etc/apt/sources.list file

Wed Jul 24, 2013 7:21 am

Ok sounds good, but once i run that command what is going to happen? I'm new to editing these types of files through the terminal, so will I be inputing what I want through the terminal or will this open a text doc to the point where i can do a "save"?

Sorry for the questions, but I need a 100% walk through on this. i.e. exactly what to type.

User avatar
joan
Posts: 14473
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Editing /etc/apt/sources.list file

Wed Jul 24, 2013 7:51 am

If you're worried make a copy of the file first.

cd /etc/apt
cp sources.list sources.list.old


then

sudo nano sources.list

Then type in text. The status line gives you the keys to use to save and exit the file.

If you make a mistake when you save the file you can recover the original by

sudo cp sources.list.old sources.list

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

Re: Editing /etc/apt/sources.list file

Wed Jul 24, 2013 7:58 am

Nano is a simple terminal based text editor.

The command will start the editor with the /etc/apt/sources.list file in it.

You can use the cursor arrow keys to move around and just type an extra line on the end, as you'd expect.

At the bottom of the screen you will see instructions on how to "write out" (save) your edited file (Press Ctrl and "O"), and exit (Ctrl-X). So just make the changes you need, press Ctrl-O to save and Ctrl-X to exit the editor.

esotericmachine
Posts: 1
Joined: Fri Dec 21, 2018 11:21 pm

Re: Editing /etc/apt/sources.list file

Fri Dec 21, 2018 11:26 pm

I was attempting this also (modifying the source.list file for UV41).

I managed to mess up the file and it saved on me. How can I fix this problem. Is there a source with the original plan contents someplace? :cry:

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

Re: Editing /etc/apt/sources.list file

Sat Dec 22, 2018 4:27 am

That's a very old post you're replying to. Some of the information in it is probably out of date now. It might have been a better idea to start a new topic to say you have accidentally damage the sources.list file and would like to know what it should contain.

However, this is what I have in a fairly recent /etc/apt/sources.list file

Code: Select all

deb http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ stretch main contrib non-free rpi
and this is what I have in /etc/apt/sources.list.d.raspi.list

Code: Select all

deb http://archive.raspberrypi.org/debian/ stretch main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ stretch main ui

Return to “Raspbian”