How to uninstall dotnet from Ubuntu 20.10 completely?
14,629
Solution 1
Run these commands:
sudo apt remove --purge dotnet-sdk-5.0.101
sudo apt remove --purge dotnet-runtime-5.0.101
Solution 2
For the situation where dotnet
has been installed using snap
, you can do the following:
-
You need to list the names of the snap packages by going to the
/snap
directory. For example, on Ubuntu 21, mydotnet
installations are shown in the following script.$ cd /snap $ ls ... dotnet-sdk dotnet-runtime-60 ...
-
Then you can use the following commands to remove the snaps.
sudo snap remove dotnet-sdk sudo snap remove dotnet-runtime-60
This was based on the answer for snap packages here: How to list files installed by a snap package?
Solution 3
Try with major and minor version only:
sudo apt remove --purge dotnet-sdk-6.0
sudo apt remove --purge dotnet-runtime-6.0
Related videos on Youtube
Author by
Gaurav
Updated on September 18, 2022Comments
-
Gaurav almost 2 years
I have installed dotnet on my Ubuntu 20.10 but for some reason I want to remove it but I don't know how to do it please help.
-
madan over 2 yearsnot working for me sudo dotnet --list-sdks 6.0.101 [/snap/dotnet-sdk/152/sdk] sudo apt remove --purge dotnet-sdk-6.0.101 Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package dotnet-sdk-6.0.101 E: Couldn't find any package by glob 'dotnet-sdk-6.0.101'
-
ChanganAuto over 2 yearsFYI askubuntu.com/a/1388621/1210606 is the correct answer because this comment from am year ago askubuntu.com/questions/1305271/… showed it was a snap.
-
kol over 2 yearsThis worked for me!
sudo apt purge dotnet-sdk-6.0
-
kol over 2 years@madan Try with "major.minor", like
sudo apt purge dotnet-sdk-6.0
-
madan over 2 yearsthanks kol, i am afraid i do not currently have this issue so can't try the solution