0

trying to install Tor on Debian 8.11 following Tor project instructions, i get this warning when updating the system

W: Duplicate sources.list entry http://security.debian.org/ jessie/updates/main amd64 Packages (/var/lib/apt/lists/security.debian.org_dists_jessie_updates_main_binary-amd64_Packages)
W: You may want to run apt-get update to correct these problems

This is my /etc/apt/sources.list

deb http://ftp.debian.org/debian/ jessie main
deb http://security.debian.org/ jessie/updates main
deb http://ftp.us.debian.org/debian jessie main contrib
deb http://security.debian.org jessie/updates main contrib non-free
deb http://ftp.us.debian.org/debian jessie-updates main
deb https://deb.torproject.org/torproject.org jessie main
deb-src https://deb.torproject.org/torproject.org jessie main

How can i safely solve this ? Do i have to remove or comment out the second line in my source list ?

I don't understand what happened.

1

You can indeed comment out, or remove entirely, the second line in your sources.list. There is another non-obvious duplicate entry, so I would recommend changing your sources.list to

deb http://ftp.us.debian.org/debian jessie main contrib
deb http://security.debian.org jessie/updates main contrib
deb http://ftp.us.debian.org/debian jessie-updates main
deb https://deb.torproject.org/torproject.org jessie main
deb-src https://deb.torproject.org/torproject.org jessie main

(dropping non-free, and dropping ftp.debian.org in favour of ftp.us.debian.org).

You can make a backup copy and edit the file in one command:

sudo sed -i.bak '1,2d;s/ non-free//' /etc/apt/sources.list

This will make a copy of the original file in /etc/apt/sources.list.bak.

0

You can always make a backup copy of your sources.list before you change something.

But yes, it seems like you need to comment out your duplicate lines. Try this:

sudo mv /etc/apt/sources.list /etc/apt/sources.list.bak

sudo sort -u /etc/apt/sources.list.bak > /etc/apt/sources.list

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.