Unable to install any packages for reasons unknown












0















Whenever I try to install packages, this is what happens:



ramana-siva@A:~$ sudo apt install focuswriter
[sudo] password for ramana-siva:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
myspell-dictionary
The following packages will be REMOVED:
linux-image-4.4.0-139-generic linux-image-4.4.0-97-generic
linux-image-extra-4.4.0-139-generic linux-image-extra-4.4.0-97-generic
The following NEW packages will be installed:
focuswriter
0 upgraded, 1 newly installed, 4 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 2,467 kB of archives.
After this operation, 322 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe i386 focuswriter i386 1.5.5-1 [2,467 kB]
Fetched 2,467 kB in 4s (527 kB/s)
(Reading database ... 304909 files and directories currently installed.)
Removing linux-image-extra-4.4.0-139-generic (4.4.0-139.165) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-139-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-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-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-139-generic
WARNING: missing /lib/modules/4.4.0-139-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-139-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-139-generic (4.4.0-139.165) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-139-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-139-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-97-generic (4.4.0-97.120) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-97-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-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-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-97-generic
WARNING: missing /lib/modules/4.4.0-97-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-97-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-97-generic (4.4.0-97.120) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-97-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-97-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-extra-4.4.0-139-generic
linux-image-4.4.0-139-generic
linux-image-extra-4.4.0-97-generic
linux-image-4.4.0-97-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)









share|improve this question

























  • From your logvomit: "Please install the linux-headers-4.4.0-139-generic package,"

    – waltinator
    Feb 21 at 15:13











  • It looks like the underlying issue may be a corrupted /etc/default/grub file (/etc/default/grub: bare: not found)

    – steeldriver
    Feb 21 at 16:34






  • 1





    Please edit your question to explain a bit more about changes or customizations you made, or files or packages you removed right before you noticed this problem. You seem to have both missing files and changed/corrupted files.

    – user535733
    Feb 21 at 19:18
















0















Whenever I try to install packages, this is what happens:



ramana-siva@A:~$ sudo apt install focuswriter
[sudo] password for ramana-siva:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
myspell-dictionary
The following packages will be REMOVED:
linux-image-4.4.0-139-generic linux-image-4.4.0-97-generic
linux-image-extra-4.4.0-139-generic linux-image-extra-4.4.0-97-generic
The following NEW packages will be installed:
focuswriter
0 upgraded, 1 newly installed, 4 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 2,467 kB of archives.
After this operation, 322 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe i386 focuswriter i386 1.5.5-1 [2,467 kB]
Fetched 2,467 kB in 4s (527 kB/s)
(Reading database ... 304909 files and directories currently installed.)
Removing linux-image-extra-4.4.0-139-generic (4.4.0-139.165) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-139-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-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-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-139-generic
WARNING: missing /lib/modules/4.4.0-139-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-139-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-139-generic (4.4.0-139.165) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-139-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-139-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-97-generic (4.4.0-97.120) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-97-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-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-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-97-generic
WARNING: missing /lib/modules/4.4.0-97-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-97-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-97-generic (4.4.0-97.120) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-97-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-97-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-extra-4.4.0-139-generic
linux-image-4.4.0-139-generic
linux-image-extra-4.4.0-97-generic
linux-image-4.4.0-97-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)









share|improve this question

























  • From your logvomit: "Please install the linux-headers-4.4.0-139-generic package,"

    – waltinator
    Feb 21 at 15:13











  • It looks like the underlying issue may be a corrupted /etc/default/grub file (/etc/default/grub: bare: not found)

    – steeldriver
    Feb 21 at 16:34






  • 1





    Please edit your question to explain a bit more about changes or customizations you made, or files or packages you removed right before you noticed this problem. You seem to have both missing files and changed/corrupted files.

    – user535733
    Feb 21 at 19:18














0












0








0








Whenever I try to install packages, this is what happens:



ramana-siva@A:~$ sudo apt install focuswriter
[sudo] password for ramana-siva:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
myspell-dictionary
The following packages will be REMOVED:
linux-image-4.4.0-139-generic linux-image-4.4.0-97-generic
linux-image-extra-4.4.0-139-generic linux-image-extra-4.4.0-97-generic
The following NEW packages will be installed:
focuswriter
0 upgraded, 1 newly installed, 4 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 2,467 kB of archives.
After this operation, 322 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe i386 focuswriter i386 1.5.5-1 [2,467 kB]
Fetched 2,467 kB in 4s (527 kB/s)
(Reading database ... 304909 files and directories currently installed.)
Removing linux-image-extra-4.4.0-139-generic (4.4.0-139.165) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-139-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-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-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-139-generic
WARNING: missing /lib/modules/4.4.0-139-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-139-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-139-generic (4.4.0-139.165) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-139-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-139-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-97-generic (4.4.0-97.120) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-97-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-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-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-97-generic
WARNING: missing /lib/modules/4.4.0-97-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-97-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-97-generic (4.4.0-97.120) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-97-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-97-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-extra-4.4.0-139-generic
linux-image-4.4.0-139-generic
linux-image-extra-4.4.0-97-generic
linux-image-4.4.0-97-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)









share|improve this question
















Whenever I try to install packages, this is what happens:



ramana-siva@A:~$ sudo apt install focuswriter
[sudo] password for ramana-siva:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
myspell-dictionary
The following packages will be REMOVED:
linux-image-4.4.0-139-generic linux-image-4.4.0-97-generic
linux-image-extra-4.4.0-139-generic linux-image-extra-4.4.0-97-generic
The following NEW packages will be installed:
focuswriter
0 upgraded, 1 newly installed, 4 to remove and 0 not upgraded.
10 not fully installed or removed.
Need to get 2,467 kB of archives.
After this operation, 322 MB disk space will be freed.
Do you want to continue? [Y/n] y
Get:1 http://archive.ubuntu.com/ubuntu xenial/universe i386 focuswriter i386 1.5.5-1 [2,467 kB]
Fetched 2,467 kB in 4s (527 kB/s)
(Reading database ... 304909 files and directories currently installed.)
Removing linux-image-extra-4.4.0-139-generic (4.4.0-139.165) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-139-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-139-generic cannot be found.
Please install the linux-headers-4.4.0-139-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-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-139-generic
WARNING: missing /lib/modules/4.4.0-139-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-139-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_Qngcmy/lib/modules/4.4.0-139-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-139-generic (4.4.0-139.165) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-139-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-139-generic /boot/vmlinuz-4.4.0-139-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-139-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-139-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-extra-4.4.0-97-generic (4.4.0-97.120) ...
depmod: FATAL: could not load /boot/System.map-4.4.0-97-generic: No such file or directory
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-generic package,
or use the --kernelsourcedir option to tell DKMS where it's located
Error! Your kernel headers for kernel 4.4.0-97-generic cannot be found.
Please install the linux-headers-4.4.0-97-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-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Generating /boot/initrd.img-4.4.0-97-generic
WARNING: missing /lib/modules/4.4.0-97-generic
Ensure all necessary drivers are built into the linux image!
depmod: ERROR: could not open directory /lib/modules/4.4.0-97-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.order: No such file or directory
depmod: WARNING: could not open /var/tmp/mkinitramfs_bTzE26/lib/modules/4.4.0-97-generic/modules.builtin: No such file or directory
run-parts: executing /etc/kernel/postinst.d/pm-utils 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/unattended-upgrades 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/update-notifier 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
run-parts: executing /etc/kernel/postinst.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postinst.d/zz-update-grub exited with return code 127
dpkg: error processing package linux-image-extra-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
Removing linux-image-4.4.0-97-generic (4.4.0-97.120) ...
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
update-initramfs: Deleting /boot/initrd.img-4.4.0-97-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-97-generic /boot/vmlinuz-4.4.0-97-generic
/usr/sbin/grub-mkconfig: 13: /etc/default/grub: bare: not found
run-parts: /etc/kernel/postrm.d/zz-update-grub exited with return code 127
Failed to process /etc/kernel/postrm.d at /var/lib/dpkg/info/linux-image-4.4.0-97-generic.postrm line 330.
dpkg: error processing package linux-image-4.4.0-97-generic (--remove):
subprocess installed post-removal script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-extra-4.4.0-139-generic
linux-image-4.4.0-139-generic
linux-image-extra-4.4.0-97-generic
linux-image-4.4.0-97-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)






16.04






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 21 at 15:49









mature

2,1574931




2,1574931










asked Feb 21 at 14:58









SathyaSaiShreeJaeyaDevan SaiNaSathyaSaiShreeJaeyaDevan SaiNa

1




1













  • From your logvomit: "Please install the linux-headers-4.4.0-139-generic package,"

    – waltinator
    Feb 21 at 15:13











  • It looks like the underlying issue may be a corrupted /etc/default/grub file (/etc/default/grub: bare: not found)

    – steeldriver
    Feb 21 at 16:34






  • 1





    Please edit your question to explain a bit more about changes or customizations you made, or files or packages you removed right before you noticed this problem. You seem to have both missing files and changed/corrupted files.

    – user535733
    Feb 21 at 19:18



















  • From your logvomit: "Please install the linux-headers-4.4.0-139-generic package,"

    – waltinator
    Feb 21 at 15:13











  • It looks like the underlying issue may be a corrupted /etc/default/grub file (/etc/default/grub: bare: not found)

    – steeldriver
    Feb 21 at 16:34






  • 1





    Please edit your question to explain a bit more about changes or customizations you made, or files or packages you removed right before you noticed this problem. You seem to have both missing files and changed/corrupted files.

    – user535733
    Feb 21 at 19:18

















From your logvomit: "Please install the linux-headers-4.4.0-139-generic package,"

– waltinator
Feb 21 at 15:13





From your logvomit: "Please install the linux-headers-4.4.0-139-generic package,"

– waltinator
Feb 21 at 15:13













It looks like the underlying issue may be a corrupted /etc/default/grub file (/etc/default/grub: bare: not found)

– steeldriver
Feb 21 at 16:34





It looks like the underlying issue may be a corrupted /etc/default/grub file (/etc/default/grub: bare: not found)

– steeldriver
Feb 21 at 16:34




1




1





Please edit your question to explain a bit more about changes or customizations you made, or files or packages you removed right before you noticed this problem. You seem to have both missing files and changed/corrupted files.

– user535733
Feb 21 at 19:18





Please edit your question to explain a bit more about changes or customizations you made, or files or packages you removed right before you noticed this problem. You seem to have both missing files and changed/corrupted files.

– user535733
Feb 21 at 19:18










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120147%2funable-to-install-any-packages-for-reasons-unknown%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Ask Ubuntu!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1120147%2funable-to-install-any-packages-for-reasons-unknown%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

flock() on closed filehandle LOCK_FILE at /usr/bin/apt-mirror

Mangá

Eduardo VII do Reino Unido