Невозможно удалить старые ядра / sda full [дубликат]

На этот вопрос уже есть ответ здесь:

SDA1 заполнен и Я не могу запускать обновления

root@ubuntu-nextcloud:/home/nextcloud# df -h
Filesystem                              Size  Used Avail Use% Mounted on
udev                                    6.9G     0  6.9G   0% /dev
tmpfs                                   1.4G  9.0M  1.3G   1% /run
/dev/mapper/ubuntu--nextcloud--vg-root  585G  273G  282G  50% /
tmpfs                                   4.0G     0  4.0G   0% /dev/shm
tmpfs                                   5.0M     0  5.0M   0% /run/lock
tmpfs                                   4.0G     0  4.0G   0% /sys/fs/cgroup
/dev/loop0                              179M  179M     0 100% /snap/nextcloud/1474
/dev/loop1                               80M   80M     0 100% /snap/core/1689
/dev/loop3                              161M  161M     0 100% /snap/nextcloud/1337
/dev/loop2                               79M   79M     0 100% /snap/core/1441
/dev/loop5                              179M  179M     0 100% /snap/nextcloud/1540
/dev/loop4                               79M   79M     0 100% /snap/core/1577
/dev/sda1                               472M  461M     0 100% /boot
tmpfs                                   829M     0  829M   0% /run/user/1000

Есть много старых ядер, и я хотел бы их удалить.

root@ubuntu-nextcloud:/home/nextcloud# dpkg --list | grep linux-image
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-59-generic       4.4.0-59.80                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-62-generic       4.4.0-62.83                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-63-generic       4.4.0-63.84                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-64-generic       4.4.0-64.85                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-66-generic       4.4.0-66.87                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-67-generic       4.4.0-67.88                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-70-generic       4.4.0-70.91                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-4.4.0-71-generic       4.4.0-71.92                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-4.4.0-72-generic       4.4.0-72.93                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-4.4.0-75-generic       4.4.0-75.96                                amd64        Linux kernel image for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-31-generic 4.4.0-31.50                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-59-generic 4.4.0-59.80                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-62-generic 4.4.0-62.83                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-63-generic 4.4.0-63.84                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-64-generic 4.4.0-64.85                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-66-generic 4.4.0-66.87                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-67-generic 4.4.0-67.88                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
ii  linux-image-extra-4.4.0-70-generic 4.4.0-70.91                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iF  linux-image-extra-4.4.0-71-generic 4.4.0-71.92                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-extra-4.4.0-72-generic 4.4.0-72.93                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-extra-4.4.0-75-generic 4.4.0-75.96                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-extra-4.4.0-77-generic 4.4.0-77.98                                amd64        Linux kernel extra modules for version 4.4.0 on 64 bit x86 SMP
iU  linux-image-generic                4.4.0.77.83                                amd64        Generic Linux kernel image

Что бы я ни попробовал, это не сработает:

root@ubuntu-nextcloud:/home/nextcloud# sudo apt-get purge linux-image-4.4.0-31-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-image-extra-4.4.0-31-generic : Depends: linux-image-4.4.0-31-generic but it is not going to be installed
 linux-image-extra-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
                       Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Следующая попытка

root@ubuntu-nextcloud:/home/nextcloud# purge-old-kernels --keep 3
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.4.0-31-generic : Depends: linux-image-4.4.0-31-generic but it is not going to be installed
 linux-image-extra-4.4.0-59-generic : Depends: linux-image-4.4.0-59-generic but it is not going to be installed
 linux-image-extra-4.4.0-62-generic : Depends: linux-image-4.4.0-62-generic but it is not going to be installed
 linux-image-extra-4.4.0-63-generic : Depends: linux-image-4.4.0-63-generic but it is not going to be installed
 linux-image-extra-4.4.0-64-generic : Depends: linux-image-4.4.0-64-generic but it is not going to be installed
 linux-image-extra-4.4.0-66-generic : Depends: linux-image-4.4.0-66-generic but it is not going to be installed
 linux-image-extra-4.4.0-67-generic : Depends: linux-image-4.4.0-67-generic but it is not going to be installed
 linux-image-extra-4.4.0-70-generic : Depends: linux-image-4.4.0-70-generic but it is not going to be installed
 linux-image-extra-4.4.0-77-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
                       Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Следующая попытка

root@ubuntu-nextcloud:/home/nextcloud# dpkg -l linux-* | awk '/^ii/{ print $2}' | grep -v -e `uname -r | cut -f1,2 -d"-"` | grep -e [0-9] | grep -E "(image|headers)" | xargs sudo apt-get -y purge
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.4.0-77-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
 linux-image-generic : Depends: linux-image-4.4.0-77-generic but it is not going to be installed
                       Recommends: thermald but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

Последняя идея

    root@ubuntu-nextcloud:/home/nextcloud# apt-get autoremove -f
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following additional packages will be installed:
  linux-image-4.4.0-77-generic
Suggested packages:
  fdutils linux-doc-4.4.0 | linux-source-4.4.0 linux-tools
The following NEW packages will be installed:
  linux-image-4.4.0-77-generic
0 upgraded, 1 newly installed, 0 to remove and 1 not upgraded.
12 not fully installed or removed.
Need to get 0 B/21.9 MB of archives.
After this operation, 66.8 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 414438 files and directories currently installed.)
Preparing to unpack .../linux-image-4.4.0-77-generic_4.4.0-77.98_amd64.deb ...
Done.
Unpacking linux-image-4.4.0-77-generic (4.4.0-77.98) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-77-generic_4.4.0-77.98_amd64.deb (--unpack):
 cannot copy extracted data for './boot/abi-4.4.0-77-generic' to '/boot/abi-4.4.0-77-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.4.0-77-generic /boot/vmlinuz-4.4.0-77-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 4.4.0-77-generic /boot/vmlinuz-4.4.0-77-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-4.4.0-77-generic_4.4.0-77.98_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
root@ubuntu-nextcloud:/home/nextcloud# 

РЕДАКТИРОВАТЬ: Только временное перемещение старых файлов ядра во временную папку сработало, путем создания небольшого количества пространства и позволяя командам работать снова.

0
задан 4 June 2017 в 12:29

2 ответа

cd /boot

Определяют местоположение самого старого ядра в /boot каталог:

sudo dpkg --force-all -P Full_name_of_oldest_kernel
sudo apt autoremove --purge

существует множество способов автоматизировать вышеупомянутую команду для устойчивости. cron job, например.

0
ответ дан 3 November 2019 в 03:41

Я получил его, работал:

  1. Создают временную папку (например,/home/user/temp)
  2. Выполнение uname-r для расчета его, какое ядро работает, и не касайтесь этого!
  3. Перемещение файлы ядра specifig неиспользованного ядра к этой временной папке.

Вы получите некоторое пространство, и команда должна работать снова. Источник: http://natesbox.com/blog/ubuntu-unable-to-installupdate-packages-full-boot-partition/

пз: Я забыл устанавливать, автоудаляют для этого сервера для автоматических обновлений. Я думаю, что это, возможно, вызвало проблему.

-1
ответ дан 3 November 2019 в 03:41

Другие вопросы по тегам:

Похожие вопросы: