Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broken system with Ubuntu 22.04 where Microsoft packages are partially replaced by Canonical packages #73764

Closed
1 task done
Robinsond76 opened this issue Aug 11, 2022 · 9 comments
Labels
area-Host needs-author-action An issue or pull request that requires more info or actions from the author. packaging Related to packaging

Comments

@Robinsond76
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

My issue seems to be similar to this one except I'm on linux (popOS 22.04).
Summing up the problem - when I attempted to use dotnet watch run today, I got the * You intended to execute a .NET SDK command: No .NET SDKs were found. message.

When I attempt to install the dotnet sdk using sudo apt install dotnet-sdk-6.0 I get dotnet-sdk-6.0 is already the newest version (6.0.400-1).

When I do dotnet --info, I get:

  Not found

Host:
  Version:      6.0.8
  Architecture: x64
  Commit:       55fb7ef977

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]

I've tried doing whereis dotnet and adding all those paths to my $PATH but it didn't solve my problem. It was working just fine yesterday. Today when I got on the computer, I ran system and vscode updates - I don't know if that caused the problem.

Here is my whereis dotnet:

usr/bin/dotnet /usr/lib/dotnet /etc/dotnet /usr/share/dotnet /usr/lib/dotnet/dotnet6-6.0.108/dotnet /usr/share/man/man1/dotnet.1.gz

Here is my path:

/home/robinson/.nvm/versions/node/v18.7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/robinson/.dotnet/tools

I've also tried removing all dotnet packages that showed up in apt list installed 'dotnet*', restarting and reinstalling.

Any help is appreciated.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0

Anything else?

No response

@javiercn javiercn transferred this issue from dotnet/aspnetcore Aug 11, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 11, 2022
@ghost
Copy link

ghost commented Aug 11, 2022

Tagging subscribers to this area: @vitek-karas, @agocke, @VSadov
See info in area-owners.md if you want to be subscribed.

Issue Details

Is there an existing issue for this?

  • I have searched the existing issues

Describe the bug

My issue seems to be similar to this one except I'm on linux (popOS 22.04).
Summing up the problem - when I attempted to use dotnet watch run today, I got the * You intended to execute a .NET SDK command: No .NET SDKs were found. message.

When I attempt to install the dotnet sdk using sudo apt install dotnet-sdk-6.0 I get dotnet-sdk-6.0 is already the newest version (6.0.400-1).

When I do dotnet --info, I get:

  Not found

Host:
  Version:      6.0.8
  Architecture: x64
  Commit:       55fb7ef977

.NET SDKs installed:
  No SDKs were found.

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]

I've tried doing whereis dotnet and adding all those paths to my $PATH but it didn't solve my problem. It was working just fine yesterday. Today when I got on the computer, I ran system and vscode updates - I don't know if that caused the problem.

Here is my whereis dotnet:

usr/bin/dotnet /usr/lib/dotnet /etc/dotnet /usr/share/dotnet /usr/lib/dotnet/dotnet6-6.0.108/dotnet /usr/share/man/man1/dotnet.1.gz

Here is my path:

/home/robinson/.nvm/versions/node/v18.7.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/robinson/.dotnet/tools

I've also tried removing all dotnet packages that showed up in apt list installed 'dotnet*', restarting and reinstalling.

Any help is appreciated.

Expected Behavior

No response

Steps To Reproduce

No response

Exceptions (if any)

No response

.NET Version

6.0

Anything else?

No response

Author: Robinsond76
Assignees: -
Labels:

area-Host

Milestone: -

@vitek-karas
Copy link
Member

It should look for SDK next to the dotnet executable. So based on the output - your setup picks dotnet in /usr/lib/dotnet/dotnet6-6.0.108 and there is probably no SDK installed there. I don't know what would put it there (standard package installers should put it into /usr/share/dotnet.

@remcodewit83
Copy link

remcodewit83 commented Aug 12, 2022

