Dotnet-sdk.dotnet missing 'dotnet' alias

Pretty sure it was working recently, but no longer.

Prior approval: Requesting automatic alias for dotnet

$ sudo snap install dotnet-sdk --classic
dotnet-sdk 3.1.402 from Microsoft .NET Core (dotnetcore✓) installed

$ dotnet
Command 'dotnet' not found, but can be installed with:

sudo snap install dotnet-sdk

$ stat /snap/bin/dotnet
stat: cannot stat '/snap/bin/dotnet': No such file or directory

$ snap aliases | grep dotnet
<empty>
1 Like

Does the snapd log tell you something about why it couldn’t set up the alias?

It is there in the snap assertion:

$ curl -s  "https://api.snapcraft.io/api/v1/snaps/assertions/snap-declaration/16/uHc4y9lWxyqYfxsqcr4xILzAai4L1BHs?max-format=4" -H "Accept: application/x.ubuntu.assertion" 
type: snap-declaration
authority-id: canonical
revision: 2
series: 16
snap-id: uHc4y9lWxyqYfxsqcr4xILzAai4L1BHs
aliases:
  -
    name: dotnet
    target: dotnet-sdk
auto-aliases:
  - dotnet
publisher-id: NkziOx5Ju2cGzp2Ei3picHMIev25uDU6
snap-name: dotnet-sdk
timestamp: 2018-01-31T19:47:36.754886Z
sign-key-sha3-384: BWDEoaqyr25nF5SNCvEv2v7QnM9QsfCc0PBMYD_i2NGSQ32EF2d4D0hqUel3m8ul

I do not see any snap warnings and the journal shows just snapd[3875]: api.go:997: Installing snap "dotnet-sdk" revision unset in the logs. Anything else to check?

Hm you could check “snap known” (I think snap known snap-declaration or somesuch) just to double-check your installation has the correct copy of the assertion with the alias declared. Other than that, it looks to be a snapd problem, not a store issue so I would perhaps recategorize this under https://forum.snapcraft.io/c/snapd and ask there.

  • Daniel
1 Like

Yes this seems to be a snapd issue, I can reproduce it and don’t see anything fishy in the snapd tasks log or debug log from snapd itself. I will try to have a look inside snapd, but please file a LP bug so we don’t lose track of this on the forum (and apologies for telling you to post on the forum and then on LP, I promise I won’t redirect you from there to somewhere else :wink:)

1 Like

No problem @ijohnson, thanks!

Created issue:

1 Like

After talking to @pedronis the declaration should look like this:

aliases:
   - name: dotnet
     target: dotnet

There is no dotnet-sdk app in the snap. Maybe the app name got changed in some revision, but the declaration was never updated?

2 Likes

@mborzecki @pedronis Ah, that would make sense! Thanks for looking at it! :smiley:

I’m not sure there ever was a dotnet-sdk app, so it probably never worked? The original request thread was for dotnet. :thinking:

The .NET SDK docs tell the users to run snap alias, so I expect that’s what I did as well in the past when I followed it, forgetting that I did it manually. https://docs.microsoft.com/en-us/dotnet/core/install/linux-ubuntu

Can you update the alias @roadmr?

@pedronis has updated the snap declaration, rev 3 looks like this:

 type: snap-declaration
authority-id: canonical
revision: 3
series: 16
snap-id: uHc4y9lWxyqYfxsqcr4xILzAai4L1BHs
aliases:
  -
    name: dotnet
    target: dotnet
auto-aliases:
  - dotnet
publisher-id: NkziOx5Ju2cGzp2Ei3picHMIev25uDU6

and a correct alias is added upon installation.

2 Likes

Yay, it works! :smiley: Thanks again!