28

I can use my mobile broadband to access Internet with Firefox but when I want to install any package from terminal or make 'apt-get update' command I got the following error:

got 'NODATA' (does the network require authentication?)

apt-get update output:

Get:1 extras.ubuntu.com trusty InRelease [213 B] 98% [1 InRelease gpgv 213 B] [Connecting to archive.ubuntu.com]
Splitting up /var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_trusty_InRelease into data
Ign extras.ubuntu.com trusty InRelease E: GPG error: extras.ubuntu.com trusty InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?) 

output of `cat /var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_trusty_InRelease

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <head> <title>404</title> <meta http-equiv="Cache-Control" content="no-cache"/> </head> <body> <p> Not Found </p> </body> </html>

output of wget:

wget -O - http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease

--2014-06-01 09:23:35--  http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
Resolving extras.ubuntu.com (extras.ubuntu.com)... 91.189.92.152
Connecting to extras.ubuntu.com (extras.ubuntu.com)|91.189.92.152|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 213 [text/html]
Saving to: ‘STDOUT’

 0% [                                       ] 0           --.-K/s              <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>404</title>
<meta http-equiv="Cache-Control" content="no-cache"/>
</head>
<body>
<p>
Not Found 
</p>
</body>
</html>
Braiam
  • 67,791
  • 32
  • 179
  • 269
  • Can you edit your question and add the exact output of apt-get update – bain May 30 '14 at 17:34
  • apt-get update output: Get:1 http://extras.ubuntu.com trusty InRelease [213 B]
    98% [1 InRelease gpgv 213 B] [Connecting to archive.ubuntu.com]Splitting up /var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_trusty_InRelease into dataIgn http://extras.ubuntu.com trusty InRelease
    E: GPG error: http://extras.ubuntu.com trusty InRelease: Clearsigned file isn't valid, got 'NODATA' (does the network require authentication?)
    – user281814 May 30 '14 at 17:59
  • Sorry, I have no reputation to I can edit the question and put more than 2 links. – user281814 May 30 '14 at 18:00
  • Can you post the output of apt-config dump|grep -i proxy – bain May 30 '14 at 18:14
  • Also can you do cat /var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_trusty_InRelease and post the output to pastebin and link to it here – bain May 30 '14 at 18:15
  • cat: /var/lib/apt/lists/extras.ubuntu.com_ubuntu_dists_trusty_InRelease: No such file or directory – user281814 May 30 '14 at 19:28
  • Can you post output of grep -rH extras /etc/apt/sources.list* – bain May 30 '14 at 19:37
  • /etc/apt/sources.list:deb http://extras.ubuntu.com/ubuntu trusty main /etc/apt/sources.list:deb-src http://extras.ubuntu.com/ubuntu trusty main /etc/apt/sources.list.save:deb http://extras.ubuntu.com/ubuntu trusty main /etc/apt/sources.list.save:deb-src http://extras.ubuntu.com/ubuntu trusty main – user281814 May 30 '14 at 20:03
  • apt-config dump|grep -i proxy # give me nothing – user281814 May 30 '14 at 20:04
  • Can you post the output of cat /var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_trusty_InRelease – bain May 30 '14 at 22:06
  • And wget -O - http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease and apt-get update --print-uris – bain May 30 '14 at 22:27
  • 404 Not Found – user281814 Jun 01 '14 at 06:23
  • http://paste.ubuntu.com/7563852/ – user281814 Jun 01 '14 at 06:26
  • http://paste.ubuntu.com/7563861/ – user281814 Jun 01 '14 at 06:27
  • removing all the PPA's in other sources resolved the issue. It seems like trying to reach one of the PPA, was leading to 404 NODATA error. – user2166213 Jul 05 '15 at 11:12
  • Best answer here at http://askubuntu.com/a/410547/129573 – Adriano P May 11 '16 at 18:22
  • You can also see this error if you do apt-get update when your disk is full. – aschmied Jun 22 '18 at 13:23

10 Answers10

25

Your mobile broadband provider is running a faulty transparent proxy. The URL http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease should return "404 Not Found". Instead it returns "200 OK" but sends 404 content. Since the URL is "OK", apt copies the content to /var/lib/apt/lists/partial/extras.ubuntu.com_ubuntu_dists_trusty_InRelease and attempts to use it, and then complains that it is incorrect.

The problem here is not Ubuntu, it is the transparent proxy of your mobile broadband provider. You might be able to contact them to fix it.

Here is the output from a normal internet connection:

$ wget -O - http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
--2014-06-01 10:25:36--  http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
Resolving extras.ubuntu.com (extras.ubuntu.com)... 91.189.92.152
Connecting to extras.ubuntu.com (extras.ubuntu.com)|91.189.92.152|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2014-06-01 10:25:36 ERROR 404: Not Found.

For some details of the problems caused by transparent proxies on mobile connections see answers to the question How to stop javascript injection from vodafone proxy?

bain
  • 11,260
  • yes, you alright, I tried another Broadband ISP and it works fine,what I could say for the ISP to stop using transparent proxy? is transparent proxy illegal ? – user281814 Jun 01 '14 at 20:24
  • If you ISP has any kind of technical support you could complain to them. You could also route your traffic through a VPN so it is encrypted and the ISP can not interfere with it. – bain Jun 01 '14 at 20:37
  • Do you mean that I should ask them to stop using transparent proxy? What should they do to solve this problem? – user281814 Jun 01 '14 at 20:42
  • Yes, you can ask them if there is a way to turn off the transparent proxy. To solve this problem they need to either turn off the proxy or fix it. Without knowing what software they are using, it is impossible to say how they could do this. – bain Jun 01 '14 at 20:56
  • 1
    @user281814 Can you please mark the answer as accepted, to help other users who have this issue to find an answer. – bain Jun 04 '14 at 13:21
  • You can use sudo torsocks apt-get update if you have tor and torsocks installed. – Olathe Jun 28 '14 at 16:48
  • @bain apt-get will behave the same if configured (by accident) to use an explicit proxy. See my posted answer. – dtmland Jan 29 '15 at 23:20
  • I cannot force my ISP to fix this quickly. In the meantime, is there a workaround? – a06e Apr 16 '16 at 23:46
  • @becko You could run a local proxy and explicitly block the broken URL, or use a VPN service to bypass your ISP. – bain Apr 30 '16 at 15:53
13

I just had the same problem. I think my ISP also uses a rather nasty proxy.

While the solution proposed by bain might be the Right Thing To Do (TM), I found a more immediate and practical solution on the Linux Mint forum which basically involves removing the potentially broken entries from the /var/lib/apt/lists directory (or rather, the directory entirely):

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

These commands fixed the problem for me.

FriendFX
  • 760
  • 1
  • 11
  • 33
  • Worked for me without the mkdir. – AlikElzin-kilaka Mar 30 '16 at 10:31
  • How do you undo this operation? I ran those commands, tried to update (which didn't work, I had the same problem as the person who asked the original question), and now it won't even install the old version of the software I was trying to install. – Anson Savage Feb 17 '18 at 19:54
  • 1
    @AnsonSavage if you followed the steps exactly, your original lists folder should still be saved as lists.old. So to reverse the operation, you should be able to do this: cd /var/lib/apt ; sudo mv lists lists.undone ; sudo mv lists.old lists ; sudo apt-get update ...which basically renames the new "broken" lists folder to lists.undone and restores the lists folder from lists.old. Hope that helps. – FriendFX Feb 21 '18 at 04:06
6

I was getting this same issue running Ubuntu 14.04 in VMWare. The comment above tipped me off to experiment with the network settings. Once I changed from the default NAT to Bridged my problem was solved.

user4970
  • 61
  • 1
  • 1
  • had this same issue, but had to change from Bridged to NAT to get it to work. Quite odd, because it worked with Bridged up until today. – DBrown Feb 13 '21 at 01:54
3

I ran into the same issue after I added a ppa (Dropbox) refering to a domain which is blocked by my company's proxy (*.dropbox.com). Since apt-get update can't read http://linux.dropbox.com/ubuntu, it throws this "NODATA" error.

I ended up removing the ppa:

sudo rm /etc/apt/sources.list.d/dropbox.list
Anto
  • 2,661
3

This can also occur when apt-get is configured to use a proxy that doesn't exist (duh!). In my case, I moved a machine that was on a proxy network but forgot to remove the apt-get proxy configuration in this file:

/etc/apt/apt.conf

To my credit I had removed the environment variable entries (also see here) but simply forgot about the apt-get configuration file.

dtmland
  • 187
  • 2
  • 10
1

I got this error today, and the reason was because my disk was full. Maybe not related, but freeing up some space solved this issue. apt-get was showing "no space left on device" issue though.

Arda
  • 1,320
  • 11
  • 15
1

I had the same problem, it turned out to be my ISP's content controls messing with my server's DNS requests. One angry call to them got the controls disabled, and my dns returned to normal after a router reset.

1

Running into the same issue here I found out that our firewall is interfering by means of 'application control'. So be aware of url altering functions

Jeroen
  • 11
  • 1
1

I was initially using a mobile data internet and so I was not able to update ubuntu 14.04 due to some proxy and got NO DATA when ever I did an

$ sudo apt-get install update

But then when I got a wired line and tried the same update it did not let me do it and gave the same NO DATA error.

But then surprisingly few software got installed through apt-get install statement.

I enquired all the world and got no answer. Lastly I tried this and it worked. Please check the following image.

I removed few check marks from the list in the image

I just tot it could help some one who came across similar issue.

I got this answer by installing a fresh ubuntu and tried "update" from the same wired connection and compared the settings and got it fixed :-) Re-leaved after a long pathless run.

David Foerster
  • 36,264
  • 56
  • 94
  • 147
0

Recently the university where the server lies has dismissed the proxy. I've been looking for all proxy instances and removed them in ~.bashrc and in /etp/apt/apt.conf but I also needed to remove proxy settings into /etc/environment and /etc/bash.bash.rc.

This finally solved all the problems.

linello
  • 141