|
I keep getting this warning whenever I try to run
sudo apt-get update.
Below is the output from /etc/apt/sources.list file:
How do I fix it? |
||||
|
|
|
Your sources.list really has duplicate entries.
First Let's see the correct form of a repository line or source line: The correct format of repository source line is
For example, a repo line can be like this one
Here, it means, the repository is for binary packages, which are hosted in http://archive.ubuntu.com/ubuntu and this repository is for Ubuntu precise (12.04) and this repository contains the main (software which are officially supported by Canonical) component.
Please take note that, you can add one or more component in a line, so "main", "universe", "restricted" and "multiverse" can be in a single line. Also note, Though you add more than one component in a single line, APT system considers them as separate line containing only one component. So, If your sources.list have a line like this
Then it can't have another line like the below (which your files have)
which is equivalent of these two lines
Because, you are duplicating universe twice, so there will be an error for that duplicate. An error is given for each duplicate found and your file has 6 duplicates there.Solution:After analyzing yoursources.list file, I found that, It is a basic one which is supplied by Ubuntu by default. You can build a default file following the procedure:
sources.list file without error. Compare this file with the previous one, if you want.
Update to deal with
Sometimes a duplicate entry can be in a file in the |
|
+1 This is a great answer. Fixed the problem and fully explained what why it had occurred.
– akmad
Apr 27 '13 at 9:13
|
||
|
|
What did I do to cause myself to have duplicate entries in my sources.list.d?
– Seanny123
Nov 11 '13 at 9:19
|
||
|
|
|||
|
|
link to Solve Duplicate source.list entry mentioned here solved my confusion. Try, and if it helps you, praise O.A.K.
– Peter Masiar
Jul 21 '14 at 17:57
|
|
For Ubuntu 12.04
Graphically: Press Alt + F2 and paste software-properties-gtk (or you can open "Software Center" then go to "Edit" > "Software Sources"). Go to tab "Other Software", choose the duplicate entry and press the "Remove" button. If you need a command line option, here it is:
The command does this: cat reads the file and passes the content to perl which removes the duplicate lines. The result is then saved > in a temporary file which is then moved to replace the original /etc/apt/sources.list file. |
|||||||||||||
|
How bad are duplicate entries in sources.list?I don’t know how bad it is, but i don’t like sudo apt-get update showing me duplicate entries.By the way its not that bad, its just showing you that you have duplicate entries. SourcesListThe sources.list file is a key factor in adding or upgrading applications to your Ubuntu installation. This is also used by your system for system updates. The file is basically the roadmap for your system to know where it may download programs for installation or upgrade.Its just like Windows update You can remove duplicate entries in few easy steps with Y PPA Manager
Open y-ppa-manager form DashEnter You Admin Password Double Click On Advanced Scan & Remove Duplicate PPA's & Click Ok It will take some time ( 1 or 2 Mints ) To Scan & Remove Duplicate PPA's |
|||||||||
|
|
The partner repository is duplicated inside
/etc/apt/sources.list and /etc/apt/sources.list.d/precise-partner.list.Just remove those "precise-partner" files as the partner repository is already present in sources.list.
|
|||||||||||||
|
|
Make a back up copy of your sources.list:
Now remove the original and update:
|
|||||||||||||||||||||
|
|
I had the same problem, open software sources. unchecked "Canonical Partners". The Conflict is between "Canonical Partners" and " Canonical partners Added by software Center"
|
|||
|
|
|
If you couldn't figure it out in your
source.list, then do this:
|
|||||||||||||
|
|
For Ubuntu 9.10 - 12.04
There is an app called Y-PPA-Manager which can do that and much more. You can install it like that from a Terminal:
After that, just start the application an go to the Advanced menu.Then select "Scan and remove duplicate PPAs" and hit OK. |
|||||
|
|
I googled for such a tool, but I didn't find any..
So, I ended up coding one myself with
PHP.Sorry for the dirty unorganized source code.. chkdup - Screenshot:AuthorMubarak Alrashidi (DeaDSouL)Requirements:
Installation:
Uninstall:
How to use it:Just open the terminal and typesudo chkdup.FAQs:What does the install.sh do ?
LicenseGNU General Public LicenseAnd goodluck |
|||||||||
|
|
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. |
|||
|
|
10.10 and EarlierApplications > Ubuntu Software Center > Edit > Software Sources > Other Software**OR System > Administration > Synaptic Packet Manager > Settings > Repositories** Select and Remove duplicate entries. |
||||
|
|
|
Did you check
ls /etc/apt/sources.list.d/? Maybe you have some "extra" repositories in there? |
||||
|
|
|
Install ubuntu-tweak and remove the duplicate entries from there,it will be easy
for you..
|
|||||
|
|
I try to complete the possibilities offered from other users using terminal, since that's what you asked, mainly:
login if you're using a text based install or Press alt+f2 and digit gnome-terminal if you're using GUI once there digit sudo nano /etc/apt/sources.list (To understand better: in the folder /etc you can find (nearly) all configuration files of your computer and in the apt folder you find the souces.list file that contains all the repositories that apt-get uses to update or install and upgrade software) edit visually the file removing or commenting with # the duplicated rows. Press control + x to exit and choose y to save the file n to quit without saving. Done that check your work with an update: sudo apt-get update Have fun! |
|||||
|
|
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:
Then go to the Update Manager and install the updates. |
|||||
|
|
Just sudo gedit sources.list of the file where the Duplicate is and remove the line or put the # before the line!
|
||||
|
|
|
Use the Ubuntu Sources List Generator.
|
||||
|
|
|
Well, I solved the Duplicate Entry problem myself by renaming
/etc/apt/sources.d (as root) to something else and running sudo apt-get update to re-establish the directory and it's contents. |
|||
|
|
|
In /etc/apt/sources.list you must comment (#) duplicate repository and save changes.
After that repeat
apt-get update. |
||||
|
|
|
Went through
/etc/apt/sources.list manually sudo nano /etc/apt/sources.list and removed the duplicates. After apt-get update, the problem was solved. |
||||
|
|
|
No, there isn't a single command line to find and delete duplicated entries in the
/etc/apt/sources.list file.This is because the suggested command lines, which merely duplicate the function of the much simpler built-in uniq command, will only work on a SORTED file and will only remove ADJACENT lines.
Furthermore, those commands will only remove lines consisting of an identical string of characters.Duplicate entries reported by apt-get update will consist of duplicate function entries, such as a repository being included in both its i386 and amd64 variants. The easy and effective way to remove these is to note which repositories are reported as duplicates by apt-get update and remove them via the Software Center. Open it and choose Edit -> Software Sources -> Other Software tab. Simply look for the duplicate entries and uncheck them. (This is also an opportunity to remove any source-code repositories if you're not compiling the packages).However, it should be noted that apt-get update doesn't only find duplicate entries via sources.list, but includes repository files located in /var/lib/apt/lists/. Deleting duplicate entries from there will only temporarily remove the apt-get update error messages if Ubuntu thinks it needs them, as the files will be automatically re-installed. The fact that apt-get update will report some repositories as duplicates, and then suggest that that you run apt-get update itself to repair them, is a clue that you really don't need to worry about that error message. |
||||
|
|
* Line breaks inserted for readability. |
|||||||||||||
|
|
Execute the following to remove the duplicates
|
|||||
|
|
In the case of
W: Duplicate sources.list entry http://dl.google.com/linux/chrome/deb/ stable/main amd64 Packages (/var/lib/apt/lists/dl.google.com_linux_chrome_deb_dists_stable_main_binary-amd64_Packages)Open: sources.list.drm google.listso only google-chrome.list remains |
|||
|
|
protected by Community♦ Jan 7 '14 at 12:19
Thank you for your interest in this question. Because it has attracted low-quality answers, posting an answer now requires 10 reputation on this site.Would you like to answer one of these unanswered questions instead?
Not the answer you're looking for? Browse other questions tagged apt configuration software-sources or ask your own question.
|
asked
|
3 years ago
|
|
viewed
|
174814 times
|
|
active
|
Hot Network Questions
-
How did "run over him" evolve to "run him over" over the last 50 years?
-
What's the most likely "post democracy" form of political government?
-
Thank thou or Thank thee
-
What policy arguments do people make in favor of legalizing marijuana?
-
An identity for the factorial function
-
Which part of aircraft is contributing the most weight of airplane?
-
Why testing is not a stand alone activity
-
Ceiling Fan Junction Box Converter/Bracket 1/2 inch width difference
-
What to do about a student whom I suspect of having plagiarized but who claims not to have?
-
How to jokingly express "if you pay me, I'll say it" attitude?
-
Different airlines, same destination, leave about the same time... why?
-
Fractional Keys in Associations
-
What was Hilbert's view of Goedel's Incompleteness Theorems?
-
Which CA issued certificate for https://www.google.com
-
Should I encourage foreign students to adopt local handwriting customs?
-
N numbers closest to zero staying balanced
-
Difference between '{}' and {} in find command?
-
Are Legendary monsters in the Monster Manual ever able to be defeated?
-
Triangulating 3D Text
-
Did the people of Minas Tirith know that Isildur had a living heir?
-
Is this the correct way to use RAII for a map of references?
-
How does one politely stop other people from using one's mouse?
-
Rewriting summation formula
-
How can a slowed light ray bend?