Ubuntu: Running apt-get install updated unrelated packages and is causing issues



Question:

I recently ran apt-get install unzip on an Ubuntu server, for some reason it started updating almost every package on the system - apache, php, git, mysql, numerous libraries and more. Eventually it failed when trying to add a new kernel image:

update-initramfs: Generating /boot/initrd.img-3.5.0-54-generic  gzip: stdout: No space left on device  

There are loads of kernels installed. uname -r currently returns 3.5.0-36-generic but there are about 10 newer kernels listed than that.

So my questions:

  1. normal advice to clear /boot partition is to delete older kernels no longer used - can you delete newer kernels too? It's a remote server so if the bootloader breaks that's a real problem.
  2. why did apt-get install unzip update so many unrelated packages?


Solution:1

The "not enough space on boot" thing is an independent issue, which seems to be a constant problem for people who have disc encryption on. It seems to have been reported as a bug report for a year now but is still not fixed for some reason. You can fix it with

dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/\(.*\)-\([^0-9]\+\)/\1/")"'/d;s/^[^ ]* [^ ]* \([^ ]*\).*/\1/;/[0-9]/!d' | xargs sudo apt-get -y purge  

in the console -- this looks for which kernel packages you've got installed and then purges them all apart from the one you're currently running.


Solution:2

  1. You can possibily delete every kernel but the one you are using (cf., uname -r). You can maybe leave another one to be sure, but you certainly do not need 10.
  2. I guess you have had some unconfigured packages the last time you ran apt-get/dpkg.

Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »