7

I was attempting to upgrade from debian 9 to 10 but the installation failed when attempting to install systemd-sysv_241-7~deb10u6_amd64.deb. I get the following error:

My attempts to run apt --fix-broken install have not been successful and lead to the same error below.

(Reading database ... 59371 files and directories currently installed.)
Preparing to unpack .../systemd-sysv_241-7~deb10u6_amd64.deb ...
Unpacking systemd-sysv (241-7~deb10u6) ...
dpkg: error processing archive /var/cache/apt/archives/systemd-sysv_241-7~deb10u6_amd64.deb (--install):
 trying to overwrite '/usr/share/man/man8/halt.8.gz', which is also in package sysvinit 2.88dsf-41+deb7u1
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 /var/cache/apt/archives/systemd-sysv_241-7~deb10u6_amd64.deb

In my attempts to isolate, I get the following when I run the failed command in verbose mode:

# dpkg --debug=77777 -i /var/cache/apt/archives/systemd-sysv_241-7~deb10u6_amd64.deb
...
D000040: ok 2 msgs >><<
D010000: check_triggers_cycle pnow=man-db:amd64
D020000: check_triggers_cycle pnow=man-db:amd64 first
Processing triggers for man-db (2.7.6.1-2) ...
D000002: fork/exec /var/lib/dpkg/info/man-db.postinst ( triggered /usr/share/man )
D000001: ensure_diversions: same, skipping
D020000: post_postinst_tasks - trig_incorporate
Errors were encountered while processing:
 /var/cache/apt/archives/systemd-sysv_241-7~deb10u6_amd64.deb

Unfortunately, this 'verbose' debugging is too terse for me and I am stuck mid-upgrade.

I tried running the man-db post install as follows:

sh -x /var/lib/dpkg/info/man-db.postinst configure 2.6.7.1-2

and it completed successfully without error so I am unsure what the error is to be able to try and fix.

I know that the installation scripts are located in ls /var/lib/dpkg/info, but I do not know which are related to this package.

Can anyone tell me where to get more detail to debug this more thoroughly and fix it?

2 Answers 2

12

I don't see how you could get more relevant information than you already have. The error message says:

trying to overwrite '/usr/share/man/man8/halt.8.gz', which is also in package sysvinit 2.88dsf-41+deb7u1

this is basically it: two packages want to install the same file, and debian forbids this (as a single file cannot have two different contents).

Since the file in question is only a manpage, there shouldn't be any real problem (as in: catastrophic problem that leads to an unbootable system), regardless which of the two packages "wins".

So I would personally just do a forced installation of the broken package:

# dpkg --force-overwrite -i /var/cache/apt/archives/systemd-sysv_241-7~deb10u6_amd64.deb

and after that restart the upgrade.

Please do note however, that the --force-*** options of dpkg are usually considered dangerous and you shouldn't just blindly force things by copying shell snippets from the internet without understanding the implications.

Debian upgrades

OTOH, Debian spends a lot of blood , sweat and tears into making systems smoothly upgradable between Debian releases (e.g. 9 to 10). So why does it not work for you?

You should use apt-get dist-upgrade to upgrade between major releases (as this relaxes the resolver and allows to upgrade more complicated situtations than a simple apt-get upgrade).

You should also make sure to remove cruft from older installations. E.g. your conflicting sysvinit package has a version number 2.88dsf-41+deb7u1 which indicates that it is from Debian 7. And indeed, there hasn't been a sysvinit package since Debian 8.

So you should first make sure that you actually run a Debian 9 system before you try to upgrade it to Debian 10.

4
  • Interesting answer, would synaptic be able to upgrade a Debian 9 install to Debian 10 after changing the all the sources (e.g. editing the sources.list through synaptic, then setting the preferred packages to buster) from stretch to buster in lieu of apt-get dist-upgrade ?
    – X.LINK
    Feb 14, 2021 at 20:48
  • 1
    X.LINK, I don't know whether synaptic would work but I would question why you would want to deviate from Debian's instructions in the release notes for upgrading from 9 to 10. That being generally apt upgrade followed by apt dist-upgrade. That's what they test, after all. OP's problem here was most likely caused by having a package from an older release still installed (stsvinit).
    – grifferz
    Feb 14, 2021 at 22:19
  • I may have left a landmine for myself as the machine was upgraded from 7 to 8 with a dist-upgrade some time ago and also had problems at that time. But, the system was working so I had no reason to search around. I actually solved by forcibly removing the sysvinit package that was still there and it worked.
    – Jason K.
    Feb 15, 2021 at 0:45
  • 3
    Removing the ancient and obsolete sysvinit package should sort everything, and is probably the only thing necessary to do. Feb 15, 2021 at 15:34
0

Use:

sudo dpkg -i --force-overwrite  /var/cache/apt/archives/systemd-sysv_241-7~deb10u6_amd64.deb

followed by:

sudo apt install -f

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.