Sé que esta pregunta se hace muchas veces antes, sin embargo, conmigo es un poco diferente, supongo.
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda3 224G 5.2G 208G 3% /
udev 1.9G 4.0K 1.9G 1% /dev
tmpfs 777M 260K 777M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 1.9G 0 1.9G 0% /run/shm
/dev/sda2 90M 88M 0 100% /boot
/dev/sda6 1.9G 514M 1.3G 29% /tmp
Mi partición de arranque está llena.
Kernel actual:
# uname -r
3.2.0-35-generic
Todos los granos:
# dpkg --list | grep linux-image
ii linux-image-3.2.0-32-generic 3.2.0-32.51 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-34-generic 3.2.0-34.53 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
ii linux-image-3.2.0-35-generic 3.2.0-35.55 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF linux-image-3.2.0-37-generic 3.2.0-37.58 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iF linux-image-3.2.0-38-generic 3.2.0-38.60 Linux kernel image for version 3.2.0 on 64 bit x86 SMP
iU linux-image-generic 3.2.0.37.45 Generic Linux kernel image
Entonces pensé en eliminar el núcleo genérico 3.2.0.32 con:
# sudo apt-get purge linux-image-3.2.0-32-generic
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-generic : Depends: linux-headers-generic (= 3.2.0.37.45) but 3.2.0.38.46 is to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Sin éxito.
Cuando lo intento apt-get -f install
también falla:
# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
linux-headers-3.2.0-34 linux-headers-3.2.0-35 linux-headers-3.2.0-34-generic linux-headers-3.2.0-35-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-generic linux-image-generic
The following packages will be upgraded:
linux-generic linux-image-generic
2 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
5 not fully installed or removed.
Need to get 0 B/4,334 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
Setting up initramfs-tools (0.99ubuntu13.1) ...
update-initramfs: deferring update (trigger activated)
Setting up linux-image-3.2.0-37-generic (3.2.0-37.58) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-38-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-37-generic /boot/vmlinuz-3.2.0-37-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-37-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-37-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-37-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-37-generic (--configure):
subprocess installed post-installation script returned error exit status 2
Setting up linux-image-3.2.0-38-generic (3.2.0-38.60) ...
Running depmod.
update-initramfs: deferring update (hook will be called later)
The link /initrd.img is a dangling linkto /boot/initrd.img-3.2.0-37-generic
Examining /etc/kernel/postinst.d.
run-parts: executing /etc/kernel/postinst.d/initramfs-tools 3.2.0-38-generic /boot/vmlinuz-3.2.0-38-generic
update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-38-generic with 1.
run-parts: /etc/kernel/postinst.d/initramfs-tools exited with return code 1
Failed to process /etc/kernel/postinst.d at /var/lib/dpkg/info/linux-image-3.2.0-38-generic.postinst line 1010.
dpkg: error processing linux-image-3.2.0-38-generic (--configure):
subprocess installed post-installation script returned error exit status 2
dpkg: dependency problems prevent configuration of linux-image-generic:
linux-image-generic depends on linux-image-3.2.0-37-generic; however:
Package linux-image-3.2.0-37-generic is not configured yet.
dpkg: error processing linux-image-generic (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 3.2.0.37.45); however:
Package linux-image-generic is not configured yet.
linux-generic depends on linux-headers-generic (= 3.2.0.37.45); however:
Version of linux-headers-generic on system is 3.2.0.38.46.
dpkg: error processing linux-generic (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
No apport report written because the error message indicates its a followup error from a previous failure.
No apport report written because MaxReports is reached already
update-initramfs: Generating /boot/initrd.img-3.2.0-35-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-35-generic with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-3.2.0-37-generic
linux-image-3.2.0-38-generic
linux-image-generic
linux-generic
initramfs-tools
E: Sub-process /usr/bin/dpkg returned an error code (1)
Cualquier ayuda sería realmente apreciada.
Actualización: hice:
sudo rm /boot/*-3.2.0-32-generic /boot/*-3.2.0-34-generic
Después de eso, el siguiente problema con apt-get -f install
:
root@localhost:/# apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
linux-generic
The following packages will be upgraded:
linux-generic
1 upgraded, 0 newly installed, 0 to remove and 9 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,722 B of archives.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of linux-generic:
linux-generic depends on linux-image-generic (= 3.2.0.37.45); however:
Version of linux-image-generic on system is 3.2.0.38.46.
linux-generic depends on linux-headers-generic (= 3.2.0.37.45); however:
Version of linux-headers-generic on system is 3.2.0.38.46.
dpkg: error processing linux-generic (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-generic
E: Sub-process /usr/bin/dpkg returned an error code (1)
Respuestas:
No puede usar apt-get cuando su núcleo está desactualizado.
use
ls
para ver lo que hay en la carpeta, elimine el uno o dos más antiguos y luegoLuego puedes usar apt-get purge como en
o simplemente continuar con rm.
también deberías
sudo update-grub
cuando estés acabadofuente
sudo apt-get -f install
, luego reinicié para asegurarme de que todo esté bien y eliminé el resto conapt autoremove
lo sugerido en la salida de comandos anteriores.Aparentemente, esto funciona:
Según
apt-get
la página del manual:3.16.0-39 es el que intenté instalar, pero fallé porque / boot estaba lleno. 3.16.0-38 es mi versión actual. Puedes ver que se saltó -38.
fuente
autoremove
.En una terminal, ejecute el siguiente comando:
Este comando enumera todos los núcleos de Linux actualmente instalados, luego selecciona todos los que actualmente no se utilizan y los elimina.
fuente
Si ejecutar el comando anterior sin el "sudo apt-get -y purge" coincide con su linux-libc-dev: amd64, puede agregar un punto y coma a la expresión regular para no incluirla:
Ahora solo asegúrese de que se vea bien y agregue el "sudo apt-get -y purge"
fuente
Para Ubuntu 12.04 intente esto
sudo apt-get purge linux-image-[kernel version]
Esto eliminará cualquier versión del kernel. Si su carpeta de arranque tiene muchos núcleos, no olvide actualizar grub y reiniciar su sistema
ex. sudo apt-get purge linux-image-3.11.6 *
fuente
Muchas respuestas dicen usar "apt autoremove" pero eso puede no funcionar cuando / boot está lleno porque apt intenta agregar núcleos antes de eliminarlos.
El siguiente apt autoremove no eliminará los núcleos mencionados en /etc/apt/apt.conf.d/01autoremove-kernels, por lo que debemos solucionarlo.
Aquí está el proceso que funcionó para mí.
Eliminar los archivos de configuración del núcleo no deseados.
sudo dpkg --purge $ (COLUMNS = 200 dpkg -l | grep "linux-image-extra" | grep "^ rc" | tr -s '' | cut -d '' -f 2)
Actualice /etc/apt/apt.conf.d/01autoremove-kernels ejecutando ...
sudo /etc/kernel/postinst.d/apt-auto-removal
Esperemos que apt autoremove funcione.
sudo apt autoremove --purge
De lo contrario, debería poder eliminar manualmente los núcleos muy antiguos y no utilizados de / boot.
Primero averigüe qué núcleo está ejecutando.
uname -r
No elimine el núcleo actual o el núcleo anterior.
sudo rm /boot/initrd.img-V.XX.Y-ZZ-generic
Ahora debería tener suficiente espacio para intentar el apt autoremove nuevamente. Si no, elimine otro núcleo muy antiguo. Por supuesto, manténgase actualizado y el más antiguo.
fuente
Espero que esto pueda ayudar:
Por lo general, elimino los núcleos antiguos usando ubuntu-tweak conserje, buena GUI y fácil :)
haga clic en 'sistema' y habrá una lista de núcleos antiguos, simplemente haga clic en él y limpie
fuente