0

After running apt-get update, I get this message:

W: Duplicate sources.list entry http://ppa.launchpad.net/webupd8team/java/ubuntu/ trusty/main armhf Packages (/var/lib/apt/lists/ppa.launchpad.net_webupd8team_java_ubuntu_dists_trusty_main_binary-armhf_Packages)
W: You may want to run apt-get update to correct these problems

In my /etc/apt/ I see these files

apt.conf.d    preferences.d  sources.list.d  trusted.gpg~
listchanges.conf  sources.list   trusted.gpg     trusted.gpg.d

Inside sources.list.d I see this

raspi.list

Contents of sources.list

deb http://mirrordirector.raspbian.org/raspbian/ jessie main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspbian.org/raspbian/ jessie main contrib non-free rpi
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

If I run an update again, I get the exact same output at the end. How do I fix this and what does this mean?

2

The directory /etc/apt/ contains the configuration for the APT package system. In it there will be a source.list file containing the sources for the base system and a sub-directory called sources.list.d containing further files also listing sources. (These files are added when you, other packages or programs you install add new sources.) Note that the files ending in .list are the ones that are actually read; the files ending in .list.save are backup copies of old versions of those files.

You can search these files to find the two that have duplicate deb http://... lines:

$ sudo -s
$ cd /etc/apt/
$ grep -rl webupd8team/java/ubuntu/ .

It's likely that one of these will be the obvious file to remove, based either on their name or an examination of their contents. However, you should feel free to update your question with the names and contents of both if you're not sure.

As a side note, the file in /var/lib/apt/lists/ mentioned in the error message is where the downloaded listing of the packages available from that source is kept. All the files are human-readable so you should feel free to have a look inside them to see what's there and learn more about the system.

UPDATE: Now that you've posted the contents of your /etc/apt/sources.list file, it's clear that you have duplicated lines in it:

...
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main

I'm not sure how this would happen, aside from a bad manual edit, but remove the second pair of lines and the problem will go away.

  • I looked and did not see anything obvious to remove. I posted my findings in the question @Curt – Nick Solonko Apr 23 '17 at 13:41
  • Looking at your findings there is the obvious duplicated entry (or two). You've written, "If I run an update again, I get the exact same output at the end", which might imply you tried to remove it, and it got added back again. Or it might imply something else. Did you try removing the duplicate entries or not? – goldilocks Apr 23 '17 at 13:58
  • I've updated the answer to explain exactly what to remove. (It's lines from a file, rather than a whole file.) – Curt J. Sampson Apr 23 '17 at 15:21
0

I am still using raspbian wheezy on one of my soho-servers because I don't want to go through all the tweaking and reconfigure tasks, because it took many months to fine tune it for my needs.

As you already know wheezy is outdated so I can't update/upgrade it, for now, and to avoid errors when trying to install packages, I needed to fix the source list to point to a raspbian archive repository in the sources.list file.

Before I explain what I did, to answer this question, because I too got the same error when I tried the apt-get update, was the following:

cd /etc/apt/sources.list.d

You will see two files (usually): collabora.list and raspi.list

so you need to rename them to *.save (to avoid having to delete them), this will make the system ignore them.

sudo mv collabora.list collabora.list.save
sudo mv raspi.list raspi.list.save

That's it. Now back to explain my fix for the outdated wheezy repository:

  1. I first backup the /var/list/apt/lists by moving it to a lists.old

    sudo mv /var/list/apt/lists /var/list/apt/lists.old
    
  2. recreate the lists folder

    cd /var/list/apt
    sudo mkdir lists
    
  3. recreate the partial folder

    sudo mkdir -pv /var/lib/apt/lists/partial
    
  4. Now edit the sources.list

    sudo nano /etc/apt/sources.list
    

    first comment out the active lines putting a '#' at beginning of them

    and include the new archive source:

    deb http://archive.raspberrypi.org/debian wheezy main
    
  5. Now run a update

    sudo apt-get update
    

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.