4

Today, after I ran sudo apt-get update command I got a NO_PUBKEY error. I tried solutions from here, here and and here (create a file trick). None of them worked nonetheless, and I still get the following errors:

W: GPG error: http://archive.canonical.com precise Release: The following signatures were invalid: 630239CC130E1A7FD81A27B140976EAF437D05B5
W: The repository 'http://archive.canonical.com precise Release' is not signed.
N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use.
N: See apt-secure(8) manpage for repository creation and user configuration details.

So, in particular what I get when typing

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com --recv-keys 630239CC130E1A7FD81A27B140976EAF437D05B5

is

     Executing: /tmp/apt-key-gpghome.FQVhh2ndBW/gpg.1.sh --keyserver hkp://keyserver.ubuntu.com --recv-keys 630239CC130E1A7FD81A27B140976EAF437D05B5
gpg: key 40976EAF437D05B5: "Ubuntu Archive Automatic Signing Key <ftpmaster@ubuntu.com>" not changed
gpg: Total number processed: 1
gpg:              unchanged: 1

And if I put key information to the .txt file even though I get:

sudo apt-key add ~/Ubuntu.txt
OK

and

sudo gpg --export --armor 40976EAF437D05B5 | sudo apt-key add
OK

The error is still there. What is going on, can anybody please help me?

(As a sidenote, I also tried using launchpad-getkeys and y-ppa-manager but to no avail as well)

Kulfy
  • 17,696
Jules
  • 143

2 Answers2

9

There is a link in your software sources to an obsolete software source from Ubuntu 12.04 precise which is no longer supported. Deleting that line in /etc/apt/sources.list will fix the error in your question.

  1. Open sources.list for editing in nano text editor.

  2. Comment out the line in sources.list that says http://archive.canonical.com precise partner by preceding it with a # character.

  3. The instructions for using nano editor are always found at the bottom of every page. The only two nano keyboard shortcuts that you need to know are for WriteOut and Exit. Press the keyboard combination Ctrl+O and after that press Enter to save the file being edited. Press the keyboard combination Ctrl+X to exit nano.

  4. Update the list of available software to refresh it after the change that was made to sources.list.

    sudo apt update
    
karel
  • 114,770
0

You could try to backup your trusted.gpg and trusted.gpg~ files in /etc/apt/ to trusted.gpg.backup and trusted.gpg~.backup and run sudo apt get update again. Maybe you also need to run sudo apt-get clean and sudo apt-get autoclean to clean your apt folders, but I'm not sure. This once did the trick on my system. I would suggest a reboot after that.