2

I am working VM which I haven't administered in the past and it is in a bad state (but I need to rescue it). I am not a linux expert but in the past 5 years I have been able to fix problems by using google. After a complete day yesterday I dunno what else to do then asking dumb questions by just stating my problem.

  • The system won't do a regular boot (I can however open a rescue root shell in which I can mount the file system and enable networking to some degree (I can reach outside networks but I cannot open port 22 or start an ssh deamon - I can however start apache and open port 80)
  • I cannot install or remove software since dpkg always complains about old linux header images (I think a former administrator has deleted manually linux headers from the boot partition to make space.)
  • Now each time I try to do apt-get install or remove or upgrade or whatever it complains that there where too many errors in dkpg and especially there where errors with some old linux images (which are not present on my boot partition) and it aborts. It also complains of not finding files (related to the old linux headers)
  • I found one instruction that suggested to reinstall grub2 which I followed through. I think removing worked but installing broke in the same way as not other software can be installed. I am pretty confident the next time I wan't to restart the machine I will not even be able to enter a rescue system because grub2 seems to be uninstalled.
  • I cannot do something like apt-get install linux-image-generic

I understand that this post does not even bare a proper question but I don't even know how to formulate one. There seem to be so many things broken that obviously I kind of lost track of where to start.

edit

output of dpkg --get-selections : http://pastebin.com/CRFaaJ7m

output of apt-get install linux-generic: http://pastebin.com/7t20Bavu

output of dpgk --configure -a: http://pastebin.com/Hpmch9dM

also I think the output might be interesting (especially starting at line 484): http://pastebin.com/uUi86FtT

6
  • 1
    So you can reach Internet from it, in recovery mode or just LAN? If you can mount extern USB disk, save the output of apt-get install linux-image-generic and dpkg --get-selections and add both to the question, so we know its current state.
    – user.dz
    Nov 27, 2016 at 9:28
  • added the output via pastbin. but as sated I could only add useful output of dpkg. thanks anyway Nov 27, 2016 at 11:45
  • Try with apt-get -s -yy install linux-generic 2>&1 | tee output.txt of you can get the output
    – user.dz
    Nov 27, 2016 at 11:54
  • 1
    You have two issues (1) the two deleted kernel files (one to remove package, one half installed) and (2) dbus can't install due to post script. I want to confirm that you have some kernels left in the system. Please. add output of ls -l /boot/vmlinuz* /boot/initrd*
    – user.dz
    Nov 27, 2016 at 14:15
  • 1
    thanks for making sure images exist in boot. I checked this before but you can see the output of the two commands at imgur.com/a/BIGuy Nov 28, 2016 at 17:20

1 Answer 1

3

Could see only one old kernel from dpkg status, but I'm not sure if it really on the disk.

Anyway:

  1. Make a backup of the DPKG status file

    cp /var/lib/dpkg/status /var/lib/dpkg/status.backup0
    
  2. Clear those manually removed kernels from the DPKG status

    Check which line is the package entry

    grep -n linux-image-extra-3.13.0-93-generic /var/lib/dpkg/status
    

    Open status for edit (change xxxxx with the line number)

    nano +xxxxx /var/lib/dpkg/status
    

    Change its status to deinstall as this example

    Package: linux-image-extra-3.13.0-93-generic
    Status: install ok installed
    

    to

    Package: linux-image-extra-3.13.0-93-generic
    Status: deinstall ok config-files
    

    Ctrl+O to save & Ctrl+X to exit

  3. Make the previous step for the following packages

    linux-image-3.13.0-93-generic
    linux-image-extra-3.13.0-101-generic
    linux-image-3.13.0-101-generic
    
  4. Modify DBus post -install script to skip errors

    nano /var/lib/dpkg/info/dbus.postinst
    

    and comment set -e#set -e (around line # 5)

  5. Continue previous installation

    dpkg --configure -a
    
  6. Fix dependencies

    apt -f install
    
5
  • I think I understand where you trying to go but already the first command says: dpkg: warning: ignoring request to remove linux-image-extra-3.13.0-93-generic which isn't installed I read somehere I could just touch these files in boot so that dpkg could do some removal Nov 28, 2016 at 17:28
  • as you can see here: imgur.com/a/Ia8nP the entry we were looking for do not exist in /var/lib/dpkg/status touching these files would mean touching them on the boot partition? could I also just append entries in the status file with the linux images and status: deinstall ok config-files or is that a bad idea since I am missing all the dependencies? Nov 28, 2016 at 19:46
  • sorry your suggestion unfortunately didn't work. i changed the lines but allready dpkg --configure -a produced a similar output with many errors as before. I then tried apt -g install which said it would fix 89 half installed packages but after 2 percent i just got a screen full of No apport report written because MaxReports is reached alread E:Sub-process /usr/bin/dpkg returned an error code (1) I don't find a file in /var/crash/ so I can't attach the output :( Nov 28, 2016 at 20:15
  • @RenePickhardt, could you rerun apt-get -yy -f install 2>&1 | tee output.txt . To find the new show-stopper.
    – user.dz
    Nov 28, 2016 at 20:19
  • Let us continue this discussion in chat.
    – user.dz
    Nov 28, 2016 at 20:21

You must log in to answer this question.

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