Powershell: Failures on command-line for .NET Core SDK install for Ubuntu 16.04

Created on 28 Dec 2017  路  2Comments  路  Source: PowerShell/PowerShell


I'm trying to install .NET Core SDK following these instructions for Ubuntu 16.04 from PowerShell Core and it is not working.

Steps to reproduce

1. curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg

2. sudo sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main" > /etc/apt/sources.list.d/dotnetdev.list'

Expected behavior

  1. Outputs a utf8 file without BOM.

  2. Works.

Actual behavior

  1. Outputs file WITH BOM which causes an error later:
PS /home/hillr/dotnet> sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [102 kB]
Hit:3 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
Get:4 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [102 kB]
Get:5 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Err:3 https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease
  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
Get:6 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [409 kB]
Get:7 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [180 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [191 kB]
Get:9 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [99.1 kB]
Get:10 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [682 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [285 kB]
Get:12 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [566 kB]
Get:13 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [229 kB]
Get:14 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [4,840 B]
Fetched 2,953 kB in 11s (262 kB/s)
Reading package lists... Done
W: An error occurred during the signature verification. The repository is not updated and the previous index files will be used. GPG error: https://packages.microsoft.com/ubuntu/16.04/prod xenial InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
W: Failed to fetch https://packages.microsoft.com/ubuntu/16.04/prod/dists/xenial/InRelease  The following signatures couldn't be verified because the public key is not available: NO_PUBKEY EB3E94ADBE1229CF
W: Some index files failed to download. They have been ignored, or old ones used instead.

I thought by now (RC-2) we were defaulting to utf8 no BOM on Linux?

  1. Does not create the dotnetdev.list file. Instead, outputs "deb" and does nothing else.

The root of the problem is likely quoting - again...

sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/microsoft-ubuntu-xenial-prod xenial main"'

Echos just:

deb

Environment data

> $PSVersionTable
Name                           Value
----                           -----
PSVersion                      6.0.0-rc.2
PSEdition                      Core
GitCommitId                    v6.0.0-rc.2
OS                             Linux 4.4.0-43-Microsoft #1-Microsoft Wed Dec 31 14:42:53 PST 2014
Platform                       Unix
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
WSManStackVersion              3.0
Issue-Question WG-DevEx-SDK

Most helpful comment

Partially from: https://github.com/Microsoft/vscode/issues/27970

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

It worked for me, when it failed on LSW.

Idk the security implications of this. No idea why this public key is not already added to begin with.

All 2 comments

Partially from: https://github.com/Microsoft/vscode/issues/27970

curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg
sudo mv microsoft.gpg /etc/apt/trusted.gpg.d/microsoft.gpg

It worked for me, when it failed on LSW.

Idk the security implications of this. No idea why this public key is not already added to begin with.

@rkeithhill Do you see the issue with PowerShell 7.0?

/cc @SteveL-MSFT

Was this page helpful?
0 / 5 - 0 ratings

Related issues

garegin16 picture garegin16  路  3Comments

manofspirit picture manofspirit  路  3Comments

rudolfvesely picture rudolfvesely  路  3Comments

rkeithhill picture rkeithhill  路  3Comments

alx9r picture alx9r  路  3Comments