[ubuntu-ar] Eliminar kernel anteriores tras actualización
Pablo Lillia
pablofer72 at yahoo.com.ar
Tue Dec 29 22:21:46 UTC 2015
Encontré algo que puede explicar lo que pasa, que en algunos equipos
funka el autoremove y en otros no:
https://www.reddit.com/r/Ubuntu/comments/3rm4fw/ubuntu_server_1404_aptget_autoremove_kernels/
http://askubuntu.com/questions/563483/why-doesnt-apt-get-autoremove-remove-my-old-kernels
Sospecho que /etc/kernel/postinst.d/apt-auto-removal a veces deja de
hacer bien su trabajo, o encuentra algo instalado que se lo impide. O
algo por el estilo.
Mi /etc/apt/apt.conf.d/01autoremove-kernels tiene:
// DO NOT EDIT! File autogenerated by
/etc/kernel/postinst.d/apt-auto-removal
APT::NeverAutoRemove
{
"^linux-image-3\.16\.0-57-generic$";
"^linux-image-3\.19\.0-42-generic$";
"^linux-headers-3\.16\.0-57-generic$";
"^linux-headers-3\.19\.0-42-generic$";
"^linux-image-extra-3\.16\.0-57-generic$";
"^linux-image-extra-3\.19\.0-42-generic$";
"^linux-signed-image-3\.16\.0-57-generic$";
"^linux-signed-image-3\.19\.0-42-generic$";
"^kfreebsd-image-3\.16\.0-57-generic$";
"^kfreebsd-image-3\.19\.0-42-generic$";
"^kfreebsd-headers-3\.16\.0-57-generic$";
"^kfreebsd-headers-3\.19\.0-42-generic$";
"^gnumach-image-3\.16\.0-57-generic$";
"^gnumach-image-3\.19\.0-42-generic$";
"^.*-modules-3\.16\.0-57-generic$";
"^.*-modules-3\.19\.0-42-generic$";
"^.*-kernel-3\.16\.0-57-generic$";
"^.*-kernel-3\.19\.0-42-generic$";
"^linux-backports-modules-.*-3\.16\.0-57-generic$";
"^linux-backports-modules-.*-3\.19\.0-42-generic$";
"^linux-tools-3\.16\.0-57-generic$";
"^linux-tools-3\.19\.0-42-generic$";
};
Y /etc/kernel/postinst.d/apt-auto-removal dice:
# Mark as not-for-autoremoval those kernel packages that are:
# - the currently booted version
# - the kernel version we've been called for
# - the latest kernel version (determined using rules copied from the grub
# package for deciding which kernel to boot)
# - the second-latest kernel version, if the booted kernel version is
# already the latest and this script is called for that same version,
# to ensure a fallback remains available in the event the newly-installed
# kernel at this ABI fails to boot
# In the common case, this results in exactly two kernels saved, but it can
# result in three kernels being saved. It's better to err on the side of
# saving too many kernels than saving too few.
#
# We generate this list and save it to /etc/apt/apt.conf.d instead of
marking
# packages in the database because this runs from a postinst script, and apt
# will overwrite the db when it exits.
Por algún motivo, hay equipos donde los kernels se acumulan y apt-get
autoremove en lugar de dejar solo los 2 o 3 últimos, no elimina ninguno.
En este 14.04, tengo instalados 3 kernels:
sudo dpkg -l linux-image* | grep ii | awk '{print $2}'
linux-image-3.19.0-39-generic
linux-image-3.19.0-41-generic
linux-image-3.19.0-42-generic
linux-image-extra-3.19.0-39-generic
linux-image-extra-3.19.0-41-generic
linux-image-extra-3.19.0-42-generic
linux-image-generic-lts-vivid
El kernel actual es 3.19.0-42:
$ uname -a
Linux pablo-pc 3.19.0-42-generic #48~14.04.1-Ubuntu SMP Fri Dec 18
10:24:49 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
Corro el autoremove:
$ sudo apt-get autoremove
Leyendo lista de paquetes... Hecho
Creando árbol de dependencias
Leyendo la información de estado... Hecho
0 actualizados, 0 se instalarán, 0 para eliminar y 0 no actualizados.
Y no quita nada. Debería haber dejado el 42 (el actual), y el 41 (el
anterior, como fallback), y debería proponer la eliminación del 39. Pero
no lo hace. Y no está en la lista de kernels "para no borrar", como si
figura el actual (lógico)|.
|
Aún no entiendo del todo la causa del problema, pero creo que hay algo
raro con el funcionamiento del
/etc/kernel/postinst.d/apt-auto-removal. Si encuentro algo más, les
comento.
Saludos,
Pablo|
||
|
More information about the Ubuntu-ar
mailing list