9

enter image description here

when i run sudo apt update

It shows :- 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 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.

Scorpio
  • 111
  • 1
  • 1
  • 5
  • This seems like a recent [issue](https://github.com/Microsoft/mssql-docker/issues/409) that needs to be resolved by a developer. I don't need to update the package at the moment. So for now I have removed http://packages.microsoft.com/repos/code repo from the list of other repos that I update from. After I did that I was able to run `sudo apt update` with no problem. This [link](https://askubuntu.com/questions/43345/how-to-remove-a-repository) might be helpful. – Supra_01 Sep 29 '21 at 12:04

5 Answers5

5

I ran into this issue too today. After reading a bunch of other threads on it. It is in most cases have to do with network connectivity and in my case an issue on Microsoft's end. After half an hour or so it resolved by itself.

BenVida
  • 1,796
  • 1
  • 16
  • 25
1

Software&Updates - Other Software - find something http://packages.microsoft.com... and uncheck this

Shaybakov
  • 618
  • 7
  • 9
0

A workaround, use vim/nano to edit the source.list file.

sudo vim /etc/apt/sources.list.d/vscode.list

Comment the line with #

# deb [arch=amd64,arm64,armhf] http://packages.microsoft.com/repos/code stable main

save it :wq and re-run the update.

This solution is discussed in reddit

⚠️ By running the chattr +i cmd found in Reddit you will restrict the future edit for the file, use chattr -i to make it editable.

rain
  • 525
  • 6
  • 15
  • Thanks for the solution. It automatically resolved after 1-2 hours. There was an issue commit of the new build Microsoft vscode. – Scorpio Sep 30 '21 at 16:55
  • I have the same issue but instead of the microsoft link it says "http://mirrors.evowise.com/linuxmint/packages" among others. – David G Nov 09 '21 at 04:33
0

You just had to renew the the apt repository and signing key. have a look here:

https://code.visualstudio.com/docs/setup/linux

the following code will fix your problem:

wget -qO- https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > packages.microsoft.gpg
sudo install -o root -g root -m 644 packages.microsoft.gpg /etc/apt/trusted.gpg.d/
sudo sh -c 'echo "deb [arch=amd64,arm64,armhf signed-by=/etc/apt/trusted.gpg.d/packages.microsoft.gpg] https://packages.microsoft.com/repos/code stable main" > /etc/apt/sources.list.d/vscode.list'
rm -f packages.microsoft.gpg
Community
  • 1
  • 1
user1008764
  • 390
  • 1
  • 3
  • 7
0

I encounter this problem in WSL of Debian, Ubuntu2004 or Ubuntu2204, when I execute sudo apt update.

For Debian, I install the ca-certificates.deb,apt-transport-https together with their dependencies openssl.deb manually, which were download from https://www.debian.org/distrib/packages.

Then I replace the http in the /etc/apt/sources.list to https.

Finally, execute sudo apt update, Clearsigned file isn't valid, got 'NOSPLIT' never appears.

Alpha
  • 668
  • 6
  • 11