Created
November 26, 2023 09:51
-
-
Save stesee/85c72f356bc7a36488622c5911cc72ae to your computer and use it in GitHub Desktop.
Get .net 8 @ ubuntu 22.04
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu#register-the-microsoft-package-repository | |
# https://learn.microsoft.com/en-us/dotnet/core/install/linux-ubuntu-2204 | |
# https://stackoverflow.com/questions/73312785/dotnet-sdk-is-installed-but-not-recognized-linux-ubuntu-popos-22-04/73394298#73394298 | |
# drops old dependencies and repos | |
sudo snap remove dotnet-sdk | |
sudo apt remove 'dotnet*' | |
sudo apt remove 'aspnetcore*' | |
sudo apt remove 'netstandard*' | |
sudo apt autoremove -y | |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list | |
sudo rm /etc/apt/sources.list.d/microsoft-prod.list.save | |
# Get Ubuntu version | |
declare repo_version=$(if command -v lsb_release &> /dev/null; then lsb_release -r -s; else grep -oP '(?<=^VERSION_ID=).+' /etc/os-release | tr -d '"'; fi) | |
# Download Microsoft signing key and repository | |
wget https://packages.microsoft.com/config/ubuntu/$repo_version/packages-microsoft-prod.deb -O packages-microsoft-prod.deb | |
# Install Microsoft signing key and repository | |
sudo dpkg -i packages-microsoft-prod.deb | |
# Clean up | |
rm packages-microsoft-prod.deb | |
# Update packages | |
sudo apt update | |
# get .net 8 | |
sudo apt-get install -y dotnet-sdk-8.0 |
@Shadowblitz16 Your code seems to depend on .net7. migrate or install .net7.
@stesee I fixed it by uninstalling all dotnet packages and reinstalling dotnet-sdk-8.0
I am curious. By which measure have you uninstalled all dotnet backages? I thought that the script already does uninstall all dotnet packages
I don't know I just used apt to uninstall and reinstall it and it worked
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is just broke my sdk, now it can't find dotnet.