Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I keep getting this warning whenever I try to run sudo apt-get update.

W: Duplicate sources.list entry http://archive.ubuntu.com/ubuntu/ precise-updates/main i386 Packages (/var/lib/apt/lists/archive.ubuntu.com_ubuntu_dists_precise-updates_main_binary-i386_Packages)
W: You may want to run apt-get update to correct these problems

Below is the output from /etc/apt/sources.list file:

deb http://archive.ubuntu.com/ubuntu precise main restricted
deb-src http://archive.ubuntu.com/ubuntu precise main restricted

deb http://archive.ubuntu.com/ubuntu precise-updates main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-updates main restricted

deb http://archive.ubuntu.com/ubuntu precise universe
deb-src http://archive.ubuntu.com/ubuntu precise universe
deb http://archive.ubuntu.com/ubuntu precise-updates universe
deb-src http://archive.ubuntu.com/ubuntu precise-updates universe

deb http://archive.ubuntu.com/ubuntu precise multiverse
deb-src http://archive.ubuntu.com/ubuntu precise multiverse
deb http://archive.ubuntu.com/ubuntu precise-updates multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-updates multiverse

deb http://archive.ubuntu.com/ubuntu precise-security main restricted
deb-src http://archive.ubuntu.com/ubuntu precise-security main restricted
deb http://archive.ubuntu.com/ubuntu precise-security universe
deb-src http://archive.ubuntu.com/ubuntu precise-security universe
deb http://archive.ubuntu.com/ubuntu precise-security multiverse
deb-src http://archive.ubuntu.com/ubuntu precise-security multiverse

How do I fix it?

share|improve this question
2  
try ls /etc/apt/sources.list.d/ maybe you have some "extra" repo in their; – konrad Apr 10 '12 at 7:16
I have the same problem. I can also confirm the bug exists even without duplicate entries. For me, the item that set it in motion was trying to install the advance wine ppa, then removing it when it asked for a partial upgrade. – Mittenchops Jan 12 at 6:57
+1 konrad, I had an entry in /etc/apt/sources.list duplicated by a file in /etc/apt/sources.list.d/ - obviously I missed the switch from monolithic /etc/apt/sources.list to custom repos in a directory. Thanks – earcam Mar 14 at 0:37

6 Answers

I had the same problem, open software sources. unchecked "Canonical Partners". The Conflict is between "Canonical Partners" and " Canonical partners Added by software Center"

share|improve this answer

If you couldn't figure it out in your source.list, then do this:

  1. Left-click on settings icon (at the extreme top corner of your screen) and select System Settings.
  2. Click on Software Sources and move to Other Software.
  3. Uncheck one of the 'Canonical Partners(Source Code) -software packaged by Canonical for their partners' files and one of the 'Canonical Partners -software packaged by Canonical for their partners' files also and click Close to leave.
  4. Simultaneously press CTRL+ALT+T keys to open terminal and type sudo apt-get update.
share|improve this answer
I followed your suggestions, but still I am getting this error. – Harbhag Apr 11 '12 at 8:08
Please, post the image of your 'Software Sources' here to know the culprit. – all4naija Apr 11 '12 at 18:19
Please, post the image of your 'Other Software' here. – all4naija Apr 11 '12 at 18:22

It sounds like you have two identical lines in your /etc/apt/sources.list file.

Go to terminal, and enter sudo editor /etc/apt/sources.list, then look for any identical lines in that file, and if you find them, delete them. After your done, save and exit, and then do sudo apt-get update and that should resolve your problem.

If that doesn't solve your problem then you're going to have to use the trail and error approach. First, create a backup of your sources.list file, then in the actual file go through and comment out or delete each line, saving and apt-get update-ing after each line has been commented out or deleted. Going through this file line by line commenting out different lines will eventually tell you which line is the superfluous one. Don't forget to uncomment any lines you commented if apt-get update still shows the same prompt, otherwise you'll be left with no sources in your sources.list file.

share|improve this answer

Did you check ls /etc/apt/sources.list.d/? Maybe you have some "extra" repositories in there?

share|improve this answer

In my case the duplicates were in the prerequists-sources.list file. I was able to continue the upgrade by running the following commands in the Terminal:

sudo mv /etc/apt/sources.list.d/prerequists-sources.list /tmp
sudo apt-get update

Then go to the Update Manager and install the updates.

share|improve this answer

Just sudo gedit sources.list of the file where the Duplicate is and remove the line or put the # before the line!

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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