How to Uninstall .Net Framework on Linux?

posted by Farhan Mirajkar on February 24, 2024

With the advent of .NET Core, the world of software development has witnessed significant improvements in Linux support. Whether you’re working with .NET Core or the newer versions like .NET 5, 6, or 7, running it on Linux has become more accessible than ever before. And if you ever find the need to uninstall .NET Core from your Linux system, worry not, as it can be done effortlessly using the package manager specific to your Linux distribution.

One of the remarkable aspects of .NET Core and its subsequent versions is how they have bridged the gap between different operating systems. Linux, which was once considered primarily for open-source software development, has now become a viable choice for .NET developers as well. The enhanced Linux support offered by .NET Core has opened up a world of possibilities and flexibility.

Uninstalling .NET Core from your Linux system is a straightforward process. The package manager of your Linux distribution comes to the rescue, facilitating a seamless removal experience. The package manager acts as a central hub for managing software installations, updates, and removals, ensuring that your system remains organized and clutter-free.

Here are the general steps for some common package managers:

For Ubuntu/Debian-based systems:


sudo apt remove --purge dotnet-runtime-3.1 sudo apt remove --purge dotnet-sdk-3.1

Replace 3.1 with the version you want to uninstall.

For CentOS/RHEL-based systems:


sudo yum remove dotnet-runtime-3.1 sudo yum remove dotnet-sdk-3.1

For Fedora:


sudo dnf remove dotnet-runtime-3.1 sudo dnf remove dotnet-sdk-3.1

Replace 3.1 with the version you want to uninstall.

If you installed .NET from the official Microsoft repository, you might need to remove the repository configuration as well.
After removing the packages, you can check if the .NET runtime and SDK are completely removed by running:


dotnet --version

If the command still shows a version, it means that .NET is still installed.
Please note that the specific commands might differ based on the Linux distribution and the version of .NET you have installed. Always refer to the official documentation or help specific to your distribution for accurate information. 

Leave a Reply

Your email address will not be published. Required fields are marked *