Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save charllysonsouza/3027d2129da74b950247417f5ece509b to your computer and use it in GitHub Desktop.
Save charllysonsouza/3027d2129da74b950247417f5ece509b to your computer and use it in GitHub Desktop.
How to install dotnetcore 3.1 on Ubuntu 22.04
When you run the following command `sudo apt-get install dotnet-sdk-3.1` on the terminal you may see the following message:
```
sudo apt-get install dotnet-sdk-3.1
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:
The following packages have unmet dependencies.
dotnet-sdk-3.1 : Depends: dotnet-targeting-pack-3.1 (>= 3.1.0) but it is not installable
Depends: aspnetcore-targeting-pack-3.1 (>= 3.1.10) but it is not installable
E: Unable to correct problems, you have held broken packages
```
To solve this you need to install these dependencies:
1. Install dependency libssl1.1 with this commands:
wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.0g-2ubuntu4_amd64.deb
sudo dpkg -i libssl1.1_1.1.0g-2ubuntu4_amd64.deb
2. Download dotnet-targeting-pack-3.1 from microsoft repository: https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/d/dotnet-targeting-pack-3.1/dotnet-targeting-pack-3.1.0-x64.deb
2.1 Enter the following command on terminal: sudo dpkg -i dotnet-targeting-pack-3.1.0-x64.deb
3. Download aspnetcore-targeting-pack-3.1: https://packages.microsoft.com/ubuntu/20.04/prod/pool/main/a/aspnetcore-targeting-pack-3.1/aspnetcore-targeting-pack-3.1.10.deb
3.1 2.1 Enter the following command on terminal: sudo dpkg -i aspnetcore-targeting-pack-3.1.10.deb
4. Finally, enter the command to install the sdk: sudo apt-get install dotnet-sdk-3.1
You should propably have sucess!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment