2

I'm running Ubuntu 14.04 and havent run sudo apt-get update for many months.
When I try to update local /etc/apt/sources.list apt-get can connect to many repos no problem, but many (maybe 15% of total) return errors like this

W: Failed to fetch http://nz.archive.ubuntu.com/ubuntu/dists/trusty-backports/multiverse/binary-i386/Packages  403  Forbidden

W: Some index files failed to download. They have been ignored, or old ones used instead.

I'm wondering if the repo addresses or configurations have changed since my machine last made contact, and therefore I need to go through some process to completely flush and then re-establish the /etc/apt/sources.list? I'm thinking something like

sudo apt-cache clean

But I don't want to bork my system any more than it already is.
How can I resolve this 403 Forbidden error?

Current state of /etc/apt/sources.list

# deb cdrom:[Ubuntu 14.04 LTS _Trusty Tahr_ - Release amd64 (20140417)]/ trusty main restricted

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty main restricted
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty-updates main restricted
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty universe
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty universe
deb http://nz.archive.ubuntu.com/ubuntu/ trusty-updates universe
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu 
## team, and may not be under a free licence. Please satisfy yourself as to 
## your rights to use the software. Also, please note that software in 
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty multiverse
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty multiverse
deb http://nz.archive.ubuntu.com/ubuntu/ trusty-updates multiverse
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty-updates multiverse

## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://nz.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse
deb-src http://nz.archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu trusty-security main restricted
deb-src http://security.ubuntu.com/ubuntu trusty-security main restricted
deb http://security.ubuntu.com/ubuntu trusty-security universe
deb-src http://security.ubuntu.com/ubuntu trusty-security universe
deb http://security.ubuntu.com/ubuntu trusty-security multiverse
deb-src http://security.ubuntu.com/ubuntu trusty-security multiverse

## 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 trusty partner
# deb-src http://archive.canonical.com/ubuntu trusty partner

## This software is not part of Ubuntu, but is offered by third-party
## developers who want to ship their latest software.
deb http://extras.ubuntu.com/ubuntu trusty main
deb-src http://extras.ubuntu.com/ubuntu trusty main
  • Your /etc/apt/sources.list might be misconfigured..please edit your question and add the output of cat /etc/apt/sources.list .. – heemayl Sep 22 '15 at 23:57
  • Cross-posted on Ask Ubuntu: askubuntu.com/questions/677274/… – muru Sep 23 '15 at 0:12
  • @muru I thought the issues were separate enough to not be a cross post. I have removed other post, thanks – the_velour_fog Sep 23 '15 at 0:28
2

There seems to be a GPG key issue for the repository http://nz.archive.ubuntu.com:

W: GPG error: http://nz.archive.ubuntu.com trusty-backports Release: The following signatures were invalid: BADSIG 40976EAF437D05B5

To solve it you need to get the public key for the fingerprint 40976EAF437D05B5:

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 40976EAF437D05B5

Now sudo apt-get update should work as usual.

As an alternate solution you can use the main repository or a different mirror:

deb http://archive.ubuntu.com/ubuntu/ trusty-backports main restricted universe multiverse

EDIT:

As @muru pointed out there are some issues with the nz mirror so you should use a different repo as the solution.

  • thanks, credit to @muru who originally pointed me in the right direction, but you posted an answer that worked. I changed /etc/apt/sources.list to point to the mirror you suggested and it worked ! thanks :) – the_velour_fog Sep 23 '15 at 0:47
  • @user4668401 You can add the relevant public key too for teh nz repo, that would work too. – heemayl Sep 23 '15 at 0:48
  • sure, the reason I went with changing the repo is because I could use the same solution if I experienced the problem in the future. With the public key - if I had the problem in the future - I wouldnt know how to diagnose when the public key is an issue or also how to obtain the key - but I will research it when I get the time as it probably the better solution :) – the_velour_fog Sep 23 '15 at 0:53
  • @heemayl the mirror it seems to have some problems (sporadic missing folders in some locations), so changing it would have been the solution .. or waiting to see if it gets fixed. Probably in the middle of synchronising, I suppose. – muru Sep 23 '15 at 1:35
  • @muru edited..I am on my phone..feel free to edit/add anything.. – heemayl Sep 23 '15 at 1:40
0

I've just generated a new list from http://repogen.simplylinux.ch/#, attempting to include the same set of repos. You can generate it yourself and see that it's almost identical.

I tried my local ubuntu install with your sources.list and this one, and they both worked after apt-get clean and apt-update. Even the one where you got an error worked fine for me :

Get:79 http://nz.archive.ubuntu.com trusty-backports/multiverse i386 Packages [1552 B]   

There were a few without public keys, but no 403 errors. How many times have you tried it? were some of the repos offline for short time?

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.