Hello,
I've just performed an upgrade of a ganeti cluster from buster+2.16 to
bullseye+3.0 and hit a problem during the upgrade.
The procedure that I used was to:
1. install ganeti 3.0 from buster-backports and upgrade the cluster
2. run OS upgrade from buster to bullseye (I had not removed ganeti 2.16)
During the upgrade to bullseye, ganeti was upgraded from the 3.0 backports
package to the same one from bullseye. At that point, dpkg stopped with an
error. Running "apt -f install" to fix the situation did not clear things up.
Running "apt purge ganeti-2.16 ganeti-haskell-2.16 ganeti-htools-2.16" was
jammed on a conflict of configuration files with 3.0:
# apt -f install
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
at-spi2-core bsdmainutils libapt-inst2.0 libevent-core-2.1-6
libevent-pthreads-2.1-6 libhogweed4 libnftables0 libprocps7 libreadline5
python3-asn1crypto python3.7 python3.7-minimal
Use 'apt autoremove' to remove them.
The following additional packages will be installed:
ganeti-3.0
The following packages will be upgraded:
ganeti-3.0
1 upgraded, 0 newly installed, 0 to remove and 497 not upgraded.
323 not fully installed or removed.
Need to get 0 B/876 kB of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue? [Y/n]
Reading changelogs... Done
Preconfiguring packages ...
(Reading database ... 64433 files and directories currently installed.)
Preparing to unpack .../ganeti-3.0_3.0.1-2_all.deb ...
Unpacking ganeti-3.0 (3.0.1-2) over (3.0.1-1~bpo10+1) ...
Removing 'diversion of /usr/share/ganeti/2.16/ganeti/utils/version.py to /usr/share/ganeti/2.16/ganeti/utils/version.py.orig by ganeti-3.0'
dpkg-divert: error: rename involves overwriting '/usr/share/ganeti/2.16/ganeti/utils/version.py' with
different file '/usr/share/ganeti/2.16/ganeti/utils/version.py.orig', not allowed
dpkg: warning: old ganeti-3.0 package post-removal script subprocess returned error
exit status 2
dpkg: trying script from the new package instead ...
Removing 'diversion of /usr/share/ganeti/2.16/ganeti/utils/version.py to /usr/share/ganeti/2.16/ganeti/utils/version.py.orig by ganeti-3.0'
dpkg-divert: error: rename involves overwriting '/usr/share/ganeti/2.16/ganeti/utils/version.py' with
different file '/usr/share/ganeti/2.16/ganeti/utils/version.py.orig', not allowed
dpkg: error processing archive /var/cache/apt/archives/ganeti-3.0_3.0.1-2_all.deb (--unpack):
new ganeti-3.0 package post-removal script subprocess returned error exit status 2
Removing 'diversion of /usr/share/ganeti/2.16/ganeti/utils/version.py to /usr/share/ganeti/2.16/ganeti/utils/version.py.orig by ganeti-3.0'
dpkg-divert: error: rename involves overwriting '/usr/share/ganeti/2.16/ganeti/utils/version.py' with
different file '/usr/share/ganeti/2.16/ganeti/utils/version.py.orig', not allowed
dpkg: error while cleaning up:
new ganeti-3.0 package post-removal script subprocess returned error exit status 2
Errors were encountered while processing:
/var/cache/apt/archives/ganeti-3.0_3.0.1-2_all.deb
needrestart is being skipped since dpkg has failed
E: Sub-process /usr/bin/dpkg returned an error code (1)
In order to get out of that situation, we had to modify the postrm script in
/var/lib/dpkg/info/ganeti-3.0.postrm to comment out the dpkg-diver --remove
command. That permitted the package to finish upgrading and the os upgrade to
complete. Once the upgrade was completed, I was able to purge ganeti 2.16 (and
I had to manually remove the diversion that was left behind)
I'm guessing this happened because the ganeti 2.16 packages were still in
place. But it was a situation quite difficult to work around of. I'm wondering
if something can be done to avoid this situation.