1

I`m in deep trouble with my Ubuntu 13.04. Ubuntu stopped support of 13.04 so I added wheezy repository to sources.list then upgraded my system. After then I can neither install any package nor upgrade my system. I tried lots of things like

apt-get install -f

with no luck. I open my comp through live USB and chroot to broken system.

I keep getting following long error message when I try to install a package

  The following extra packages will be installed:   util-linux
Suggested packages:   util-linux-locales kbd console-tools The
following NEW packages will be installed:   util-linux 0 upgraded, 1
newly installed, 0 to remove and 0 not upgraded. 10 not fully
installed or removed. Need to get 0 B/618 kB of archives. After this
operation, 1,590 kB of additional disk space will be used. Do you
want to continue [Y/n]?  Preconfiguring packages ... (Reading
database ... 588796 files and directories currently installed.)
Unpacking util-linux (from
.../util-linux_2.20.1-5.1ubuntu8.1_i386.deb) ... initctl: Unknown
job: K02screen-cleanup insserv: warning: script 'K02screen-cleanup'
missing LSB tags and overrides insserv: warning: script
'K02acpi-support' missing LSB tags and overrides initctl: Unknown
job: K02screen-cleanup initctl: Unknown job: S02screen-cleanup
insserv: Script martian is broken: incomplete LSB comment. insserv:
missing `Required-Start:' entry: please add even if empty. insserv:
missing `Required-Stop:'  entry: please add even if empty. insserv:
missing `Default-Stop:'   entry: please add even if empty. initctl:
Unknown job: S02screen-cleanup insserv: Script martian is broken:
incomplete LSB comment. insserv: missing `Required-Start:' entry:
please add even if empty. insserv: missing `Required-Stop:'  entry:
please add even if empty. insserv: missing `Default-Stop:'   entry:
please add even if empty. initctl: Unknown job: S02screen-cleanup
insserv: Script martian is broken: incomplete LSB comment. insserv:
missing `Required-Start:' entry: please add even if empty. insserv:
missing `Required-Stop:'  entry: please add even if empty. insserv:
missing `Default-Stop:'   entry: please add even if empty. initctl:
Unknown job: S02screen-cleanup insserv: Script martian is broken:
incomplete LSB comment. insserv: missing `Required-Start:' entry:
please add even if empty. insserv: missing `Required-Stop:'  entry:
please add even if empty. insserv: missing `Default-Stop:'   entry:
please add even if empty. initctl: Unknown job: K02screen-cleanup
initctl: Unknown job: S02procps insserv: warning: script 'S02procps'
missing LSB tags and overrides initctl: Unknown job: S01udev
insserv: warning: script 'S01udev' missing LSB tags and overrides
insserv: Script martian is broken: incomplete LSB comment. insserv:
missing `Required-Start:' entry: please add even if empty. insserv:
missing `Required-Stop:'  entry: please add even if empty. insserv:
missing `Default-Stop:'   entry: please add even if empty. insserv:
Default-Stop  undefined, assuming empty stop  runlevel(s) for script
`martian' insserv: warning: script 'network-interface-security'
missing LSB tags and overrides insserv: Default-Start undefined,
assuming empty start runlevel(s) for script
`network-interface-security' insserv: Default-Stop  undefined,
assuming empty stop  runlevel(s) for script
`network-interface-security' insserv: warning: script
'plymouth-splash' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`plymouth-splash' insserv: Default-Stop  undefined, assuming empty
stop  runlevel(s) for script `plymouth-splash' insserv: warning:
script 'plymouth' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`plymouth' insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script `plymouth' insserv: warning: script
'plymouth-ready' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`plymouth-ready' insserv: Default-Stop  undefined, assuming empty
stop  runlevel(s) for script `plymouth-ready' insserv: warning:
script 'screen-cleanup' missing LSB tags and overrides insserv:
warning: script 'squid3' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`squid3' insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script `squid3' insserv: warning: script
'networking' missing LSB tags and overrides insserv: Default-Start
undefined, assuming empty start runlevel(s) for script `networking'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s)
for script `networking' insserv: warning: script
'udev-fallback-graphics' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`udev-fallback-graphics' insserv: Default-Stop  undefined, assuming
empty stop  runlevel(s) for script `udev-fallback-graphics' insserv:
warning: script 'network-interface' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s)
for script `network-interface' insserv: Default-Stop  undefined,
assuming empty stop  runlevel(s) for script `network-interface'
insserv: warning: script 'plymouth-log' missing LSB tags and
overrides insserv: Default-Start undefined, assuming empty start
runlevel(s) for script `plymouth-log' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
`plymouth-log' insserv: warning: script 'udevtrigger' missing LSB
tags and overrides insserv: Default-Start undefined, assuming empty
start runlevel(s) for script `udevtrigger' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script `udevtrigger'
insserv: warning: script 'nagios' missing LSB tags and overrides
insserv: warning: script 'rsyslog' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s)
for script `rsyslog' insserv: Default-Stop  undefined, assuming
empty stop  runlevel(s) for script `rsyslog' insserv: warning:
script 'kmod' missing LSB tags and overrides insserv: Default-Start
undefined, assuming empty start runlevel(s) for script `kmod'
insserv: Default-Stop  undefined, assuming empty stop  runlevel(s)
for script `kmod' insserv: warning: script 'procps' missing LSB tags
and overrides insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script `procps' insserv: warning: script 'mongodb'
missing LSB tags and overrides insserv: Default-Start undefined,
assuming empty start runlevel(s) for script `mongodb' insserv:
Default-Stop  undefined, assuming empty stop  runlevel(s) for script
`mongodb' insserv: warning: script 'avahi-daemon' missing LSB tags
and overrides insserv: Default-Start undefined, assuming empty start
runlevel(s) for script `avahi-daemon' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
`avahi-daemon' insserv: warning: script 'plymouth-stop' missing LSB
tags and overrides insserv: Default-Start undefined, assuming empty
start runlevel(s) for script `plymouth-stop' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
`plymouth-stop' insserv: warning: script 'udev' missing LSB tags and
overrides insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script `udev' insserv: warning: script
'acpi-support' missing LSB tags and overrides insserv: warning:
script 'udev-finish' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`udev-finish' insserv: Default-Stop  undefined, assuming empty stop 
runlevel(s) for script `udev-finish' insserv: warning: script
'network-interface-container' missing LSB tags and overrides
insserv: Default-Start undefined, assuming empty start runlevel(s)
for script `network-interface-container' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script
`network-interface-container' insserv: warning: script
'plymouth-upstart-bridge' missing LSB tags and overrides insserv:
Default-Start undefined, assuming empty start runlevel(s) for script
`plymouth-upstart-bridge' insserv: Default-Stop  undefined, assuming
empty stop  runlevel(s) for script `plymouth-upstart-bridge'
insserv: warning: script 'udevmonitor' missing LSB tags and
overrides insserv: Default-Start undefined, assuming empty start
runlevel(s) for script `udevmonitor' insserv: Default-Stop 
undefined, assuming empty stop  runlevel(s) for script `udevmonitor'
insserv: There is a loop between service tlp and nagios if stopped
insserv:  loop involving service nagios at depth 2 insserv:  loop
involving service tlp at depth 1 insserv: Stopping nagios depends on
tlp and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order! update-rc.d:
error: insserv rejected the script header dpkg: error processing
/var/cache/apt/archives/util-linux_2.20.1-5.1ubuntu8.1_i386.deb
(--unpack):  subprocess new pre-installation script returned error
exit status 1 Errors were encountered while processing: 
/var/cache/apt/archives/util-linux_2.20.1-5.1ubuntu8.1_i386.deb E:
Sub-process /usr/bin/dpkg returned an error code (1)

How can I recover my system?

dpkg --audit The following packages have been unpacked but not yet configured. They must be configured using dpkg --configure or the configure menu option in dselect for them to work: initramfs-tools tools for generating an initramfs module-init-tools transitional dummy package (module-init-tools to kmod) procps /proc file system utilities ifupdown high level tools to configure network interfaces mountall filesystem mounting tool kmod tools for managing Linux kernel modules plymouth graphical boot animation and logger - main package upstart event-based init daemon initscripts scripts for initializing and shutting down the system udev rule-based device node and kernel event manager

========================================================================

8
  • This is probably fixable, at least by an experienced person, but probably also not worth the effort. I recommend a reinstall. Commented Mar 15, 2014 at 14:43
  • @FaheemMitha I customized it to my preference, and I have lots of files in it.
    – kenn
    Commented Mar 15, 2014 at 14:50
  • I think you will find fixing your system more trouble than is it worth. Regardless, please post the output of dpkg --audit or equivalently dpkg -C so we can assess the damage. Post in the question, not as a comment or on a third party site, please. You could also run apt-show-versions which will show what packages are installed from which sources. Commented Mar 15, 2014 at 14:53
  • It appears to be a bug forums.debian.net/viewtopic.php?f=30&t=53192
    – kenn
    Commented Mar 15, 2014 at 14:55
  • 1
    No, it is because you are mixing sources from two different operating systems. These sources were never designed to be mixed. Commented Mar 15, 2014 at 14:58

1 Answer 1

3

After hours of struggling I recovered my OS. I opened my comp through live USB then from terminal I run

sudo blkid

to check partition number of my installation, it's in sda6

sudo mount /dev/sda6 /mnt

sudo mount --bind /dev /mnt/dev && sudo mount --bind /dev/pts /mnt/dev/pts && sudo mount --bind /proc /mnt/proc && sudo mount --bind /sys /mnt/sys

sudo chroot /mnt

at first I run

apt-get clean 

to clean cache

apt-get update

Since last upgrade borked my system I tried

dpkg --configure -a && apt-get -f install

but didn't work due to insserv error as I posted in my question. I found the cause of the error. I navigated to /etc/init.d and checked out every script there if they have LSB keyword section because the cause of the error was missing LSB keyword section like

 #!/bin/sh

 ### BEGIN INIT INFO
 # Provides:          
 # Required-Start:    
 # Required-Stop:
 # Should-Start:
 # Default-Start:    
 # Default-Stop:
 # Short-Description: PowerPanel to monitor CyberPower UPS
 ### END INIT INFO

Old scripts didn't have that section, after I added that section to old scripts and run

 dpkg --configure -a

I got rid of that damn error.

Later I grabbed the upgraded and removed packages list with

 cat /var/log/dpkg.log |grep remove| awk ' { print $4 } ' | awk -F ':' ' { print $1 } ' | tr '\n' ' '  >listrem

 cat /var/log/dpkg.log |grep upgrade| awk ' { print $4 } ' | awk -F ':' ' { print $1 } ' | tr '\n' ' '  >listupgr

finally I installed removed packages with

apt-get install $(grep -vE "^\s*#" listrem)

and reinstalled upgraded packages with

apt-get install --reinstall $(grep -vE "^\s*#" listupgr)

When I reboot

"Yes, my cute, lovely desktop is back!"

7
  • Well done. I looked and this earlier and thought you were screwed. I think Ubuntu is more permissive than Debian about missing LSB tags (or is it the other way round?), which is probably the root of your problem.
    – Graeme
    Commented Mar 15, 2014 at 21:58
  • @Graeme Thank you. I was really desperate due to my previous experiences. I lost many ideal distros of mine in the past because I didn't know how to recover it. I'm glad that I overcame it this time
    – kenn
    Commented Mar 15, 2014 at 22:08
  • You are playing a dangerous game mixing Ubuntu and Debian like that, I would expect more issues. Generally it would have been much more advisable to upgrade to another Ubuntu release. If you have came this far though...
    – Graeme
    Commented Mar 15, 2014 at 22:24
  • You're going to run into this kind of trouble again as you install more software. At this stage I strongly recommend reinstalling. Between Ubuntu and Debian, pick one. Use etckeeper to keep a history of your customizations in /etc. Commented Mar 15, 2014 at 23:41
  • @Graeme I removed debian repo during recovery. It's pity that Linux based OSs lack system recovery tools and restore points. It should not be that hard.
    – kenn
    Commented Mar 16, 2014 at 11:21

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .