Warm tip: This article is reproduced from serverfault.com, please click

unable to run apt-get -f install on debian

发布于 2022-01-21 01:23:44

I have a system that is due to be upgraded but I'm having conflicts with apt-get -f install:

 apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
  login sysvinit-utils util-linux
Suggested packages:
  kbd util-linux-locales
The following packages will be upgraded:
  login sysvinit-utils util-linux
3 upgraded, 0 newly installed, 0 to remove and 106 not upgraded.
13 not fully installed or removed.
Need to get 0 B/1775 kB of archives.
After this operation, 1886 kB of additional disk space will be used.
Do you want to continue? [Y/n] 
E: Sub-process false returned an error code (1)
E: Prior errors apply to /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb
E: Prior errors apply to /var/cache/apt/archives/util-linux_2.36.1-8_arm64.deb
E: Prior errors apply to /var/cache/apt/archives/login_1%3a4.8.1-1_arm64.deb
debconf: apt-extracttemplates failed: No such file or directory
(Reading database ... 9765 files and directories currently installed.)
Preparing to unpack .../sysvinit-utils_2.96-7_arm64.deb ...
Unpacking sysvinit-utils (2.96-7) over (2.88dsf-59) ...
dpkg: error processing archive /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb (--unpack):
 trying to overwrite '/lib/init/vars.sh', which is also in package initscripts 2.88dsf-59
Errors were encountered while processing:
 /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I don't understand why it says E: Sub-process false returned an error code (1) after I confirm installation of the packages. Can anyone help me with this?

Questioner
stdcerr
Viewed
0
karel 2022-01-21 13:59:13

initscripts is a purely virtual package, so it is safe to give dpkg permission to overwrite it. Open the terminal and type:

sudo dpkg -i --force-overwrite /var/cache/apt/archives/sysvinit-utils_2.96-7_arm64.deb

If you're not using dpkg directly and using an apt front-end like apt or apt-get, the following command defines the same custom dpkg option to use as the previous command.

sudo apt-get -o Dpkg::Options::="--force-overwrite" install sysvinit-utils