1

I have a warning sign on the upper bar, a red triangle and an exclamation inside. I click this icon and I am informed that there are updates and the "Show updates" option is available. I click on "Show updates" and I am informed that the package information was last updated 78 days ago. I am prompted to click the check button for new updates. I click the check button and it says "updating cache" and after a moment a "Failed to download repository information" message appears.

This was the result of the execution of"sudo apt-get update | grep NO_PUBKEY:

W: Failed to fetch ppa.launchpad.net/openjdk/ppa/ubuntu/dists/oneiric/main/source/… 404 Not Found W: Failed to fetch ppa.launchpad.net/openjdk/ppa/ubuntu/dists/oneiric/main/… 404 Not Found E: Some index files failed to download. They have been ignored, or old ones used instead.

This situation has been happening often. What should I do?

Jorge Castro
  • 71,754

5 Answers5

1

You are trying to update OpenJDK from a PPA; that should not be needed anymore since now OpenJDK is in the main Ubuntu repositories. The maintainers of that PPA have therefore decided not to provide OpenJDK for Oneiric, that's why you are getting an error when trying to update the package lists.

To fix the error, open the editor of your choice. Super User permissions are needed though.

Open this file /etc/apt/sources.list

Find the lines (if any) that contain something similar to:

deb http://ppa.launchpad.net/openjdk oneiric main

deb-src http://ppa.launchpad.net/openjdk oneiric main

and remove them entirely.

After this is done Save the file and run the following command:

sudo apt-get update

This should fix your problem.

  • Thanks, Scott. But in the file you mention, there are only rows that begin by "deb http://us.archive... and "deb-src http://us.archive ... or deb http://extras ... No row has the word "ppa". – Francisco Tavares Feb 17 '12 at 12:15
  • do any of those rows contain the word OpenJDK? If they do then delete those rows and then rerun sudo apt-get update – Scott Stookey Feb 17 '12 at 16:20
0

Ctrl+Alt+t open a terminal and run the code here:

sudo apt-get update && sudo apt-get upgrade

If the above fails to update then:

sudo apt-get clean
sudo apt-get autoremove
sudo apt-get update && sudo apt-get upgrade

Please post back any errors if any.

Ringtail
  • 16,127
0

Sounds like you may have some repositories that have no public keys, which are causing the download of certain packages to be aborted.

Run the following command from a terminal. Take note of the alpha-numeric keys returned on the screen:

sudo apt-get update | grep NO_PUBKEY

If there is a value returned run this command replacing the area in quotations with the value returned but without quotes. Do this for each key:

sudo apt-key adv --recv-key --keyserver keyserver.ubuntu.com "INPUTKEY HERE"

After this is done run update:

