Error Installing .NET Core 2.1 on Ubuntu 18.04.1 Server – Unmet dependencies

I recently tried to install .NET Core 2.1 on Ubuntu 18.04.1 using the Microsoft download page instructions.

image

Unfortunately I hit the following error:

The following information may help to resolve the situation:

The following packages have unmet dependencies:
  dotnet-sdk-2.1 : Depends: dotnet-runtime-2.1 (>= 2.1.2) but it is not going to be installed
                   Depends: aspnetcore-runtime-2.1 (>= 2.1.2) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

After researching for a little while I found a Github issue describing the issue and fix.  Apparently the Server version of Ubuntu doesn’t have all the package .NET Core expects so you also have to add the Universe repository using the following command:

sudo add-apt-repository universe

Many thanks to JerryBian, leecow and others on Github for posting and finding a workaround to the issue.

Cheers!

Leave a Reply