Upgrade 18.04 LTS to 20.04 LTS  [SOLVED]

Discussions about the usage of KeyHelp.
Post Reply
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Upgrade 18.04 LTS to 20.04 LTS

Post by lmarcos »

Hi,

I'm trying to upgrade the Ubuntu on my server and I'm stuck after the first server reboot.

This is what I'm getting.

Code: Select all

Calculating upgrade...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
Reading package lists...
Building dependency tree...
Reading state information...
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
 Error  At least one of the following commands returned an error.
To avoid system damage, please run the commands yourself and fix any problems that occur.
---
apt-get update ;
apt-get upgrade ;
apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade ;
---
Fix the issues above, then launch this script again: "php keyhelp_ubuntu_upgrade_18_to_20.php"
I run the commands and then get

Code: Select all

Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
And when I run php keyhelp_ubuntu_upgrade_18_to_20.php it loops back to the first error.

Any ideas how to finish the update?

Thanks in advance.
User avatar
Jolinar
Community Moderator
Posts: 3559
Joined: Sat 30. Jan 2016, 07:11
Location: Weimar (Thüringen)
Contact:

Re: Upgrade 18.04 LTS to 20.04 LTS

Post by Jolinar »

Did you use the KeyHelp upgrade script? ->
https://www.keyhelp.de/en/news/upgrade- ... ubuntu-20/
Wenn jemand inkompetent ist, dann kann er nicht wissen, daß er inkompetent ist. (David Dunning)

Data Collector für Community Support
___
Ich verwende zwei verschiedene Schriftfarben in meinen Beiträgen /
I use two different font colors in my posts:
  • In dieser Farbe schreibe ich als Moderator und gebe moderative Hinweise oder begründe moderative Eingriffe /
    In this color, I write as a moderator and provide moderative guidance or justify moderative interventions
  • In dieser Farbe schreibe ich als Community Mitglied und teile meine private Meinung und persönlichen Ansichten mit /
    In this color, I write as a community member and share my personal opinions and views
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: Upgrade 18.04 LTS to 20.04 LTS

Post by lmarcos »

Yes. The script is run by this one command php keyhelp_ubuntu_upgrade_18_to_20.php
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Upgrade 18.04 LTS to 20.04 LTS

Post by Alexander »

One of those mentioned commands returned a non-successful exit code.

Check each command and see the exit code with the following commands:

Code: Select all

apt-get update ; echo $?

Code: Select all

apt-get upgrade ; echo $?

Code: Select all

apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" dist-upgrade ; echo $?
Exit code should be "0" in every case. If this is true, you can start the upgrade script again. Otherwise you have to fix the cause of this issue.
If there is an issue this would be an issue of the operating system and out of the scope of KeyHelp or the upgrade script.
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: Upgrade 18.04 LTS to 20.04 LTS

Post by lmarcos »

Thanks, Alexander. The upgrade run apparently with exit code 1, not asking for a reboot, but the the reboot was requested in the dashboard, which now shows Ubuntu 20.04.

Afterwards, as per the instructions, I run
~# phpenmod ioncube
root@osapolar:~# php keyhelp_ubuntu_upgrade_18_to_20.php
> Installing requirements...
E: Sub-process /usr/bin/dpkg returned an error code (1)
Error Failed to install php7.4-mysql. Please fix your apt-get.

Before I purge the package and try to install it again I wanted to check it would be ok.
Right now, this is what's shown on apt-cache
php-mysql - MySQL module for PHP [default]
php7.4-mysql - MySQL module for PHP
php7.2-mysql - MySQL module for PHP

By the way,r unning apt-get update only returns 4 hits/Ubuntu repositories.
lmarcos
Posts: 78
Joined: Sun 26. Jan 2020, 12:55

Re: Upgrade 18.04 LTS to 20.04 LTS

Post by lmarcos »

Not sure what happened, but I tested today again to see if I got the same error message, and it finally asked me to reboot the server.
The server reports that a reboot is required to install pending updates.
Please reboot your server first, then start this script again: "php keyhelp_ubuntu_upgrade_18_to_20.php"
And then, when I run apt upgrade previous to going ahead with the upgrade to 22.04 LTS I get

Code: Select all

~# apt-get upgrade ; echo $?
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n] y
Setting up spamassassin (3.4.4-1ubuntu1.1) ...
gpg: WARNING: unsafe ownership on homedir '/var/lib/spamassassin/sa-update-keys'
gpg: failed to create temporary file '/var/lib/spamassassin/sa-update-keys/.#lk0x0000556bdc44d7f0.domain.domain.es.3541': Permission denied
gpg: keyblock resource '/var/lib/spamassassin/sa-update-keys/pubring.kbx': Permission denied
gpg: no writable keyring found: Not found
gpg: error reading '/usr/share/spamassassin/GPG.KEY': General error
gpg: import from '/usr/share/spamassassin/GPG.KEY' failed: General error
gpg: process '/usr/bin/gpg --homedir='/var/lib/spamassassin/sa-update-keys' --batch --no-tty --status-fd=1 -q --logger-fd=1 --import' finished: exit 2
dpkg: error processing package spamassassin (--configure):
 installed spamassassin package post-installation script subprocess returned error exit status 2
Errors were encountered while processing:
 spamassassin
E: Sub-process /usr/bin/dpkg returned an error code (1)
100
I checked and the owner of the folder is root. Shouldn't it be debian-spamd in all the folders?

Code: Select all

~# ll  /var/lib/spamassassin/
total 16
drwxr-xr-x  4 debian-spamd debian-spamd 4096 Feb  6  2020 ./
drwxr-xr-x 51 root         root         4096 Feb  6 20:02 ../
drwx------  3 root         root         4096 Feb  6  2020 .gnupg/
drwx------  3 root         root         4096 Apr  3  2021 sa-update-keys/
User avatar
Alexander
Keyweb AG
Posts: 3810
Joined: Wed 20. Jan 2016, 02:23

Re: Upgrade 18.04 LTS to 20.04 LTS  [SOLVED]

Post by Alexander »

All my test systems show the following, no matter if Debian or Ubuntu, so you want to update the ownership accordingly.

Code: Select all

# ls -la /var/lib/spamassassin/
total 20
drwxr-xr-x  5 debian-spamd debian-spamd 4096 Jan 24 13:57 .
drwxr-xr-x 58 root         root         4096 Jan 24 14:00 ..
drwxr-xr-x  3 debian-spamd debian-spamd 4096 Jan 24 13:57 compiled
drwx------  3 debian-spamd debian-spamd 4096 Jan 24 14:01 sa-update-keys
drwx------  3 debian-spamd debian-spamd 4096 Jan 24 13:56 .spamassassin
Mit freundlichen Grüßen / Best regards
Alexander Mahr

**************************************************************
Keyweb AG - Die Hosting Marke
Neuwerkstr. 45/46, 99084 Erfurt / Germany
http://www.keyweb.de - http://www.keyhelp.de
**************************************************************
Post Reply