Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I was attempting to install some packages and update my Ubuntu system. I tried using both the terminal and Synaptic GUI, but received errors about processing some packages (I did not pay that close of attention because I did not think it was anything serious).
I decided to reboot my system to see if that would help. I was greeted with a message similar to "unable to mount fs on uknown block(0,0)" and unable to boot my system. I thought I might be able to repair it using the Boot Repair utility. I ran the terminal commands instructed by the program and was (apparently) able to remove GRUB. However, now when I try to run the commands to reinstall GRUB, I receive the following error:
Code:
lubuntu@lubuntu:~$ sudo chroot "/mnt/boot-sav/sda5" dpkg --configure -a
dpkg: dependency problems prevent configuration of linux-image-extra-4.10.0-35-generic:
linux-image-extra-4.10.0-35-generic depends on linux-image-4.10.0-35-generic; however:
Package linux-image-4.10.0-35-generic is not configured yet.
dpkg: error processing package linux-image-extra-4.10.0-35-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-4.10.0-35-generic; however:
Package linux-image-4.10.0-35-generic is not configured yet.
linux-image-generic depends on linux-image-extra-4.10.0-35-generic; however:
Package linux-image-extra-4.10.0-35-generic is not configured yet.
dpkg: error processing package linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 4.10.0.35.35); however:
Package linux-image-generic is not configured yet.
dpkg: error processing package linux-generic (--configure):
dependency problems - leaving unconfigured
Errors were encountered while processing:
linux-image-extra-4.10.0-35-generic
linux-image-generic
linux-generic
The output from this seemed to indicate that I needed to install linux-headers-4.10.0-32-generic. However, when I tried that I received the following:
Code:
(Reading database ... 261942 files and directories currently installed.)
Removing linux-image-extra-4.10.0-30-generic (4.10.0-30.34) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-30-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-30-generic /boot/vmlinuz-4.10.0-30-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-30-generic /boot/vmlinuz-4.10.0-30-generic
Error! Your kernel headers for kernel 4.10.0-30-generic cannot be found.
Please install the linux-headers-4.10.0-30-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-30-generic /boot/vmlinuz-4.10.0-30-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-30-generic
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-30-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-30-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.10.0-32-generic (4.10.0-32.36) ...
depmod: FATAL: could not load /boot/System.map-4.10.0-32-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-32-generic /boot/vmlinuz-4.10.0-32-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-32-generic /boot/vmlinuz-4.10.0-32-generic
Error! Your kernel headers for kernel 4.10.0-32-generic cannot be found.
Please install the linux-headers-4.10.0-32-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.10.0-32-generic /boot/vmlinuz-4.10.0-32-generic
update-initramfs: Generating /boot/initrd.img-4.10.0-32-generic
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.10.0-32-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.10.0-32-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-89-generic (4.4.0-89.112) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-89-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-89-generic /boot/vmlinuz-4.4.0-89-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-89-generic /boot/vmlinuz-4.4.0-89-generic
Error! Your kernel headers for kernel 4.4.0-89-generic cannot be found.
Please install the linux-headers-4.4.0-89-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 4.4.0-89-generic /boot/vmlinuz-4.4.0-89-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-89-generic
cp: cannot stat '/usr/share/fonts/truetype/ttf-dejavu/DejaVuSerif.ttf': No such file or directory
E: /usr/share/initramfs-tools/hooks/plymouth failed with return 1.
update-initramfs: failed for /boot/initrd.img-4.4.0-89-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
dpkg: error processing package linux-image-extra-4.4.0-89-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Errors were encountered while processing:
linux-image-extra-4.10.0-30-generic
linux-image-extra-4.10.0-32-generic
linux-image-extra-4.4.0-89-generic
Error: GDBus.Error:org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.PackageKit was not provided by any .service files
E: Sub-process /usr/bin/dpkg returned an error code (1)
Now I am not quite sure what to do. If it helps here the information provided by the Boot Repair utility: http://paste.ubuntu.com/25689624/
=============================== sda5/etc/fstab: ================================
--------------------------------------------------------------------------------
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sda5 during installation
UUID=7b8de9c1-9ebb-46b3-8b54-3751d4a230d6 / ext4 errors=remount-ro 0 1
# swap was on /dev/sda6 during installation
UUID=7750636d-960d-47da-ad30-fa9f6688ec03 none swap sw 0 0
UUID=f16e73f9-3fff-4cb5-a8f2-c9a914104130 /home ext4 defaults 0 2
--------------------------------------------------------------------------------
Code:
=================== sda5/etc/default/grub :
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
#GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
#GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1"
Code:
============================ Drive/Partition Info: =============================
Drive: sda _____________________________________________________________________
Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
Partition Boot Start Sector End Sector # of Sectors Id System
/dev/sda1 * 2,048 206,847 204,800 7 NTFS / exFAT / HPFS
/dev/sda2 206,848 132,665,343 132,458,496 7 NTFS / exFAT / HPFS
/dev/sda3 132,665,344 311,656,447 178,991,104 5 Extended
/dev/sda5 250,218,496 303,605,759 53,387,264 83 Linux
/dev/sda6 303,607,808 311,656,447 8,048,640 82 Linux swap / Solaris
/dev/sda7 132,667,392 250,218,495 117,551,104 83 Linux
Since I cannot boot into problem system (sda5), I am not sure how to access the files directly. This data comes from the Boot Repair utility. Please let me know if any other data might help.
Thanks.
Last edited by Corvette; 10-07-2017 at 08:01 AM.
Reason: Fix broken code tags.
As far as post #2 asking you to list /boot/grub/grub.cfg, one method is to boot Systemrescuecd and mount /dev/sda5 at /mnt. Then you can obtain a copy of grub.cfg.
I did run some commands instructed by the Boot Repair utility to remove grub (with the intent of reinstalling it I suppose). The removal succeeded apparently; the installation did not. So now it seems as if I do not have grub properly configured; I now receive an error message relating to grub rather than the initial mounting error when attempting to boot the problematic OS. Running the install commands:
This is a long shot. After booting systemrescuecd, try chrooting using the following:
Code:
mkdir -p /mnt/repair
mount /dev/sda5 /mnt/repair
mount -t proc none /mnt/repair/proc
mount -o bind /dev /mnt/repair/dev
mount -o bind /dev/pts /mnt/repair/dev/pts
mount -o bind /sys /mnt/repair/sys
chroot /mnt/repair /bin/bash
source /etc/profile
The idea is to try and restore the missing grub directory and modules from a chrooted environment.
Code:
apt-get install --reinstall grub
update-grub
If the MBR is hosed, you may have to reinstall the boot loader
Code:
grub-install /dev/sda
If this works, you can try booting ubuntu in single-user mode and continue your repair work. Looks like a lot of your kernel headers and dependencies are missing. There is a way to resolve a catch 22 in debian. Unfortunately, I don't remember!
If this doesn't work, then I am not sure what next.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.