I had exactly the same issue yesterday, following the same steps you did there. Eventually removed the packages again and used the dotnet-install.sh script to install it and that works (instructions can be found here: https://www.how2shout.com/linux/how-to-install-net-core-dotnet-on-ubuntu-22-04-lts/).

@Robinsond76
Copy link
Author

Hello everyone,
it seems people started having the same issue and someone posted some steps on how to solve it on my post on StackOverflow. Here is the link.

So I ended up solving the issue as well by doing the following:
I uninstalled everything I could that was dotnet related with: sudo apt remove 'dotnet*'
Then sudo apt update
Then I followed the instructions on this link to unpack the binaries straight into the /opt/ folder. Once I added the necessary lines to PATH (according to the instructions in the link), everything worked as expected.

I would however recommend following the instructions in the StackOverflow post first as using the package manager might be the better solution.
Thank you everyone.

@directhex
Copy link
Member

I can't reproduce this issue. Fresh install of popOS 22.04, installing the distro dotnet-sdk-6.0 package, yields a found SDK in the correct place:

$ dotnet --info
.NET SDK (reflecting any global.json):
 Version:   6.0.108
 Commit:    4e3a463d2b

Runtime Environment:
 OS Name:     pop
 OS Version:  22.04
 OS Platform: Linux
 RID:         ubuntu.22.04-x64
 Base Path:   /usr/lib/dotnet/dotnet6-6.0.108/sdk/6.0.108/

global.json file:
  Not found

Host:
  Version:      6.0.8
  Architecture: x64
  Commit:       55fb7ef977

.NET SDKs installed:
  6.0.108 [/usr/lib/dotnet/dotnet6-6.0.108/sdk]

.NET runtimes installed:
  Microsoft.AspNetCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.AspNetCore.App]
  Microsoft.NETCore.App 6.0.8 [/usr/lib/dotnet/dotnet6-6.0.108/shared/Microsoft.NETCore.App]

Download .NET:
  https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
  https://aka.ms/dotnet/runtimes-sdk-info

@directhex directhex added packaging Related to packaging needs-author-action An issue or pull request that requires more info or actions from the author. labels Aug 16, 2022
@ghost
Copy link

ghost commented Aug 16, 2022

This issue has been marked needs-author-action and may be missing some important information.

@LakshanF LakshanF removed the untriaged New issue has not been triaged by the area owner label Aug 16, 2022
@LakshanF
Copy link
Member

The issue seems to be resolved now

@roger-oliver
Copy link

roger-oliver commented Aug 17, 2022

I'd like to add my experience today. Yeah, I've had the exact problem and solved removing dotnet and reinstalling using the "scripted install". No other installation process worked (all I tried, seems to install - quite quick - but no SDK)

sudo apt remove 'dotnet*' --purge
and I've followed the scripted install [https://docs.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install]

After that, dotnet started to work.

Unfortunatelly, after turn off the computer and turn on again next day, SDK was out again.

Reseaching, I found this [ https://github.com/dotnet/sdk/issues/27129#issuecomment-1214358108 ] solution that worked perfectly. Don't know if it's the right solution, but makes sense.

@directhex directhex changed the title .NET 6 SDK not being recognized on popOS 22.04 Broken system with Ubuntu 22.04 where Microsoft packages are partially replaced by Canonical packages Aug 19, 2022
@directhex directhex reopened this Aug 19, 2022
@ghost ghost added the untriaged New issue has not been triaged by the area owner label Aug 19, 2022
@directhex
Copy link
Member

This is a duplicate of dotnet/core#7699 - that's the canonical reference on how to deal with the problems in question.

@ghost ghost removed the untriaged New issue has not been triaged by the area owner label Aug 19, 2022
@ghost ghost locked as resolved and limited conversation to collaborators Sep 19, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-Host needs-author-action An issue or pull request that requires more info or actions from the author. packaging Related to packaging
Projects
None yet
Development

No branches or pull requests

6 participants