57

The error I am having when trying to update my package list.

W: GPG error: http://download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333

W: Failed to fetch http://ppa.launchpad.net/samrog131/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages  404  Not Found

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

I don't get the answers above, my system clock was fine. The following worked for me:

sudo apt-key list | grep "expired: "
sudo apt-key adv --keyserver keys.gnupg.net --recv-keys [KEY]

The key being the the part behind the slash: 0000X/<this part is the key>

Or use this one liner:

sudo apt-key list  | grep "expired: " | sed -ne 's|pub .*/\([^ ]*\) .*|\1|gp' | xargs -n1 sudo apt-key adv --keyserver keys.gnupg.net --recv-keys 
3
40

As simple as this should work:

sudo apt-key adv --refresh-keys

Why use sed and xargs if gpg can sort things for itself?

If getting an error about inaccessible key servers, try setting one directly:

sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com --refresh-keys
6
  • i got the following error:gpg: no keyserver known (use option --keyserver) gpg: keyserver refresh failed: bad URI Jul 23 '19 at 10:38
  • The only thing that worked for me Feb 28 '20 at 12:47
  • 9
    The original answer returned an error, this modified version of the command worked: sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --refresh-keys
    – Arman H
    Mar 23 '20 at 13:41
  • TSBTAA. This should be the accepted anwser.
    – silencej
    Apr 23 '20 at 5:31
  • 1
    RE Arman H's comment: Or using SSL sudo apt-key adv --keyserver hkps://keyserver.ubuntu.com:443 --refresh-keys Jan 11 at 9:18
17
GPG error: http://download.opensuse.org ./ Release: The following signatures were invalid: KEYEXPIRED 1436387333

This says that your GPG key for that repository has expired, which means one of two things, either your system has the wrong date or the key really expired. For the later, you need to contact the repository maintainer and import the new key (removing the old one, probably), once the repository updates their keys to sign the files.

You can safely ignore these messages if you aren't using packages of these repositories. The message can be removed if you remove the repository from your source.list file/directory.

3
  • 1
    ... suggest adding in confirming that the system clock is at least reasonably correct. If the system thinks its 2020, I bet that'd lead to key expired errors.
    – derobert
    Jul 21 '15 at 17:04
  • @derobert but we are in 2020!
    – Bersan
    Nov 2 '20 at 13:22
  • 1
    @Bersan and what a year it's been 🙄, but in a few more my comment will work again if there are errors for far-future keys too. 😁
    – derobert
    Nov 2 '20 at 13:35
15

That ppa has been removed and no longer exists. You must find a different source for the packages installed through the samrog131 ppa.

In the meantime, run the following commands to resolve the situation.

First, to delete the expired key:

sudo apt-key del 1436387333

Then, to delete the ppa:

sudo rm /etc/apt/sources.list.d/samrog131*
sudo apt-get clean
sudo apt-get update

If you need to add a key see here.

sudo apt-get upgrade

You may want to run:

sudo apt-get dist-upgrade

depending on your situation. If you are not sure, see here.

2
  • What's '1436387333' here? Aug 15 at 1:25
  • 1
    @LeninRajRajasekaran It is referenced on the first line of the code block in the question.
    – mchid
    Aug 15 at 21:49
2

None of these worked for me:

$ sudo apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 5072E1F5

or

$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys 5072E1F5

or

$ sudo apt-key adv --keyserver pgp.mit.edu --recv-keys A4A9406876FCBD3C456770C88C718D3B5072E1F5

The sources for those are: https://bugs.mysql.com/bug.php?id=85029 and https://bugs.mysql.com/bug.php?id=94378

I performed one suspect operation in desperation (saying 'y' instead of 'N' below) which I think wasn't required at all:

$ sudo apt-get install mysql-apt-config

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be upgraded:
  mysql-apt-config
1 upgraded, 0 newly installed, 0 to remove and 294 not upgraded.
Need to get 35.6 kB of archives.
After this operation, 0 B of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  mysql-apt-config
Install these packages without verification? [y/N] y
Get:1 http://repo.mysql.com/apt/ubuntu/ trusty/mysql-apt-config mysql-apt-config all 0.8.13-1 [35.6 kB]
Fetched 35.6 kB in 0s (229 kB/s)      
Preconfiguring packages ...
dpkg-deb: error: archive '/var/cache/apt/archives/mysql-apt-config_0.8.13-1_all.deb' has premature member 'control.tar.xz' before 'contro
l.tar.gz', giving up
dpkg: error processing archive /var/cache/apt/archives/mysql-apt-config_0.8.13-1_all.deb (--unpack):
 subprocess dpkg-deb --control returned error exit status 2
Errors were encountered while processing:
 /var/cache/apt/archives/mysql-apt-config_0.8.13-1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

And followed it with:

$ sudo apt-get update

which did not help.

I still got the same error.

Finally, the following worked:

$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 5072E1F5

I'm speculating (blindly) that maybe pgp.mit.edu has changed their structure or maybe "MySQL Release Engineering" (run apt-key list) has moved their keys to the ubuntu key server or some such thing (I have no idea of how keys are maintained).

This comment on the duplicate thread says the same thing.

Hope this saves someone some time and effort.

1
  • The last step worked for my ubuntu 14.04 LTS, where as all the other steps failed.
    – a4aravind
    Jul 27 '19 at 9:13
2

As displayed earlier First, to delete the expired key:

sudo apt-key del 1436387333

Then go to the site:

http://download.opensuse.org/repositories/home:/sarimkhan/xUbuntu_14.04/

and download "Release.key" Then import the key using the ubuntu14.04 software updater or synaptic package manager.

1

Setting the correct system time in the BIOS solved the issue for me.

1

A GUI oriented answer:

Navigate to /etc/apt/sources.list.d in your File Manager and double-click sources.list.

This should open the Software and Updates dialog. Click Other Software, find the offending PPA, click Remove. This stopped the error on my end.

2
  • 1
    Removing the PPA can be dangerous. It needs some checks before. If the PPA is removed, the applications installed from the PPA will not be updated anymore (no more security updates and no more bug fixes). Remove a PPA (or any repository) only if it is not used anymore. Mar 15 '20 at 18:05
  • In my specific case, it was an unneeded PPA I was looking for. Not to say it's always a valid idea, but it is an option (and this comment's mostly there so I could find it again later).
    – SteveHeist
    Mar 27 '20 at 5:43
0

This solution worked best for me.

wget -nv https://download.owncloud.org/download/repositories/stable/Ubuntu_16.04/Release.key -O Release.key

sudo apt-key add - < Release.key

Once these commands were run I was able to update and upgrade as expected.

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.