sudo apt-get update
Alexandre
  • 1,948
  • OP did'nt mention any E or W errors – Ringtail Feb 16 '12 at 03:19
  • W: Failed to fetch http://ppa.launchpad.net/openjdk/ppa/ubuntu/dists/oneiric/main/source/Sources 404 Not Found

    W: Failed to fetch http://ppa.launchpad.net/openjdk/ppa/ubuntu/dists/oneiric/main/binary-i386/Packages 404 Not Found

    E: Some index files failed to download. They have been ignored, or old ones used instead. (This was the result of the execution of"sudo apt-get update | grep NO_PUBKEY"

    – Francisco Tavares Feb 16 '12 at 22:46
  • deb http://mirrors.nfsi.pt/ubuntu/ oneiric-updates main restricted deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-updates main restricdeb cdrom:[Ubuntu 11.10 Oneiric Ocelot - Release i386 (20111012)]/ oneiric main restricted

    deb http://mirrors.nfsi.pt/ubuntu/ oneiric main restricted deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric main restricted

    – Francisco Tavares Feb 22 '12 at 11:51
  • deb http://mirrors.nfsi.pt/ubuntu/ oneiric universe deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric universe deb http://mirrors.nfsi.pt/ubuntu/ oneiric-updates universe deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-updates universe

    deb http://mirrors.nfsi.pt/ubuntu/ oneiric multiverse deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric multiverse deb http://mirrors.nfsi.pt/ubuntu/ oneiric-updates multiverse deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-updates multiverse

    – Francisco Tavares Feb 22 '12 at 11:52
  • deb http://mirrors.nfsi.pt/ubuntu/ oneiric-backports main restricted universe multiverse deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-backports main restricted universe multiverse

    deb http://mirrors.nfsi.pt/ubuntu/ oneiric-security main restricted deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-security main restricted deb http://mirrors.nfsi.pt/ubuntu/ oneiric-security universe deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-security universe deb http://mirrors.nfsi.pt/ubuntu/ oneiric-security multiverse deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-security multiverse

    – Francisco Tavares Feb 22 '12 at 11:54
  • deb http://extras.ubuntu.com/ubuntu oneiric main deb-src http://extras.ubuntu.com/ubuntu oneiric main deb http://mirrors.nfsi.pt/ubuntu/ oneiric-proposed restricted main multiverse universe – Francisco Tavares Feb 22 '12 at 11:54
  • BlueXrider,This is my sources.list. Is there anything wrong in it? – Francisco Tavares Feb 22 '12 at 11:55
0

The sources for those PPA's does not exist. Oneiric is not listed.

You need to remove those lines from the software sources.list

First thing is to back up your sources.list

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

Now edit the file. Look for the offending line, it would look like this example:

deb http://ppa.launchpad.net/openjdk/ppa/ubuntu natty main

deb-src http://ppa.launchpad.net/openjdk/ppa/ubuntu natty main

To edit use the following:

gksudo gedit /etc/apt/sources.list

You want to comment out the lines using the "#" and make it look like this:

#deb http://ppa.launchpad.net/openjdk/ppa/ubuntu natty main

#deb-src http://ppa.launchpad.net/openjdk/ppa/ubuntu natty main

Save the file. Then run this code:

sudo apt-get update && sudo apt-get upgrade

you should be good-to-go now

Ringtail
  • 16,127
  • Thanks, BlueXrider. As I said before, there are no lines beginning by "#deb http://ppa.launchpad.net/openjdk/ppa/ubuntu natty main or #deb-src http://ppa.launchpad.net/openjdk/ppa/ubuntu natty main. Nor lines ending by natty main but oneiric – Francisco Tavares Feb 17 '12 at 12:23
  • But now I think I understand the reason because this happen. There is a lack of synchronisation between the version of the ubuntu installed and the updates that are downloaded. I reinstalled ubuntu from scratch and the updates that come are to the version of ubuntu previously installed. I reinstalled ubuntu another time giving another name to the computer but it didn't work again. I don't how the target of the updates is searched (name of the computer and IP?) but I think there must be any type of synchronization. – Francisco Tavares Feb 17 '12 at 12:39
  • I gave you AN EXAMPLE. As to how and what to look for WHILE EDITING. It was not meant to TO USE LITERALLY. As I stated before the PPA that you are trying to use DOES NOT EXIST. Therefore is needs to be removed from the sources.list – Ringtail Feb 17 '12 at 18:02
  • deb http://mirrors.nfsi.pt/ubuntu/ oneiric-updates main restricted deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric-updates main restricdeb cdrom:[Ubuntu 11.10 Oneiric Ocelot - Release i386 (20111012)]/ oneiric main restricted

    deb http://mirrors.nfsi.pt/ubuntu/ oneiric main restricted deb-src http://mirrors.nfsi.pt/ubuntu/ oneiric main restricted

    – Francisco Tavares Feb 22 '12 at 11:52
0

I had this same problem, I back tracked what I was doing because it was working correctly until I did an edit to /etc/network/interface from dhcp to static, I changed it back to dhcp and all repos started working again.