apt-get update error: GPG error:The following signatures were invalid: NODATA 1 NODATA 2

Asked by tangyong

jzhome1@jzhome:~$ sudo grep -R proxy /etc/apt/*
jzhome1@jzhome:~$ grep proxy /etc/environment
jzhome1@jzhome:~$ echo $http_proxy

jzhome1@jzhome:~$ echo $ftp_proxy

jzhome1@jzhome:~$ grep proxy /etc/bash.bashrc
jzhome1@jzhome:~$ cat /etc/apt/apt.conf
cat: /etc/apt/apt.conf: No such file or directory
jzhome1@jzhome:~$ sudo fuser -vvv /var/lib/dpkg/lock
jzhome1@jzhome:~$ cat /etc/lsb-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=12.04
DISTRIB_CODENAME=precise
DISTRIB_DESCRIPTION="Ubuntu 12.04.2 LTS"
jzhome1@jzhome:~$ uname -a
Linux jzhome 3.5.0-27-generic #46~precise1-Ubuntu SMP Tue Mar 26 19:33:21 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
jzhome1@jzhome:~$ sudo rm /var/lib/apt/lists/lock
[sudo] password for jzhome1:
jzhome1@jzhome:~$ sudo rm /var/lib/dpkg/lock
jzhome1@jzhome:~$ sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
jzhome1@jzhome:~$ sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
jzhome1@jzhome:~$ sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
jzhome1@jzhome:~$ sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
jzhome1@jzhome:~$ sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
jzhome1@jzhome:~$ sudo rm -rf /var/lib/dpkg/updates/*
jzhome1@jzhome:~$ sudo rm -rf /var/lib/apt/lists
jzhome1@jzhome:~$ sudo rm /var/cache/apt/*.bin
rm: cannot remove `/var/cache/apt/*.bin': No such file or directory
jzhome1@jzhome:~$ sudo mkdir /var/lib/apt/lists
jzhome1@jzhome:~$ sudo mkdir /var/lib/apt/lists/partial
jzhome1@jzhome:~$ LANG=C;sudo apt-get clean
jzhome1@jzhome:~$ LANG=C;sudo apt-get autoclean
Reading package lists... Done
Building dependency tree
Reading state information... Done
jzhome1@jzhome:~$ LANG=C;sudo apt-get --purge autoremove
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
jzhome1@jzhome:~$ LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000
Get:1 http://cn.archive.ubuntu.com precise Release.gpg [8299 B]
Get:2 http://cn.archive.ubuntu.com precise-updates Release.gpg [8299 B]
Get:3 http://cn.archive.ubuntu.com precise-backports Release.gpg [8299 B]
Get:4 http://cn.archive.ubuntu.com precise Release [8299 B]
Get:5 http://cn.archive.ubuntu.com precise-updates Release [8299 B]
Ign http://cn.archive.ubuntu.com precise Release
E: GPG error: http://cn.archive.ubuntu.com precise Release: The following signatures were invalid: NODATA 1 NODATA 2
jzhome1@jzhome:~$ sudo dpkg --configure -a
jzhome1@jzhome:~$ sudo dpkg --clear-avail
jzhome1@jzhome:~$ LANG=C;sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
jzhome1@jzhome:~$ LANG=C;sudo apt-get --fix-missing install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
jzhome1@jzhome:~$ LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade
Get:1 http://cn.archive.ubuntu.com precise Release.gpg [8299 B]
Get:2 http://cn.archive.ubuntu.com precise-updates Release.gpg [8299 B]
Get:3 http://cn.archive.ubuntu.com precise-backports Release.gpg [8299 B]
Get:4 http://cn.archive.ubuntu.com precise Release [8299 B]
Get:5 http://cn.archive.ubuntu.com precise-updates Release [8299 B]
Ign http://cn.archive.ubuntu.com precise Release
E: GPG error: http://cn.archive.ubuntu.com precise Release: The following signatures were invalid: NODATA 1 NODATA 2
jzhome1@jzhome:~$ find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/sources.list

     1 #
     2
     3 # deb cdrom:[Ubuntu-Server 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130214)]/ dists/precise/main/binary-i386/
     4 # deb cdrom:[Ubuntu-Server 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130214)]/ dists/precise/restricted/binary-i386/
     5 # deb cdrom:[Ubuntu-Server 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130214)]/ precise main restricted
     6
     7 #deb cdrom:[Ubuntu-Server 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130214)]/ dists/precise/main/binary-i386/
     8 #deb cdrom:[Ubuntu-Server 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130214)]/ dists/precise/restricted/binary-i386/
     9 #deb cdrom:[Ubuntu-Server 12.04.2 LTS _Precise Pangolin_ - Release amd64 (20130214)]/ precise main restricted
    10
    11 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
    12 # newer versions of the distribution.
    13 deb http://cn.archive.ubuntu.com/ubuntu/ precise main restricted
    14 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise main restricted
    15
    16 ## Major bug fix updates produced after the final release of the
    17 ## distribution.
    18 deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted
    19 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates main restricted
    20
    21 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    22 ## team. Also, please note that software in universe WILL NOT receive any
    23 ## review or updates from the Ubuntu security team.
    24 deb http://cn.archive.ubuntu.com/ubuntu/ precise universe
    25 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise universe
    26 deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates universe
    27 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates universe
    28
    29 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    30 ## team, and may not be under a free licence. Please satisfy yourself as to
    31 ## your rights to use the software. Also, please note that software in
    32 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    33 ## security team.
    34 deb http://cn.archive.ubuntu.com/ubuntu/ precise multiverse
    35 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise multiverse
    36 deb http://cn.archive.ubuntu.com/ubuntu/ precise-updates multiverse
    37 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-updates multiverse
    38
    39 ## N.B. software from this repository may not have been tested as
    40 ## extensively as that contained in the main release, although it includes
    41 ## newer versions of some applications which may provide useful features.
    42 ## Also, please note that software in backports WILL NOT receive any review
    43 ## or updates from the Ubuntu security team.
    44 deb http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
    45 deb-src http://cn.archive.ubuntu.com/ubuntu/ precise-backports main restricted universe multiverse
    46
    47 deb http://security.ubuntu.com/ubuntu precise-security main restricted
    48 deb-src http://security.ubuntu.com/ubuntu precise-security main restricted
    49 deb http://security.ubuntu.com/ubuntu precise-security universe
    50 deb-src http://security.ubuntu.com/ubuntu precise-security universe
    51 deb http://security.ubuntu.com/ubuntu precise-security multiverse
    52 deb-src http://security.ubuntu.com/ubuntu precise-security multiverse
    53
    54 ## Uncomment the following two lines to add software from Canonical's
    55 ## 'partner' repository.
    56 ## This software is not part of Ubuntu, but is offered by Canonical and the
    57 ## respective vendors as a service to Ubuntu users.
    58 # deb http://archive.canonical.com/ubuntu precise partner
    59 # deb-src http://archive.canonical.com/ubuntu precise partner
    60
    61 ## Uncomment the following two lines to add software from Ubuntu's
    62 ## 'extras' repository.
    63 ## This software is not part of Ubuntu, but is offered by third-party
    64 ## developers who want to ship their latest software.
    65 # deb http://extras.ubuntu.com/ubuntu precise main
    66 # deb-src http://extras.ubuntu.com/ubuntu precise main
jzhome1@jzhome:~$ ping cn.archive.ubuntu.com
PING mirrors.sohu.com (221.236.12.140) 56(84) bytes of data.
64 bytes from 221.236.12.140: icmp_req=1 ttl=58 time=1.97 ms
64 bytes from 221.236.12.140: icmp_req=2 ttl=58 time=1.99 ms
64 bytes from 221.236.12.140: icmp_req=3 ttl=58 time=1.63 ms
^C
--- mirrors.sohu.com ping statistics ---
3 packets transmitted, 3 received, 0% packet loss, time 2003ms
rtt min/avg/max/mdev = 1.631/1.866/1.994/0.170 ms
jzhome1@jzhome:~$

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
tangyong
Solved:
Last query:
Last reply:
Revision history for this message
actionparsnip (andrew-woodhead666) said :
#1

Try using software centre and switch to the main server, rather than the CN server.

Revision history for this message
tangyong (tangyong3691) said :
#2

It is resolved by set http proxy, So it is connecting internet limits, but What is final truth?
below is command with http proxy:
sudo apt-get -o Acquire::http::proxy="http://proxy_ip:proxy_port/" update