Announcement

Collapse
No announcement yet.

how to fix duplicate sources.list entries?

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    how to fix duplicate sources.list entries?

    When I do
    Code:
    sudo apt-get update
    my computer responds normally by giving me a list of what is being fetched. However, at the base I get this:
    Code:
    Reading package lists ... Done
    W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner amd64 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-amd64_Packages)
    W: Duplicate sources.list entry http://archive.canonical.com/ubuntu/ precise/partner i386 Packages (/var/lib/apt/lists/archive.canonical.com_ubuntu_dists_precise_partner_binary-i386_Packages)
    W: You may want to correct these problems by running «apt-get update».
    (Please note I translated to english 'by hand', I have a norwegian-speaking installation so some minor differences in text is possible.)

    I tried the suggested "run apt-get update" that is
    Code:
    sudo apt-get update
    again
    but it does not change anything

    I checked sources.list and can only find 2 lines of code with the word partner in it (there is a comment line too):
    Code:
    ## Uncomment the following two lines to add software from Canonical's
    ## 'partner' repository.
    ## This software is not part of Ubuntu, but is offered by Canonical and the
    ## respective vendors as a service to Ubuntu users.
    deb http://archive.canonical.com/ubuntu precise partner
    deb-src http://archive.canonical.com/ubuntu precise partner
    So I guess that either on my client side or on the ubuntu/cannonical server side one of the other entries resolves into the same as in this entry
    ALthough it appears non-fatal I hunt down all error messages from such important systems. Anybody know how I can fix this?
    Last edited by heinkel_111; May 23, 2012, 02:56 PM. Reason: fixing typo

    #2
    look for entries in /etc/apt/sources/list.d.
    There will be a file for each ppa or repo added, the info in these files are read as additions to the base sources.list. You can delete the offending file manually or from within Muon, Synaptic, etc. If you an to delete maually, each file has a name that makes it obvious what or where it is from, so it should be easy to find the right one, examining the contents of the text file will make sure you have the right one.

    Comment


      #3
      that did it

      Thanks for the advice, it led me right to what I needed to do. I am going to write a little detailed instruction here in case someone gets into the same problem in the future.

      In the terminal window I found the /etc/apt/sources.list.d
      Code:
      myuser@mymachine~$ cd /etc/apt/sources.list.d/
      This directory contains 2 files which both contain urls to the same repository, one that I already had in my sources.list (making it a triplicate, I guess).
      Code:
      myuser@mymachine/etc/apt/sources.list.d$ ls
      oneiric-partner.list  oneiric-partner.list.distUpgrade
      myuser@mymachine/etc/apt/sources.list.d$ more oneiric-partner.list
      # channel for the oneiric (11.10) partner channel
      # 
      #:description:This channel contains the partner software for oneiric
      deb http://archive.canonical.com/ubuntu precise partner
      myuser@mymachine/etc/apt/sources.list.d$ more oneiric-partner.list.distUpgrade
      # channel for the oneiric (11.10) partner channel
      # 
      #:description:This channel contains the partner software for oneiric
      deb http://archive.canonical.com/ubuntu oneiric partner
      To fix this, I could have deleted the files directly, but just in case they should be useful for something in the future I renamed them and moved them to a tmp (temporary...often "permanently temporary") directory instead, like this:
      Code:
      myuser@mymachine/etc/apt/sources.list.d$ sudo mv oneiric-partner.list oneiric-partner.list.takenaway
      [sudo] password for myuser: 
      myuser@mymachine/etc/apt/sources.list.d$ sudo mv oneiric-partner.list.distUpgrade oneiric-partner.list.distUpgrade.takenaway
      Then I created a tmp directory and moved the files out of reach
      Code:
      myuser@mymachine/etc/apt/sources.list.d$ sudo mkdir ../tmp_backup
      myuser@mymachine/etc/apt/sources.list.d$ sudo mv oneiric-partner.list.takenaway ../tmp_backup/.
      myuser@mymachine/etc/apt/sources.list.d$ sudo mv oneiric-partner.list.distUpgrade.takenaway ../tmp_backup/.
      To finish it all of, I retried the
      Code:
      sudo apt-get update
      which returned no error messages this time.

      Problem solved!

      Note: sudo is needed for tampering with all kinds of files in /etc/apt !

      Comment

      Working...
      X