Al intentar actualizar el kernel, no hay suficiente espacio, sudo apt-get -f install también falla

Al intentar actualizar el kernel, no hay suficiente espacio, sudo apt-get -f install también falla

Busqué en línea y seguí sugerencias en la Terminal, ninguna de ellas funcionó para mí. A continuación se muestra el problema que tengo. Parece que el código para purgar núcleos antiguos está roto, pero para solucionarlo necesito tener más espacio, que es mi único propósito para empezar. Soy muy nuevo en Linux y de ninguna manera soy un codificador, así que sea claro conmigo.

$ sudo apt autoremove
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-image-extra-4.13.0-36-generic : Depends: linux-image-4.13.0-36-generic but it is not installed
    linux-image-generic-hwe-16.04 : Depends: linux-image-4.13.0-36-generic but it is not installed
    linux-signed-image-4.13.0-36-generic : Depends: linux-image-4.13.0-36-generic (= 4.13.0-36.40~16.04.1) but it is not installed
E: Unmet dependencies. Try using -f.
hunter@hunter-Satellite-C55-C:~$ apt-get -f install
E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied)
E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

$ sudo 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:
    libllvm4.0 linux-headers-4.10.0-35 linux-headers-4.10.0-35-generic
    linux-headers-4.10.0-37 linux-headers-4.10.0-37-generic
    linux-headers-4.10.0-40 linux-headers-4.10.0-40-generic
    linux-headers-4.10.0-42 linux-headers-4.10.0-42-generic
    linux-headers-4.13.0-26 linux-headers-4.13.0-26-generic
    linux-image-4.10.0-35-generic linux-image-4.10.0-37-generic
    linux-image-4.10.0-40-generic linux-image-4.10.0-42-generic
    linux-image-4.13.0-26-generic linux-image-extra-4.10.0-35-generic
    linux-image-extra-4.10.0-37-generic linux-image-extra-4.10.0-40-generic
    linux-image-extra-4.10.0-42-generic linux-image-extra-4.13.0-26-generic
    linux-signed-image-4.10.0-35-generic linux-signed-image-4.10.0-37-generic
    linux-signed-image-4.10.0-40-generic linux-signed-image-4.10.0-42-generic
    linux-signed-image-4.13.0-26-generic
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
    linux-image-4.13.0-36-generic
Suggested packages:
    fdutils linux-tools
The following NEW packages will be installed:
    linux-image-4.13.0-36-generic
0 upgraded, 1 newly installed, 0 to remove and 110 not upgraded.
78 not fully installed or removed.
Need to get 0 B/21.0 MB of archives.
After this operation, 72.6 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 452182 files and directories currently installed.)
Preparing to unpack .../linux-image-4.13.0-36-generic_4.13.0-36.40~16.04.1_amd64.deb ...
Examining /etc/kernel/preinst.d/
run-parts: executing /etc/kernel/preinst.d/intel-microcode 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
Done.
Unpacking linux-image-4.13.0-36-generic (4.13.0-36.40~16.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.13.0-36-generic_4.13.0-36.40~16.04.1_amd64.deb (--unpack):
    cannot copy extracted data for './boot/System.map-4.13.0-36-generic' to '/boot/System.map-4.13.0-36-generic.dpkg-new': failed to write (No space left on device)
No apport report written because the error message indicates a disk full error
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Examining /etc/kernel/postrm.d .
run-parts: executing /etc/kernel/postrm.d/initramfs-tools 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.13.0-36-generic /boot/vmlinuz-4.13.0-36-generic
Errors were encountered while processing:
    /var/cache/apt/archives/linux-image-4.13.0-36-  generic_4.13.0-36.40~16.04.1_amd64.deb
        E: Sub-process /usr/bin/dpkg returned an error code (1)

Respuesta1

Como se ha quedado sin espacio, apt no se ejecutará; y por lo tanto, cualquier solución automatizada también fallará. Necesita liberar manualmente algo de espacio en el directorio /boot/. Una forma de hacerlo es eliminar los mapas del sistema de los núcleos que va a eliminar. Si esto no deja suficiente espacio, elimine el initrd de algunos de los núcleos. Nota: necesitará privilegios de root para eliminar archivos en /boot/.

información relacionada