I am trying to install a VSIX package downloaded from the Marketplace using wget on a Linux VM where the VSCode server is installed but I am getting the below error:
$ wget -nv https://marketplace.visualstudio.com/_apis/public/gallery/publishers/llvm-vs-code-extensions/vsextensions/vscode-clangd/latest/vspackage -o vspackage.vsix
$ code --install-extension vspackage.vsix
Installing extensions on SSH: boozy-olive-harrier...
Corrupt ZIP: end of central directory record signature not found
Failed Installing Extensions: vscode-remote://ssh-remote%2Bboozy-olive-harrier/root/vspackage.vsix
Downloading the file with Firefox on Windows and using the "Install from VSIX..." button inside the VSCode client (ref) works as expected.
The URL I am using is this one: https://marketplace.visualstudio.com/_apis/public/gallery/publishers/llvm-vs-code-extensions/vsextensions/vscode-clangd/latest/vspackage
I compared the md5sum of the downloaded files and I don't get the same if I download the file from Windows or Linux:
Linux VM:
wget
$ wget -nv https://marketplace.visualstudio.com/_apis/public/gallery/publishers/llvm-vs-code-extensions/vsextensions/vscode-clangd/latest/vspackage
2021-02-09 16:50:08 URL:https://marketplace.visualstudio.com/_apis/public/gallery/publishers/llvm-vs-code-extensions/vsextensions/vscode-clangd/latest/vspackage [1270960/1270960] -> "vspackage" [1]
$ du -sk vspackage
1244 vspackage
$ md5sum vspackage
10f6bdb1151a954a702f8a6db6f3bd52 vspackage
Windows:
> certutil.exe -hashfile .\llvm-vs-code-extensions.vscode-clangd-0.1.9.vsix MD5
MD5 hash of .\llvm-vs-code-extensions.vscode-clangd-0.1.9.vsix:
74f82f716616796157bde8008c8e5a45
CertUtil: -hashfile command completed successfully.
- Powershell
> Invoke-WebRequest https://marketplace.visualstudio.com/_apis/public/gallery/publishers/llvm-vs-code-extensions/vsextensions/vscode-clangd/latest/vspackage -OutFile vspackage
> Get-ChildItem .\vspackage | % {[int]($_.length / 1kb)}
1383
> certutil.exe -hashfile .\vspackage MD5
MD5 hash of .\vspackage:
74f82f716616796157bde8008c8e5a45
CertUtil: -hashfile command completed successfully.
The hash of the downloaded file is not the same even though the download URL is.
It seems I am missing a few bytes on Linux which would explain the Corrupt ZIP error.
Does somebody understand what I am missing here?