Debian apt error: "The following signatures were invalid: NODATA 1 NODATA 2"

16,968

Solution 1

Just solved this myself; this question came up along with a lot of other unsolved or non-applicable-to-me questions/answers around the net. Thought I'd add my particular solution for future reference --

Check disk space

df -h

Keep an eye on your /tmp/ -- I had run out of disk space, resolved the low disk situation, then still had the NODATA signature error. Finding this page gave me the answer - when low on space Ubuntu converts your /tmp to a small ramdisk.

sudo umount -l /tmp

Solves this problem.

Solution 2

Try: sudo apt-get clean cd /var/lib/apt sudo mv lists lists.old sudo mkdir -p lists/partial sudo apt-get clean sudo apt-get update

As a last resort, try:

sudo fuser -vvv /var/lib/dpkg/lock
sudo rm /var/lib/apt/lists/lock
sudo cp -arf /var/lib/dpkg /var/lib/dpkg.backup
sudo cp /var/lib/dpkg/status-old /var/lib/dpkg/status
sudo cp /var/lib/dpkg/available-old /var/lib/dpkg/available
sudo rm -rf /var/lib/dpkg/updates/*
sudo rm -rf /var/lib/apt/lists
sudo rm /var/cache/apt/*.bin
sudo mkdir /var/lib/apt/lists
sudo mkdir /var/lib/apt/lists/partial
LANG=C;sudo apt-get clean
LANG=C;sudo apt-get autoclean
LANG=C;sudo apt-get --purge autoremove
LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824
sudo dpkg --clear-avail
sudo dpkg --configure -a
LANG=C;sudo apt-get -f install
LANG=C;sudo apt-get --fix-missing install
LANG=C;sudo apt-get update -o APT::Cache-Limit=25165824 && sudo apt-get dist-upgrade

Hope you solve this. P.S, that's why I don't have Debian (hehe jk)

Solution 3

I have done following steps and it works fine for me (basically removed the lists folder and recreated it by update command)

# cd /var/lib/apt
# mv lists  lists-backup
# apt-get clean all

Now recreate the folder using

# apt-get update

Reinstall all the pre-requisite packages

# apt-get -f install

Now you are all set for installing your required packages. Hope this helps.

PS: Please also make sure that if you are running inside a firewall then proxy environment variables are set ($http_proxy and https_proxy)

Share:
16,968
user986730
Author by

user986730

Updated on July 25, 2022

Comments

  • user986730
    user986730 over 1 year

    I'm having some trouble with apt/aptitude. Recently, out of nowhere, I realized I couldn't install anything and apt-get update would produce this result:

    $ sudo apt-get update
    Get:1 http://security.debian.org wheezy/updates Release.gpg [1,936 B]
    Get:2 http://ftp.debian.org wheezy Release.gpg [1,936 B]
    Get:3 http://ftp.debian.org wheezy-updates Release.gpg [1,936 B]
    Get:4 http://security.debian.org wheezy/updates Release [1,936 B]
    Ign http://security.debian.org wheezy/updates Release
    E: GPG error: http://security.debian.org wheezy/updates Release: The following signatures were invalid: NODATA 1 NODATA 2
    

    This part: Ign http://security.debian.org wheezy/updates Release seems worrisome to me, but I don't really know what it could affect.

    I know that this is not a problem with my system. I had an old Debian VM lying around and I tested with it as well, getting the same problem. I'm getting this problem at work, if that helps, so I'm not in full control of the network here and it might be something that they did with the network.

    I also tried different mirrors, achieving the same result.

    This is my sources.list:

    $ cat /etc/apt/sources.list
    deb http://ftp.debian.org/debian/ wheezy main
    deb-src http://ftp.debian.org/debian/ wheezy main
    deb http://security.debian.org/ wheezy/updates main
    deb-src http://security.debian.org/ wheezy/updates main
    deb http://ftp.debian.org/debian/ wheezy-updates main
    deb-src http://ftp.debian.org/debian/ wheezy-updates main
    

    Thank you in advance.

  • Peter Cordes
    Peter Cordes almost 9 years
    You only need export LANG=C once, if you're going to run it as a command (separated by semicolon from anything else). If you want to set an env var for one command only, run sudo LANG=C apt-get.... (so you don't have to worry about LANG=C sudo ... env-sanitizing wiping out your setting.)
  • Azsgy
    Azsgy almost 9 years
    this seems to be underrepresented for being the actual solution. Just remember to remount /tmp/
  • Saiboogu
    Saiboogu over 8 years
    My understanding -- By default, /tmp is part of the / mount. When / gets tight on space, Ubuntu mounts a ramdisk under /tmp to keep a minimal /tmp folder available while the / is out of space. Once / is fixed (has space again), you can safely umount /tmp and let the path revert to the / mount.
  • Azsgy
    Azsgy over 8 years
    that makes sense. However, it should be noted that this is not default behavior, and specific to Ubuntu. In hindsight, the problem for me was that /tmp/ was full, not /. Unmounting /tmp/ still worked, as I have /tmp/ as tmpfs
  • Shaun Wilson
    Shaun Wilson about 8 years
    I had a similar problem while trying to dist upgrade and the secondary solution here resolved the issue for me. I also found I had to remove a few packages that referred to missing/relocated package sources, then remove the missing/relocated sources from /etc/apt/sources.list and /etc/apt/sources.list.d/*; then I performed the above again for good measure -- I'm now able to update to latest stable <G> and no more complaints from apt -- thanks!