LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 07-27-2016, 03:17 PM   #1
PClOStinspace
Member
 
Registered: Jun 2008
Location: Bracknell, UK
Distribution: Ubuntu, mostly!
Posts: 161

Rep: Reputation: 20
dpkg error when trying to reinstall kernal from a live session using chroot


I have messed up using a boot-repair CD and have ended up either removing or partially removing (not sure which tbh) my kernal.

I have booted up an Ubuntu-Gnome 16.04 live session (this is the same distro/release as the damaged system, not sure if it helps at all but though it sensible) chrooted into the damaged system using instructions found here:-
http://askubuntu.com/questions/28099.../166010#166010

I have got as far as the command to install the new kernel and am getting:-
Code:
root@ubuntu-gnome:/# apt-get install linux-image-generic
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following additional packages will be installed:
  linux-image-4.4.0-31-generic thermald
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools linux-headers-4.4.0-31-generic
The following packages will be REMOVED:
  linux-image-extra-4.4.0-28-generic
The following NEW packages will be installed:
  linux-image-4.4.0-31-generic linux-image-generic thermald
0 upgraded, 3 newly installed, 1 to remove and 3 not upgraded.
2 not fully installed or removed.
Need to get 0 B/57.8 MB of archives.
After this operation, 106 MB disk space will be freed.
Do you want to continue? [Y/n] y
debconf: Perl may be unconfigured (Can't locate Debconf/Log.pm in @INC (you may need to install the Debconf::Log module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.22.1 /usr/local/share/perl/5.22.1 /usr/lib/x86_64-linux-gnu/perl5/5.22 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl/5.22 /usr/share/perl/5.22 /usr/local/lib/site_perl /usr/lib/x86_64-linux-gnu/perl-base .) at (eval 1) line 4.
BEGIN failed--compilation aborted at (eval 1) line 4.
) -- aborting
E: Can not write log (Is /dev/pts mounted?) - posix_openpt (2: No such file or directory)
(Reading database ... 333847 files and directories currently installed.)
Removing linux-image-extra-4.4.0-28-generic (4.4.0-28.47) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-28-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-28-generic /boot/vmlinuz-4.4.0-28-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-28-generic
/usr/sbin/mkinitramfs: 63: .: Can't open /usr/share/initramfs-tools/scripts/functions
update-initramfs: failed for /boot/initrd.img-4.4.0-28-generic with 2.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 2
dpkg: error processing package linux-image-extra-4.4.0-28-generic (--remove):
 subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
 linux-image-extra-4.4.0-28-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Can someone with more brains than me tell me how I get out of this mess! I have tried removing 'linux-image-extra-4.4.0-28-generic' both with apt and directly with dpkg to no avail and now run entirely out of ideas!!
 
Old 07-27-2016, 04:27 PM   #2
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Personally, this is why I use a separate partition for home. All my "stuff" stays intact and I can blow up the system every once in a while.

Also remember that the rescue/install CD and system kernel versions get out of sync. You can chroot to the old system. But the running kernel from the installer/rescue likely doesn't match the kernel on the disk... and you are unable to redo the boot.

Copy off everything in your home folder and reinstall.

Last edited by mpapet; 07-27-2016 at 04:29 PM.
 
Old 07-27-2016, 04:33 PM   #3
PClOStinspace
Member
 
Registered: Jun 2008
Location: Bracknell, UK
Distribution: Ubuntu, mostly!
Posts: 161

Original Poster
Rep: Reputation: 20
Quote:
Originally Posted by mpapet View Post
Personally, this is why I use a separate partition for home. All my "stuff" stays intact and I can blow up the system every once in a while.
I do have a separate /home for exactly that reason

Quote:
Originally Posted by mpapet View Post
Copy off everything in your home folder and reinstall.
If it comes to it I'll have to tomorrow as I need this machine up and running on Friday but it's not my preferred solution if I can possibly avoid it!
 
Old 07-27-2016, 04:40 PM   #4
mpapet
Member
 
Registered: Nov 2003
Location: Los Angeles
Distribution: debian
Posts: 548

Rep: Reputation: 72
Quote:
Originally Posted by PClOStinspace View Post
If it comes to it I'll have to tomorrow as I need this machine up and running on Friday but it's not my preferred solution if I can possibly avoid it!
IMO, you have no choice. Good thing you have a separate /home mount!
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Ubuntu 'dpkg--configure-a' E: dpkg was interrupted error Mountain Man 77 Linux - Newbie 8 02-21-2015 10:59 PM
dpkg: parse error, in file `/var/lib/dpkg/updates/0004 contact.aprie Linux - General 2 04-17-2012 09:01 PM
Input/Output Error; dpkg sub-process /usr/bin/dpkg returned and error code (2) NosLycn Linux - Software 7 12-12-2011 02:50 AM
dpkg is dead! error in /var/lib/dpkg/available dezert_fox Debian 4 11-22-2011 10:28 AM
[SOLVED] [chroot] How to reinstall kernel files? littlebigman Ubuntu 1 09-10-2010 05:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 11:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration