question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing with `apt install dotnet-sdk-6.0` yields no executable file on Ubuntu 20.04

See original GitHub issue

Installing .NET SDK on Ubuntu 20.04 with the commands listed in the Install .NET on Ubuntu docs:

wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y dotnet-sdk-6.0

produces no dotnet executable.

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

sudo snap install dotnet-sdk

Listing files from the package:

dpkg -L dotnet-sdk-6.0 | grep -P "dotnet$"

gives

/usr/share/dotnet

The /usr/share/dotnet directory contains no executable. I compared this result with my other Ubuntu installation where I installed dotnet ages ago, and there it is installed in /usr/share/dotnet but there exists a /usr/share/dotnet/dotnet executable. It’s as if the current download via apt didn’t include any executables.

What am I doing wrong? How to install dotnet on Ubuntu with APT?

Using snap is not an option.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

4reactions
V0ldekcommented, Jan 10, 2022

That’s a good catch. dotnet-host is indeed installed in apt even though it doesn’t exist in /usr/share/dotnet. I did not run rm -rf /usr/share/dotnet, so I’m guessing something corrupted my /usr/share at some point, causing this issue. It’s kind of ridiculous that it happened on four different Ubuntus in exactly the same way, but I guess I always tried to keep them synchronised.

sudo apt reinstall dotnet-host and then sudo apt install dotnet-sdk-6.0 fixes the issue. Many thanks.

0reactions
dagoodcommented, Aug 15, 2022

@Moawyah-AbdulRahman, you’ve found an old, closed issue, which aren’t typically monitored for new comments. You should take a look at this, instead, since it appears you’re on Ubuntu 22.04:

Read more comments on GitHub >

github_iconTop Results From Across the Web

Installing .NET SDK on Ubuntu produces no executable ...
produces no dotnet executable. Command 'dotnet' not found, but can be installed with: sudo snap install dotnet-sdk. Listing files from the ...
Read more >
Installing .NET SDK on Ubuntu produces no executable ...
sudo apt reinstall dotnet-host and then sudo apt install dotnet-sdk-6.0 fixed the issue.
Read more >
.NET 6 is now in Ubuntu 22.04 - .NET Blog
NET 6 is now included in Ubuntu 22.04 (Jammy) and can be installed with just `apt install dotnet6`.
Read more >
Install .NET SDK or .NET Runtime on Ubuntu 20.04
Demonstrates the various ways to install .NET SDK and .NET Runtime on Ubuntu 20.04.
Read more >
Using Rider under Linux: prerequisites
Hi, I'm using Ubuntu 16.04 and I've installed Mono (5.2) and .NET (2.0). I created the sample shown here http://www.mono-project.com/docs/ ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found