lkubuntu

A listing of random software, tips, tweaks, hacks, and tutorials I made for Ubuntu

Easy way to remove 404 messages on apt-get update

If you have ever got 404 not found messages when running apt-get update, you know how annoying they are.

I had enough of them, so I decided to make a script to remove them. NOTE: Currently it can only remove 404 messages from PPAs. This will be fixed in a later release.

To install, open up a Terminal window, and type in it:

sudo apt-add-repository ppa:lkjoel/fix404
sudo apt-get update
sudo apt-get install fix404
sudo fix404

If you have any problems, feel free to comment below.

If this worked, please link to this post!

About these ads

19 responses to “Easy way to remove 404 messages on apt-get update

  1. Jeremy Bicha June 28, 2011 at 5:14 am

    I don’t think disabling the PPAs is the right answer. I see two ways of getting these 404’s.

    Either the user misentered the PPA address or the PPA isn’t available for the release series the user is using. I suspect that’s because the PPA maintainer hasn’t bother building packages for that release. In this case, using a different series usually works (maverick instead of natty for instance).

    The PPA issue is a problem because I believe a considerable number of users install the PPA but don’t understand why it doesn’t work right when upgrading. I suppose there should be an update-manager bug about this, or maybe Software Center could detect this also.

    • lkjoel June 28, 2011 at 3:04 pm

      Using a different series works? I’ll check that out, and if it works, I’ll update the script :-).

      EDIT: Not a good idea.

  2. Oli Warner June 28, 2011 at 8:52 am

    Why are 404 messages annoying? They tell you when something isn’t working properly… Which is a desirable behaviour, last time I checked.

    • lkjoel June 28, 2011 at 3:06 pm

      … Except when an application/howto wants to do something like this:

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

      Then some newbies wonder why it doesn’t work…

    • Scott Long June 28, 2011 at 3:21 pm

      Gotta go with you on this. To “fix” the 404 is not fixing the problem. Only the notification…fail! Like taking aspirin for a burn….

      • lkjoel June 28, 2011 at 3:43 pm

        I just have a question: If it doesn’t work, then why do you keep it?

      • Oli Warner June 28, 2011 at 3:45 pm

        Actually (and I don’t mean to take this too off-topic) taking an aspirin (or other mild antithrombotics) is actually beneficial for healing moderate to serious burns.

        http://www.medbc.com/annals/review/vol_12/num_2/text/vol12n2p99.htm

      • Oli Warner June 28, 2011 at 3:47 pm

        @lkjoel Most of the update 404s that I see are very temporary. It’s usually because the server is having a brain-fart or somebody accidentally moved something.

        I’ll admit there are occasions where repositories are closed down but an automated and instant removal of them is not the right solution. At the very least there should be a prompt.

      • lkjoel June 28, 2011 at 8:19 pm

        Thanks! I added a prompt.
        I actually only get 404 messages when it’s mistyped or there is no $(lsb_release -c -s) release for the package.

  3. Marius Gedminas June 28, 2011 at 2:24 pm

    What does this do? Remove the offending repositories from my sources?

    • MiJyn August 8, 2013 at 9:49 pm

      Yep (and it prompts you, of course).

  4. Pingback: Get Rid Of PPA “404 Not Found” Messages When Running “apt-get update”

  5. Andrew July 13, 2011 at 1:28 pm

    There is a bug in the script: the files should be changed in place or else the file permissions will change and will cause errors when running Update Manager.

    A temporary fix is:
    sudo chmod 644 /etc/apt/sources.list.d/*

    • lkjoel July 13, 2011 at 2:33 pm

      Thanks, I fixed it.

      • Andrew July 13, 2011 at 3:10 pm

        I don’t think that’s the best way to fix it… the script shouldn’t mess with the file permissions in the first place. A better fix would be to use “sed -i” and edit the .list file in place.

        Here’s a modified script with this change which works just fine for me: http://dl.dropbox.com/u/1113424/fix404

        And here’s what I’ve changed: http://dl.dropbox.com/u/1113424/fix404.patch

      • lkjoel July 13, 2011 at 6:57 pm

        Thanks! I applied your patch, and I updated it.

  6. Andrew July 13, 2011 at 8:39 pm

    Thanks!

  7. fix this! August 29, 2011 at 2:13 am

    Yea, this fubars any apt updating. Don’t release stuff until you are sure it is good!

  8. Victor Stadnichenko January 8, 2012 at 10:30 am

    fix404 does not work in my linux mint 12. And it’s unavailable in the channel.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 179 other followers

%d bloggers like this: