[SOLVED] apt-get update gpg error 'NODATA'

Asked by Sisu Star

Hello,

A couple of days ago, I went through updating a server. The server is mainly used as a Samba fileserver with OpenVPN access. Also Apache2, PHP and MySQL is installed, but mostly used for small tests.

At first, sudo apt update && sudo apt dist-upgrade ran successfully
I had at one time installed Owncloud (to test), but I haven't had the time to do anything about it, so I tried to uninstall it by running 'sudo apt remove owncloud'
The package could not be found

So, I ran "aptitude", found the package there, and removed it from there. Everything seemed to go as it should.

After this, I wanted to double check that everything was up to date, so I ran "sudo apt update" again. This time I got errors for all repositories, complaining about (e.g.)
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)

I have gone through all forum discussion I can find, but nothing makes a difference.
To keep this message a bit shorter, this has been discussed at: https://askubuntu.com/questions/973936/apt-get-update-gpg-error

At the moment, I have ran all command in step 7 on the page: https://help.ubuntu.com/community/PackageManagerTroubleshootingProcedure

Here is the a copy of the terminal output (just a bit stylized):

ubuntu-support-status

Support status summary of '[server]':

You have 759 packages (100.0%) that can not/no longer be downloaded
You have 0 packages (0.0%) that are unsupported

Run with --show-unsupported, --show-supported or --show-all to see more details

---------------------------------------
cat /etc/dpkg/dpkg.cfg.d/multiarch

cat: /etc/dpkg/dpkg.cfg.d/multiarch: No such file or directory

---------------------------------------
dpkg --print-foreign-architectures

i386

---------------------------------------
sudo grep -R roxy /etc/apt/*
[no feedback]

---------------------------------------
grep roxy /etc/environment
[no feedback]

---------------------------------------
echo $http_proxy

[empty feedback]

---------------------------------------
echo $ftp_proxy

[empty feedback]

---------------------------------------
grep roxy /etc/bash.bashrc
[no feedback]

---------------------------------------
cat /etc/apt/apt.conf

cat: /etc/apt/apt.conf: No such file or directory

---------------------------------------
sudo fuser -vvv /var/lib/dpkg/lock
[no feedback]

---------------------------------------
sudo fuser -vvv /var/cache/apt/archives/lock
[no feedback]

---------------------------------------
cat /etc/lsb-release

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.3 LTS"

---------------------------------------
uname -a

Linux [servername] 4.4.0-98-generic #121-Ubuntu SMP Tue Oct 10 14:24:03 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

---------------------------------------
sudo rm /var/lib/apt/lists/lock
[no feedback]

---------------------------------------
sudo rm /var/cache/apt/archives/lock
[no feedback]

---------------------------------------
sudo rm /var/lib/dpkg/lock
[no feedback]

---------------------------------------
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
[no feedback]

---------------------------------------
sudo mv /var/lib/dpkg/status /var/lib/dpkg/status-bad
[no feedback]

---------------------------------------
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status || sudo cp /var/backups/apt.extended_states.0 /var/lib/dpkg/status
[no feedback]

---------------------------------------
sudo mv /var/lib/dpkg/available /var/lib/dpkg/available-bad
[no feedback]

---------------------------------------
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available

cp: cannot stat '/var/lib/dpkg/available-old': No such file or directory

---------------------------------------
sudo rm -rf /var/lib/dpkg/updates/*
[no feedback]

---------------------------------------
sudo rm -rf /var/lib/apt/lists
[no feedback]

---------------------------------------
sudo rm /var/cache/apt/*.bin
[no feedback]

---------------------------------------
sudo mkdir /var/lib/apt/lists
[no feedback]

---------------------------------------
sudo mkdir /var/lib/apt/lists/partial
[no feedback]

---------------------------------------
LANG=C;sudo apt-get clean
[no feedback]

---------------------------------------
LANG=C;sudo apt-get autoclean

Reading package lists... Done
Building dependency tree
Reading state information... Done

---------------------------------------
sudo dpkg --configure -a
[no feedback]

---------------------------------------
sudo dpkg --clear-avail
[no feedback]

---------------------------------------
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.

---------------------------------------
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.

---------------------------------------
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.

---------------------------------------
LANG=C;sudo apt-get --fix-missing update -o APT::Cache-Limit=100000000

Get:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://fi.archive.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Err:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease Splitting up /var/lib/apt/lists/partial/fi.archive.ubuntu.com_ubuntu_dists_xenial_InRelease into data and signature failed
  Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Err:2 http://fi.archive.ubuntu.com/ubuntu xenial-security InRelease/lib/apt/lists/partial/fi.archive.ubuntu.com_ubuntu_dists_xenial-security_InRelease into data and signature failed
  Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Get:3 http://fi.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Err:3 http://fi.archive.ubuntu.com/ubuntu xenial-updates InReleasel/fi.archive.ubuntu.com_ubuntu_dists_xenial-updates_InRelease into data and signature failed
  Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Reading package lists... Done
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial-security InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial-updates InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)

---------------------------------------
LANG=C;sudo apt-get update -o APT::Cache-Limit=100000000 && sudo apt-get dist-upgrade

Get:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease [247 kB]
Get:2 http://fi.archive.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Err:1 http://fi.archive.ubuntu.com/ubuntu xenial InRelease Splitting up /var/lib/apt/lists/partial/fi.archive.ubuntu.com_ubuntu_dists_xenial_InRelease into data and signature failed
  Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Err:2 http://fi.archive.ubuntu.com/ubuntu xenial-security InRelease/lib/apt/lists/partial/fi.archive.ubuntu.com_ubuntu_dists_xenial-security_InRelease into data and signature failed
  Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Get:3 http://fi.archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Err:3 http://fi.archive.ubuntu.com/ubuntu xenial-updates InReleasel/fi.archive.ubuntu.com_ubuntu_dists_xenial-updates_InRelease into data and signature failed
  Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Reading package lists... Done
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial-security InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
E: GPG error: http://fi.archive.ubuntu.com/ubuntu xenial-updates InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)

---------------------------------------
find /etc/apt -name '*.list' -exec bash -c 'echo -e "\n$1\n"; cat -n "$1"' _ '{}' \;

/etc/apt/baks/sources.list

     1 #
     2
     3 # deb cdrom:[Ubuntu-Server 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719)]/ xenial main restricted
     4
     5 # deb cdrom:[Ubuntu-Server 16.04.1 LTS _Xenial Xerus_ - Release amd64 (20160719)]/ xenial main restricted
     6
     7 # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
     8 # newer versions of the distribution.
     9 deb http://fi.archive.ubuntu.com/ubuntu/ xenial main restricted
    10 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial main restricted
    11
    12 ## Major bug fix updates produced after the final release of the
    13 ## distribution.
    14 deb http://fi.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
    15 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial-updates main restricted
    16
    17 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    18 ## team. Also, please note that software in universe WILL NOT receive any
    19 ## review or updates from the Ubuntu security team.
    20 deb http://fi.archive.ubuntu.com/ubuntu/ xenial universe
    21 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial universe
    22 deb http://fi.archive.ubuntu.com/ubuntu/ xenial-updates universe
    23 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial-updates universe
    24
    25 ## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
    26 ## team, and may not be under a free licence. Please satisfy yourself as to
    27 ## your rights to use the software. Also, please note that software in
    28 ## multiverse WILL NOT receive any review or updates from the Ubuntu
    29 ## security team.
    30 deb http://fi.archive.ubuntu.com/ubuntu/ xenial multiverse
    31 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial multiverse
    32 deb http://fi.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
    33 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial-updates multiverse
    34
    35 ## N.B. software from this repository may not have been tested as
    36 ## extensively as that contained in the main release, although it includes
    37 ## newer versions of some applications which may provide useful features.
    38 ## Also, please note that software in backports WILL NOT receive any review
    39 ## or updates from the Ubuntu security team.
    40 deb http://fi.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    41 # deb-src http://fi.archive.ubuntu.com/ubuntu/ xenial-backports main restricted universe multiverse
    42
    43 ## Uncomment the following two lines to add software from Canonical's
    44 ## 'partner' repository.
    45 ## This software is not part of Ubuntu, but is offered by Canonical and the
    46 ## respective vendors as a service to Ubuntu users.
    47 # deb http://archive.canonical.com/ubuntu xenial partner
    48 # deb-src http://archive.canonical.com/ubuntu xenial partner
    49
    50 deb http://security.ubuntu.com/ubuntu xenial-security main restricted
    51 # deb-src http://security.ubuntu.com/ubuntu xenial-security main restricted
    52 deb http://security.ubuntu.com/ubuntu xenial-security universe
    53 # deb-src http://security.ubuntu.com/ubuntu xenial-security universe
    54 deb http://security.ubuntu.com/ubuntu xenial-security multiverse
    55 deb [arch=i386,amd64,ppc64el] http://mirror.netinch.com/pub/mariadb/repo/10.1/ubuntu xenial main
    56 # deb-src [arch=i386,amd64,ppc64el] http://mirror.netinch.com/pub/mariadb/repo/10.1/ubuntu xenial main
    57 # deb-src http://security.ubuntu.com/ubuntu xenial-security multiverse
    58 # deb https://nightly.odoo.com/10.0/nightly/deb/ ./
    59 deb http://mirror.netinch.com/pub/mariadb/repo/10.1/ubuntu xenial xenial InRelease
    60 # deb-src http://mirror.netinch.com/pub/mariadb/repo/10.1/ubuntu xenial xenial InRelease
    61 # deb-src http://ppa.launchpad.net/ondrej/php/ubuntu xenial xenial InRelease
    62 deb http://fi.archive.ubuntu.com/ubuntu xenial xenial xenial-backports xenial-updates InRelease
    63 # deb-src http://fi.archive.ubuntu.com/ubuntu xenial xenial InRelease
    64 deb http://security.ubuntu.com/ubuntu xenial xenial-security InRelease
    65 # deb-src http://security.ubuntu.com/ubuntu xenial xenial-security InRelease
    66 # deb-src http://fi.archive.ubuntu.com/ubuntu xenial xenial-updates InRelease
    67 # deb-src http://fi.archive.ubuntu.com/ubuntu xenial xenial-backports InRelease

/etc/apt/sources.list

     1 #------------------------------------------------------------------------------#
     2 # OFFICIAL UBUNTU REPOS #
     3 #------------------------------------------------------------------------------#
     4
     5
     6 ###### Ubuntu Main Repos
     7 deb http://fi.archive.ubuntu.com/ubuntu/ xenial main universe
     8
     9 ###### Ubuntu Update Repos
    10 deb http://fi.archive.ubuntu.com/ubuntu/ xenial-security main universe
    11 deb http://fi.archive.ubuntu.com/ubuntu/ xenial-updates main universe

---------------------------------------
sudo dpkg --audit
[no feedback]

I would be totally fine by just "resetting" apt-get to "factory settings". If I find I need special repositories, I can always add them in the future.

This is not that time sensitive, as I just updated the server, but I do like to keep it up to date, as it's connected to the web.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu apt Edit question
Assignee:
No assignee Edit question
Solved by:
Sisu Star
Solved:
Last query:
Last reply:
Revision history for this message
Manfred Hampl (m-hampl) said :
#1

It seems that the downloaded files do not contain the expected contents (maybe caused by some kind of wrong proxy settings).

What output do you get for the command

curl http://fi.archive.ubuntu.com/ubuntu/dists/xenial/InRelease | head --bytes=1000

Revision history for this message
Sisu Star (sisu-star) said :
#2

Here's the output:

curl http://fi.archive.ubuntu.com/ubuntu/dists/xenial/InRelease | head --bytes=1000
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Origin: Ubuntu
Label: Ubuntu
Suite: xenial
Version: 16.04
Codename: xenial
Date: Thu, 21 Apr 2016 23:23:46 UTC
Architectures: amd64 arm64 armhf i386 powerpc ppc64el s390x
Components: main restricted universe multiverse
Description: Ubuntu Xenial 16.04
MD5Sum:
 f52f354808b6658dcd8fc47c813cb087 501150562 Contents-amd64
 605d6257d0144333d320d9aa750b19d2 32582143 Contents-arm64.gz
 2783bfb1e26cb9fc0d9eaa3dca02098f 486104077 Contents-ppc64el
 bc75f424a1e6c3496ed96a71dc4cfb2e 501547117 Contents-i386
 f1d149d66c4984f75e4b0be796fcbe0c 498301527 Contents-armhf
 ced58db7aedce8e1c887754fccccde03 33251183 Contents-amd64.gz
 94bd4f8f669940f5b506526411b70756 32617417 Contents-powerpc.gz
 618789ffe47696caac381d692136218f 32002941 Contents-s390x.gz
 517584acd853e0c0d2786e490f977e95 490880559 Contents-powerpc
 86dfa07e266881b9b51be43e517c7f8d 481073744 Contents-s390x
  5 241k 5 12739 0 0 103k 0 0:00:02 --:--:-- 0:00:02 103k
curl: (23) Failed writing body (2693 != 7240)

Revision history for this message
Manfred Hampl (m-hampl) said :
#3

This does look like the first lines of expected output.
To check the end, what do you get for

curl http://fi.archive.ubuntu.com/ubuntu/dists/xenial/InRelease | tail --bytes=1000

Eventually you could try switching from the Finnish country repository server to another one to check whether that makes a difference.

Revision history for this message
Sisu Star (sisu-star) said :
#4

I already tried to use Sweden as the repository server, but with the same result. Also (even though I was 99% sure) tested for ISP proxies, but no proxies were in place. And to clarify, wget, ping, Samba and OpenVPN function normally.

Here's the output for the second command:

curl http://fi.archive.ubuntu.com/ubuntu/dists/xenial/InRelease | tail --bytes=1000
  % Total % Received % Xferd Average Speed Time Time Time Current
                                 Dload Upload Total Spent Left Speed
100 241k 100 241k 0 0 296k 0 --:--:-- --:--:-- --:--:-- 296k
e 7727612 universe/source/Sources.xz
Acquire-By-Hash: yes
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iEYEAREKAAYFAlcZYVUACgkQQJdur0N9BbW9ewCfdMD63UFAr0wTIjaOnnQjI5oH
/wIAnRYjUbR6/i6e6FPClWwNbI6uE15eiQIcBAEBCgAGBQJXGWFVAAoJEDtP5qzA
sh8y3YwP/02/wiF9Q9UCkxJnP6Kr5osPaV9JkGV/bpLELGh6bHyJEnLPO+xfXBoD
glXopP8YiSXhV26Xa2wWLKICKL476uHPOtLz4wn7bdGnUHkizPHfyxQZH58+QTn+
Sy1PdtIPOSNbiU8dz7Q/hfjF5x7JBNC77D4b474hYdb8HZUn1dfTDPgDVW2k4nkU
2w9ysGN8yfWMyG20L6emW4a1KRmyEHpynTMWGYKKzH58WEJKDGrRqbhlwxsjXW9K
F/jkvQPSO7Rg3UB7gLBYKyVuNsCdVh4+Mn6jGf8wv6msJD6Dz1PrudKVBKkO181d
MdO18GfBHhDiMaoIWzMD+XI/+JGV4TALy6zhVz9btH28u2aIgQ7j/K+shR8gk5yQ
pWbSF6GUEHQN44VhdNnA9NdWl9GyFKGWONBfuNMMcU5/HHhO4ZGv9CgvaKrgBWC2
zck3R7SmeL9R3quj4hGP15105uGKKHjX0ee6VP7l3ovRl/d/f5ls7kDa09XGrWFy
WTdU2gw8eutTWlfPPM6+MIjF0o5EWy1Dv03CrE4oNF3GKZaK+WbptKjpMxyGSeNg
/K3TV11F3futZAoxpVbzAWS36BNxqqMotg3Cpegbxtn7s/SWWr0alzi2XqQfeLqC
mLWHaGaIqAmyLXb8m18O5To3Z4zIA6neALhEHs7cfy4f4yQpnbkL
=LkQz
-----END PGP SIGNATURE-----

Revision history for this message
Manfred Hampl (m-hampl) said :
#5

The beginning and the end of the file look fully correct. I have no explanation for this problem.

The only hints that I can give is some more commands for verifying what there might be happening. e.g. running

sudo rm /var/lib/apt/lists/*arc*
sudo rm /var/lib/apt/lists/partial/*
ls -l /var/lib/apt/lists/
sudo ls -l /var/lib/apt/lists/partial
sudo apt-get update
ls -l /var/lib/apt/lists/
sudo ls -l /var/lib/apt/lists/partial
sudo apt-get update
ls -l /var/lib/apt/lists/
sudo ls -l /var/lib/apt/lists/partial
sudo apt-get update
ls -l /var/lib/apt/lists/
sudo ls -l /var/lib/apt/lists/partial

Revision history for this message
Sisu Star (sisu-star) said :
#6

Well, this is really humiliating, but I seem to have figured out the problem.

I have multiple partitions in place, and a cronjob running rsync daily (backups). One of the backup locations is on an external drive, encrypted by Luks.

Apparently I have forgotten to open the luks drive after a reboot. Therefore, when the rsync was processed (to /mnt/ehdd), the drive was not mounted there, so it dropped it on a smaller partition ( / ).

So, the "/" partition was 100 % in use, and I assume, that apt could not save a single bit to the drive, and that's where the problems begun.

Once emptied the directory /mnt/ehdd (in my case), and then mounted that directory to the correct drive/partition, I got the following error when running the "apt update" command:
The following signatures couldn't be verified because the public key is not available: NO_PUBKEY 40976EAF437D05B5 NO_PUBKEY 3B4FE6ACC0B21F32

So I ran the following commands:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 3B4FE6ACC0B21F32
sudo apt clean
sudo apt update
sudo apt upgrade

EVERYTHING WORKS AS EXPECTED!

I know this is something that I should have checked, but the error message was simply so cryptic, I just couldn't combine the error message with the underlying problem.
Suggestion: A more clear error message, complaining about no disk space available