Running do-release-upgrade resulted in the error "Please install all available updates for your release before upgrading"
Apparently, just apt upgrade is not enough, we have to do a dist-upgrade to upgrade the packages which have been "held back". https://itsfoss.com/apt-get-upgrade-vs-dist-upgrade/
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt autoremove
sudo do-release-upgrade
During the upgrade, it warned that the upgrade is being done over ssh, and that it is starting an ssh daemon on port 1022 also. But I didn't have to use that port or request PB to open that port in the AWS firewall. There were several warnings about configuration files existing, and the default was to not overwrite them - which is what I chose. The upgrade itself completed in ten minutes, and a reboot was uneventful except for an apache error.
service apache2 status
showed that the web server was down, an error in the conf file, php8.1 module not found. Now, I knew that 24.04 had php8.3 and not 8.1, so the error was understandable. I thought I would need to again follow the LAMP stack install - https://www.digitalocean.com/community/tutorials/how-to-install-lamp-stack-on-ubuntu - but no - just had to do
sudo a2dismod php8.1
sudo a2enmod php8.3
and
sudo systemctl restart apache2
The next issue was that the dot net service was not running. It was stuck in a restart loop. Disabled the service we had created as per this post - https://hnsws.blogspot.com/2023/05/dot-net-core-ubuntu-linux-server.html
Running the command to be executed on the command line
dotnet --version
Command 'dotnet' not found, but can be installed with:
sudo snap install dotnet-sdk # version 8.0.403, or
sudo apt install dotnet-host-8.0 # version 8.0.10-0ubuntu1~24.04.1
sudo apt install dotnet-host # version 6.0.135-0ubuntu1~22.04.1
sudo apt install dotnet-host-7.0 # version 7.0.119-0ubuntu1~22.04.1
Also, we had earlier pinned dot net to install from Microsoft's servers, but with Ubuntu 24, we're supposed to use Ubuntu's repositories. So, deleted the lines mentioned in this post,
sudo nano /etc/apt/preferences
Package: dotnet-* aspnetcore-* netstandard-*
Pin: origin "packages.microsoft.com"
Pin-Priority: 999
(deleted those lines)
sudo apt-get install -y aspnetcore-runtime-8.0
/usr/bin/dotnet /home/path/to/OurWebApi.dll
This gave the error
You must install or update .NET to run this application.
Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
Framework: 'Microsoft.NETCore.App', version '7.0.0' (x64)
.NET location: /usr/lib/dotnet/
The following frameworks were found:
8.0.10
and gave this URL for framework 7, https://dotnet.microsoft.com/en-us/download/dotnet/7.0/runtime?cid=getdotnetcore&arch=x64
which said framework 7 had reached end of life. So, requested the maintainers to target dot net 8.0 instead of 7.0, which they did in a few hours, after which I restarted the service, and the app was running again.
No comments:
Post a Comment