Como desinstalar pacotes não utilizados quando o disco está cheio?
Eu estou tentando instalar uma dependência não atendida linux-headers-4.4.0-108
e atualizar o kernel.
Eu tentei usar sudo apt-get autoremove
, mas ele falha com um erro de disco cheio.
Versões:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.1 LTS
Release: 16.04
Codename: xenial
Sistema de arquivos:
$ df -h
Filesystem Size Used Avail Use% Mounted on
udev 2.0G 0 2.0G 0% /dev
tmpfs 395M 46M 350M 12% /run
/dev/xvda1 7.8G 5.0G 2.4G 69% /
tmpfs 2.0G 0 2.0G 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 396M 0 396M 0% /run/user/1000
Eu recebo o mesmo erro ao tentar executar sudo apt-get -f install
$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
linux-headers-4.4.0-108
The following NEW packages will be installed:
linux-headers-4.4.0-108
0 upgraded, 1 newly installed, 0 to remove and 160 not upgraded.
7 not fully installed or removed.
Need to get 0 B/9927 kB of archives.
After this operation, 70.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_CTYPE = "UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
(Reading database ... 501671 files and directories currently installed.)
Preparing to unpack .../linux-headers-4.4.0-108_4.4.0-108.131_all.deb ...
Unpacking linux-headers-4.4.0-108 (4.4.0-108.131) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-
4.4.0-108_4.4.0-108.131_all.deb (--unpack):
error creating directory './usr/src/linux-headers-4.4.0-
108/arch/powerpc/platforms/pasemi': 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)
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-4.4.0-108_4.4.0-108.131_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Eu também descobri que há muitos kernels não usados instalados que podem ser removidos para criar mais espaço, mas não tenho certeza qual é o melhor método, já que geralmente uso sudo apt-get autoremove
Atual:
$ uname -r
4.4.0-93-generic
Não usado:
$ dpkg --list | grep linux-image
ii linux-image-4.4.0-101-generic 4.4.0-101.124 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-103-generic 4.4.0-103.126 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-104-generic 4.4.0-104.127 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iU linux-image-4.4.0-108-generic 4.4.0-108.131 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-31-generic 4.4.0-31.50 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-78-generic 4.4.0-78.99 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-79-generic 4.4.0-79.100 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-81-generic 4.4.0-81.104 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-83-generic 4.4.0-83.106 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-87-generic 4.4.0-87.110 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-89-generic 4.4.0-89.112 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-91-generic 4.4.0-91.114 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-92-generic 4.4.0-92.115 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-93-generic 4.4.0-93.116 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-96-generic 4.4.0-96.119 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-97-generic 4.4.0-97.120 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii linux-image-4.4.0-98-generic 4.4.0-98.121 amd64 Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iU linux-image-virtual 4.4.0.108.113 amd64 This package will always depend on the latest minimal generic kernel image.
Eu também tentei remover manualmente um kernel, mas recebo o seguinte erro.
$ sudo apt-get purge linux-image-4.4.0-78
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'linux-image-4.4.0-78-generic' for regex 'linux-image-4.4.0-78'
Note, selecting 'linux-image-4.4.0-78-lowlatency' for regex 'linux-image-4.4.0-78'
Package 'linux-image-4.4.0-78-lowlatency' is not installed, so not removed
You might want to run 'apt-get -f install' to correct these:
The following packages have unmet dependencies:
linux-headers-4.4.0-108-generic : Depends: linux-headers-4.4.0-108 but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
inode stats:
$ df -iH
Filesystem Inodes IUsed IFree IUse% Mounted on
udev 504k 360 504k 1% /dev
tmpfs 506k 495 506k 1% /run
/dev/xvda1 525k 514k 11k 98% /
tmpfs 506k 1 506k 1% /dev/shm
tmpfs 506k 4 506k 1% /run/lock
tmpfs 506k 16 506k 1% /sys/fs/cgroup
tmpfs 506k 4 506k 1% /run/user/1000