0

When I was trying to install a .deb file, dpkg gave me this error:

dpkg: error: dpkg status database is locked by another process

So I tried the dpkg --configre -a and it gave me this output

Setting up linux-image-4.10.0-24-generic (4.10.0-24.28) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-4.10.0-24-generic
vmlinuz(/boot/vmlinuz-4.10.0-24-generic
) points to /boot/vmlinuz-4.10.0-24-generic
 (/boot/vmlinuz-4.10.0-24-generic) -- doing nothing at /var/lib/dpkg/info/linux-image-4.10.0-24-generic.postinst line 491.
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/apt-auto-removal 4.10.0-24-generic /boot/vmlinuz-4.10.0-24-generic
run-parts: executing /etc/kernel/postinst.d/dkms 4.10.0-24-generic /boot/vmlinuz-4.10.0-24-generic

it stopped in last line for 1h and then I had to use Ctrl+c to exit.

Whats wrong with my system?

P. S. : Once I had a trouble installing wicd and since then apt is giving me all kind of errors. if this is related to that, is there anyway to say apt to do checks to find the problem(s)? or I have to reinstall the ubuntu?

A.Esm.T
  • 51
  • https://askubuntu.com/questions/271360/when-installing-updates-or-from-software-center-in-ubuntu-12-04-error-messages – luv.preet Jun 20 '17 at 19:31

1 Answers1

0

One possible reason for your problem is a full /boot partition. On some Ubuntu installation you will find the following partition layout:

mount
/dev/sda2 on / type ext4 (rw)
/dev/sda1 on /boot type ext2 (rw)
df -h
Filesystem      Size  Used Avail  Use% Mounted on
/dev/sda2       200G   23G  172G   12% /
/dev/sda1       1G      1G    0G  100% /boot

In most cases the /boot partitions gets crowded with kernel updates. Removing old kernels can be done with:

sudo apt-get --purge autoremove

If however /boot is over crowded, you need to manually remove some of the old kernel packages:

dpkg -l "*linux*" | grep ^ii | tr -s ' ' | cut -d' ' -f2
...
linux-image-4.4.0-79-generic
linux-image-4.4.0-81-generic
linux-image-extra-4.4.0-79-generic
linux-image-extra-4.4.0-81-generic
...
sudo dpkg -r linux-image-4.4.0-79-generic \
    linux-image-extra-4.4.0-79-generic
Simon Sudler
  • 3,931
  • 3
  • 21
  • 34