How to remove previous versions of .NET Core from Linux (CentOS 7.1)

stevo picture stevo · Aug 24, 2016 · Viewed 27.6k times · Source

I would like to install the current version Core 1.0. Currently the RC2 version is installed. The instruction on the official website are:

Before you start, please remove any previous versions of .NET Core from your system.

But I don't know how and I can't find nothing from Microsoft like for example here.

I found this script... but my Linux skills are not great and I won't make it worst.

Answer

user6038265 picture user6038265 · Apr 5, 2017

You need to do this over the package manager, otherwise, you end up with a broken system.

This is for Ubuntu/Debian/Mint:

To list all installed packages

sudo apt --installed list

To list all the packages you installed

sudo apt --installed list | grep "dotnet-dev"

to remove a specific package

sudo apt-get remove --purge PACKAGE_NAME 

e.g.

sudo apt-get remove --purge dotnet-dev-1.0.1

For other distros, consult the Packman-Rosetta-Stone