Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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?

share|improve this question
add comment

5 Answers 5

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.

share|improve this answer
    
Thanks, Scott. But in the file you mention, there are only rows that begin by "deb us.archive... and "deb-src us.archive ... or deb 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
add comment

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.

share|improve this answer
    
Thanks Rick. My answer is the same for Alexandre and Scott. –  Francisco Tavares Feb 16 '12 at 23:26
add comment

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
share|improve this answer
    
OP did'nt mention any E or W errors –  Ringtail Feb 16 '12 at 3:19
    
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 was the result of the execution of"sudo apt-get update | grep NO_PUBKEY" –  Francisco Tavares Feb 16 '12 at 22:46
    
deb mirrors.nfsi.pt/ubuntu oneiric-updates main restricted deb-src mirrors.nfsi.pt/ubuntu oneiric-updates main restricdeb cdrom:[Ubuntu 11.10 Oneiric Ocelot - Release i386 (20111012)]/ oneiric main restricted deb mirrors.nfsi.pt/ubuntu oneiric main restricted deb-src mirrors.nfsi.pt/ubuntu oneiric main restricted –  Francisco Tavares Feb 22 '12 at 11:51
    
deb mirrors.nfsi.pt/ubuntu oneiric universe deb-src mirrors.nfsi.pt/ubuntu oneiric universe deb mirrors.nfsi.pt/ubuntu oneiric-updates universe deb-src mirrors.nfsi.pt/ubuntu oneiric-updates universe deb mirrors.nfsi.pt/ubuntu oneiric multiverse deb-src mirrors.nfsi.pt/ubuntu oneiric multiverse deb mirrors.nfsi.pt/ubuntu oneiric-updates multiverse deb-src mirrors.nfsi.pt/ubuntu oneiric-updates multiverse –  Francisco Tavares Feb 22 '12 at 11:52
    
deb mirrors.nfsi.pt/ubuntu oneiric-backports main restricted universe multiverse deb-src mirrors.nfsi.pt/ubuntu oneiric-backports main restricted universe multiverse deb mirrors.nfsi.pt/ubuntu oneiric-security main restricted deb-src mirrors.nfsi.pt/ubuntu oneiric-security main restricted deb mirrors.nfsi.pt/ubuntu oneiric-security universe deb-src mirrors.nfsi.pt/ubuntu oneiric-security universe deb mirrors.nfsi.pt/ubuntu oneiric-security multiverse deb-src mirrors.nfsi.pt/ubuntu oneiric-security multiverse –  Francisco Tavares Feb 22 '12 at 11:54
show 2 more comments

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

share|improve this answer
    
Thanks, BlueXrider. As I said before, there are no lines beginning by "#deb ppa.launchpad.net/openjdk/ppa/ubuntu natty main or #deb-src 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 mirrors.nfsi.pt/ubuntu oneiric-updates main restricted deb-src mirrors.nfsi.pt/ubuntu oneiric-updates main restricdeb cdrom:[Ubuntu 11.10 Oneiric Ocelot - Release i386 (20111012)]/ oneiric main restricted deb mirrors.nfsi.pt/ubuntu oneiric main restricted deb-src mirrors.nfsi.pt/ubuntu oneiric main restricted –  Francisco Tavares Feb 22 '12 at 11:52
add comment

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.

share|improve this answer
add comment

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.