This is a simple error I got when I tried to run apt-get update :
E: GPG error: <some url in here> InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
Searching the internet for how to solve this problem, I found out a lot of references regarding proxies – which could not be, I was in my home, I had no proxy and other virtual machines were running and updating without any problem. After some more digging (and after a more accurate reading of the the error), I started suspecting something went corrupt – I don’t know how – with the entire gpg key database of apt.
I tried to test it, removing one at the time all rows on /etc/apt/sources.list – and for every one of them the error was the same.
I found the answer that worked for me here – AskUbuntu – Can’t update my system due to GPG error . Below is the code:
sudo apt-get clean
sudo mv /var/lib/apt/lists /var/lib/apt/lists.broke
sudo mkdir -p /var/lib/apt/lists/partial
sudo apt-get update
- apt-get clean removes all files downloaded by apt . When you install a package, apt download all necessary files and put them in a local archive and then installs it. The directory is /var/cache/apt/archives/ . The cleaning in this case is simply to start anew
- mv is for the same reason as above, to get a clean environment and to force a new download of all lists from the repositories
- mkdir recreates the moved directory
- apt-get update is the command that gave the error that started this post 🙂
MORE IN DEPTH
According to this link: AskUbuntu – Got NODATA issue: ‘NODATA’ (does the network require authentication?) the error could be caused by the ISP (Internet Service Provider) placing a proxy, maybe a transparent one (Maxcdn – Transparent proxy) in front of your connection. I have to dig deeper on this topic, if this is effectively the reason on this error.