2

Suddenly sudo apt update is not working anymore on my Ubuntu 18.04.6 machine. I get the following error:

Hit:1 https://download.docker.com/linux/ubuntu bionic InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
Err:2 http://us.archive.ubuntu.com/ubuntu bionic InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:3 http://us.archive.ubuntu.com/ubuntu bionic-security InRelease
Err:3 http://us.archive.ubuntu.com/ubuntu bionic-security InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
Err:4 http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Reading package lists... Done
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic InRelease' is not signed.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic-security/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic-security InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
E: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/bionic-updates/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: The repository 'http://us.archive.ubuntu.com/ubuntu bionic-updates InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.

My /etc/apt/sources.list:

###### Ubuntu Main Repos
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse

###### Ubuntu Update Repos
deb http://us.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://us.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse

My /etc/resolv.conf:

nameserver 1.1.1.1

I have tried changing the repository mirror to no luck. I tried running sudo apt update from within an Ubuntu docker image and the same error comes out.

Commenting out the source repos didn't change the situation.

Would this mean that this is a network issue? Or I can still do/check something?

UPDATE:

I am adding more details as suggested in the comments. /etc/apt/apt.conf does not exist and I am not using a proxy. This issue has been going on for the last month. I tried updating an Ubuntu bionic within Docker but I got the same result. I have also tried choosing another archive repository mirror, again with the same error.

th3owner
  • 21
  • 1
  • 4
  • There's a lot of postings with the same error in this site, Ask Ubuntu and others, with multiple possible solutions. Oftentimes it seems to be related to the network connectivity. – Peregrino69 Mar 24 '23 at 21:09
  • @Peregrino69 I have actually gone through lots of those postings with no luck. I initially suspected for a network connectivity issue but I can ping all archive endpoints. – th3owner Mar 24 '23 at 21:22
  • Unfortunately I do not have physical access to the machine at the moment in order to perform an upgrade. I commented out the source repos but nothing changed in the output. – th3owner Mar 24 '23 at 21:58
  • In general it's far better to edit the question to add clarifications and new info. This way the question gets more focused and everything relevant is immediately available. Has this been going on for a long time? – Peregrino69 Mar 24 '23 at 22:01
  • Post your /etc/apt/apt.conf and indicate if your using a proxy – Ramhound Mar 24 '23 at 23:02
  • 2
    Does this answer your question? [How can I get past a “Repository is not signed…” message when attempting to upgrade Kali Linux from a mounted disk image?](https://superuser.com/questions/1331936/how-can-i-get-past-a-repository-is-not-signed-message-when-attempting-to-upgr). [This](https://superuser.com/questions/1774745/kali-apt-get-update-fails-with-clearsigned-file-isnt-valid#comment2767277_1774745) mentions the exact same error, and likely is a duplicate of the question I flagged as a duplicate of this question, since they both mentioned the same error. If not provide more details. – Ramhound Mar 24 '23 at 23:04

1 Answers1

0

So I was not able to fix the problem on the remote machine and since I currently do not have physical access to the machine I resorted to reverse SSH tunnelling and a SSH SOCKS5 proxy.

On my local machine I setup the SSH SOCKS5 proxy:

ssh -N -D 54322 localhost

Then on another terminal I created the reverse SSH tunnelling forwarding a port of the remote server to the proxy port (54322 in this case):

ssh -N -R 6667:localhost:54322 <server-ip> -o ServerAliveInterval=15 -o ServerAliveCountMax=3

Finally I created the file /etc/apt/apt.conf.d/proxy.conf and added the SOCKS5 proxy for APT:

Acquire:http:Proxy "socks5h://127.0.0.1:6667/"
Acquire:https:Proxy "socks5h://127.0.0.1:6667/"

This allowed me to run sudo apt update without any issues.

th3owner
  • 21
  • 1
  • 4