3

After I made a system upgrade (apt-get upgrade) on a debian box, I get an error everytime i tries to use apt-get. Example:

# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Setting up initscripts (2.88dsf-41+deb7u1) ...
insserv: Service killprocs has to be enabled to start service single
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing initscripts (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 initscripts
E: Sub-process /usr/bin/dpkg returned an error code (1)

I have tried to find a solution, but can't find anything that looks like this. First of all I have this packet which is "not fully installed or removed". But I can't find the command to locate it. Have tried:

dpkg -l | grep rc

But it list about 20 packets, so there must be a better way to find this packet.

To fix the packet system I have tried normal procedures, like:

apt-get clean && sudo apt-get autoremove 
apt-get -f install
dpkg --configure -a

The clean command is good, but the install command will fail with as shown above.

In a desperate try, I tried to reinstall insserv (not sure it's the packet which is broken), but it fails the same way:

# apt-get install --reinstall insserv
Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 8 not upgraded.
1 not fully installed or removed.
Need to get 63.8 kB of archives.
After this operation, 0 B of additional disk space will be used.
Get:1 http://ftp.us.debian.org/debian/ wheezy/main insserv armel 1.14.0-5 [63.8 kB]
Fetched 63.8 kB in 0s (85.5 kB/s)
Setting up initscripts (2.88dsf-41+deb7u1) ...
insserv: Service killprocs has to be enabled to start service single
insserv: exiting now!
update-rc.d: error: insserv rejected the script header
dpkg: error processing initscripts (--configure):
 subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
 initscripts
E: Sub-process /usr/bin/dpkg returned an error code (1)
Rui F Ribeiro
  • 56,709
  • 26
  • 150
  • 232
user2910256
  • 43
  • 1
  • 1
  • 5
  • Did you do something to /etc/init.d/killprocs? What is the history here? – derobert Oct 23 '13 at 10:50
  • insserv is the package which is not fully installed or removed. dpkg -l | grep rc will list something different: all packages which have been removed (r) but for which the configuration (c) has not been purged. – scai Oct 23 '13 at 08:26
  • No, not directly. Could it be some of the scripts have removed it? Because it doesn't exist on my disk right now. – user2910256 Oct 23 '13 at 11:11
  • 2
    Hmmm... Something has removed it, which is what's causing your immediate problem. Unfortunately, just reinstalling the package won't bring it back, since its a configuration file. You could get it out of the initscripts package using dpkg-deb -x initscripts….deb /tmp/path and then copy it back... – derobert Oct 23 '13 at 11:18

3 Answers3

3

/etc/rc1.d/S01killprocs -> ../init.d/killprocs is missing, obviously, it is in initscripts

but insserv requires it. chkrequired

Maybe you can install it manually extracting the .deb in some other directory and then copying it to the right place.

dpkg -x /var/cache/apt/archives/initscripts_2.88dsf-41_i386.deb /tmp/somedir

2.88dsf-41_i386 is my version, use yours :-)

edit

if you get it working manually then re-install it as usual.

bahamat
  • 39,666
  • 4
  • 75
  • 104
Alex
  • 2,586
  • 4
  • 22
  • 30
0

I was able to fix this issue on ubuntu 16.04 by removing all cached .deb files from /var/cache/apt/archives then ran this command:

apt-get clean && sudo apt-get autoremove

I hope this fix problems for someone.

Nidal
  • 8,956
ROOT
  • 101
  • 2
0

The following command fixed my similar upgrading woes:

dpkg -i /var/cache/apt/archives/initscripts_2.88dsf-59.3ubuntu2_i386.deb

I was upgrading from Ubuntu 14.04 (!) to the next LTS with do-release-upgrade and was stuck with this error:

update-rc.d: error: insserv rejected the script header
dpkg: error processing package util-linux (--configure):
  subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
  util-linux

and dpkg-reconfigure util-linux gave me

/usr/sbin/dpkg-reconfigure: initscripts is broken or not fully installed

Even apt-get install --reinstall initscripts produced:

E: Internal Error, No file name for initscripts:i386

The dpkg (above) worked though, and allowed the upgrade to continue. Hope this helps someone.

Daniel
  • 33