Today we upgraded our Linux based web frontend from .NET Core 3.1 to .NET 5 and here are step by step instructions what we did.

First we uninstalled old .NET Core versions because they are not needed anymore. We identified .NET related packages with following commands:

  • sudo apt –installed list | grep “dotnet”
  • sudo apt –installed list | grep “asp”

Then we uninstalled old packages with:

sudo apt-get remove --purge PACKAGE_NAME

We ensured Microsoft repositiories are setup:

wget -O - https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.asc.gpg
sudo mv microsoft.asc.gpg /etc/apt/trusted.gpg.d/
wget https://packages.microsoft.com/config/debian/9/prod.list
sudo mv prod.list /etc/apt/sources.list.d/microsoft-prod.list
sudo chown root:root /etc/apt/trusted.gpg.d/microsoft.asc.gpg
sudo chown root:root /etc/apt/sources.list.d/microsoft-prod.list

and continued with .NET 5 runtime installation:

sudo apt-get update; \
  sudo apt-get install -y apt-transport-https && \
  sudo apt-get update && \
  sudo apt-get install -y aspnetcore-runtime-5.0

Web deployment package for our web application was prepared with following publish settings:

Everything went smoothly and whole process took just few minutes. Since our web application is load balanced our users didn’t notice anything :) Hooray!

We wish you happy new year (without downtime)! Happy monitoring!