37

So I am on my college network which requires me to sign in to the browser before I start using the internet. I do so succesfully but on a clean install of Ubuntu, when I try to do sudo apt update, I get the following output:

$ sudo apt update
Get:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease [2,847 B]
Err:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease                    
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [2,854 B]    
Err:2 http://security.ubuntu.com/ubuntu xenial-security InRelease             
...
Get:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease [2,855 B]   
Err:3 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease
...
Get:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease [2,857 B]
Err:4 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease
Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched 11.4 kB in 0s (18.3 kB/s)
Reading package lists... Done
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
...
E: Some index files failed to download. They have been ignored, or old ones used instead.

But when I do wget http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease, I get this output success:

2017-04-01 05:34:57  http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease
Resolving in.archive.ubuntu.com (in.archive.ubuntu.com)... 91.189.88.162, 91.189.88.149, 91.189.88.152, ...
Connecting to in.archive.ubuntu.com (in.archive.ubuntu.com)|91.189.88.162|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 246846 (241K)
Saving to: ‘InRelease.3’

InRelease.3         100%[===================>] 241.06K   110KB/s    in 2.2s    

2017-04-01 05:35:00 (110 KB/s) - ‘InRelease.3’ saved [246846/246846]

Clearly I have internet access from my browser and on wget but when I do sudo apt (or apt-get) update I get this error.

PS: This question is not similar to other threads as their solutions do not seem to work on mine

As I have found out, this problem is happening only to me, not others on the college network. Despite setting up the network according to instructions, this still happens. Any more help would be appreciated

EDIT: So as it turns out, 50% of us in the college are facing this issue, while 50% aren't despite having no issues with the hardware and sudo apt update before the last week. Thanks to @David Foerster for helping me throughout all this time.

As it stands, the issue has been raised to our college's networking department :)

Sparker0i
  • 629
  • 1
  • 7
  • 11
  • What's the output of wget -qO- http://in.archive.ubuntu.com/ubuntu/dists/xenial/InRelease | head? – David Foerster Apr 01 '17 at 09:11
  • Did you configure any HTTP proxy server on your system or for Apt specifically? How is the system connected to the internet? Usually this type of error stems from faulty proxy configuration or misbehaving proxy servers. – David Foerster Apr 01 '17 at 11:44
  • The problem as it stands seem to be Apt specific only, that too on the College WiFi. This is because Wget also works seamlessly – Sparker0i Apr 02 '17 at 15:48
  • 1
    For the third time now, could you please change the Ubuntu repository mirror and try to reproduce the issue? If this only happens in your college network I advise you to contact the local network administrators for support because they know the local network infrastructure and HTTP proxy servers. Thanks. – David Foerster Apr 02 '17 at 20:11
  • Sir, please don't get angry. I'm a linux noobie trying to get into the world of Ubuntu. I've pasted another pastie, and the output is fine, just like the previous one. – Sparker0i Apr 02 '17 at 20:21
  • I'm not angry. Sorry if it appeared that way. I'm just trying to remind you of my request with some urgency since you seem to have missed it the last two times. Anyway, thanks for the update. What's the output of sudo apt-get update now with the different Ubuntu repository mirror? – David Foerster Apr 02 '17 at 21:03
  • Same as before, with the NOSPLIT thing – Sparker0i Apr 03 '17 at 10:39
  • 2
    To close voters: The issue was related to an upstream network problem according to OP's answer. – David Foerster Jul 11 '17 at 16:13
  • 1
    I think what the OP was saying was that there is a difficulty using Ubuntu in their environment. You could argue that the problem is with the environment, but there may also be a valid Ubuntu solution (there is for some people with matching symptoms). – Brent Bradburn Oct 03 '17 at 21:35
  • It turns out that just setting the proxy is not enough because sudo doesn't apply the user's environment variables by default. Try this way: sudo --preserve-env apt update. Also remember to open a new terminal after every proxy change. – Brent Bradburn Oct 03 '17 at 21:48
  • @nobar, thanks for that. But it is now a problem with anyone on the college WiFi, not just me.. And moreover this exists across a range of Ubuntu versions..They have blocked apt ports – Sparker0i Oct 04 '17 at 12:57
  • I'm voting to reopen this, because it is about Ubuntu, and the answers here--including the OP's own answer--will help people to understand what that error message often means. – Eliah Kagan Nov 27 '17 at 03:32
  • as i reproduce this issue this is due to wrong date and time if you are using HTTPS registriess, – Mansur Ul Hasan May 24 '18 at 09:38

6 Answers6

18

I had the same issue. It turns out that apt-get uses /etc/apt/apt.conf for the proxy settings (my browser settings are already set). Making apt.conf match my browser proxy settings solved the problem.

/etc/apt$ cat apt.conf

Acquire::http::proxy "http://<proxy>";
Acquire::https::proxy "https://<proxy>";
Acquire::ftp::proxy "ftp://<proxy>";
Acquire::socks::proxy "socks:<proxy>";
David Foerster
  • 36,264
  • 56
  • 94
  • 147
brian
  • 181
9

Turns out it was a problem in our college's network backend. Issues still exist with it, other WiFi networks work fine.

Sparker0i
  • 629
  • 1
  • 7
  • 11
4

when you having such issued, first make sure the DNS can resolve the links, which l think is the problem.

sudo vim /etc/resolv.conf

make sure you use google dns :

nameserver 8.8.8.8

as the first name server to check. restart the networking.service and you will be good to go

Félicien
  • 1,183
salis
  • 77
3

I know this is a 3 year old thread but adding my solution so that it could be a help for someone in the future.

I too was facing the same problem and it turned out it was because of exceeding the FUP data cap of my connection. On the browser I was redirected to the ISP's FUP reminder page after which the problem went away.

S K
  • 103
3

For me this error message was accompanied by another one:

E: Failed to fetch http://packages.microsoft.com/repos/code/dists/stable/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'http://packages.microsoft.com/repos/code stable InRelease' is no longer signed.

This post gives a workaround for the second issue (it basically disables the bad PPA), and after fixing the second issue the first one disappeared as well.

This is not a permanent solution though, since packages from the disabled PPA will not be updated anymore.

1

For some reason, the repository URL changed:

  • from: https://packages.microsoft.com/repos/vscode
  • to: https://packages.microsoft.com/repos/code

So updating the APT source to the following fixed the issue for me:

deb [arch=amd64 signed-by=/usr/share/keyrings/microsoft-archive-keyring.gpg] https://packages.microsoft.com/repos/code stable main

Source