Page 1 of 1
Upgrade 18.04 LTS to 20.04 LTS
Posted: Sun 5. Feb 2023, 15:29
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.
Re: Upgrade 18.04 LTS to 20.04 LTS
Posted: Sun 5. Feb 2023, 16:18
by Jolinar
Re: Upgrade 18.04 LTS to 20.04 LTS
Posted: Sun 5. Feb 2023, 16:34
by lmarcos
Yes. The script is run by this one command php keyhelp_ubuntu_upgrade_18_to_20.php
Re: Upgrade 18.04 LTS to 20.04 LTS
Posted: Mon 6. Feb 2023, 10:01
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 -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.
Re: Upgrade 18.04 LTS to 20.04 LTS
Posted: Mon 6. Feb 2023, 20:49
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.
Re: Upgrade 18.04 LTS to 20.04 LTS
Posted: Tue 7. Feb 2023, 20:27
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/
Re: Upgrade 18.04 LTS to 20.04 LTS [SOLVED]
Posted: Wed 8. Feb 2023, 08:27
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