Wolne miejsce na partycji / boot z pętlą zależności


1

Podsumowując, moim problemem jest to, że moja partycja / boot jest prawie pełna, ale nie mogę jej zwolnić z powodu niektórych pętli zależności.

Szczegółowy opis:

Korzystam z systemu Ubuntu 14.04.2 LTS, który ma prawie pełną partycję / boot

/boot is using 97.9% of 235MB

Moje jądro:

$ uname -r
3.16.0-39-generic

Oto moje zainstalowane jądra (z jakiegoś powodu używane przeze mnie jądro nie jest najnowsze):

$ sudo dpkg --list 'linux-image*'
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                                    Version                  Architecture             Description
+++-=======================================-========================-========================-===================================================================================
un  linux-image                             <none>                   <none>                   (no description available)
un  linux-image-3.0                         <none>                   <none>                   (no description available)
ii  linux-image-3.16.0-30-generic           3.16.0-30.40~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-33-generic           3.16.0-33.44~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-34-generic           3.16.0-34.47~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-36-generic           3.16.0-36.48~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-37-generic           3.16.0-37.51~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-38-generic           3.16.0-38.52~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-39-generic           3.16.0-39.53~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-3.16.0-41-generic           3.16.0-41.55~14.04.1     amd64                    Linux kernel image for version 3.16.0 on 64 bit x86 SMP
in  linux-image-3.16.0-43-generic           <none>                   amd64                    (no description available)
ii  linux-image-extra-3.16.0-30-generic     3.16.0-30.40~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-33-generic     3.16.0-33.44~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-34-generic     3.16.0-34.47~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-36-generic     3.16.0-36.48~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-37-generic     3.16.0-37.51~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
ii  linux-image-extra-3.16.0-38-generic     3.16.0-38.52~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iF  linux-image-extra-3.16.0-39-generic     3.16.0-39.53~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-41-generic     3.16.0-41.57~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-extra-3.16.0-43-generic     3.16.0-43.58~14.04.1     amd64                    Linux kernel extra modules for version 3.16.0 on 64 bit x86 SMP
iU  linux-image-generic-lts-utopic          3.16.0.43.34             amd64                    Generic Linux kernel image

Jak dotąd tak dobrze, teraz możesz pomyśleć „po prostu usuń jądra, których nie potrzebujesz i to wszystko”, więc okazuje się, że nie mogę wyczyścić:

$ 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-3.16.0-43-generic : Depends: linux-image-3.16.0-43-generic but it is not installed
 linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-43-generic but it is not installed
E: Unmet dependencies. Try using -f.

Próbując usunąć jedną paczkę, otrzymuję prawie to samo:

$ sudo apt-get remove --purge linux-image-3.16.0-30-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-3.16.0-30-generic : Depends: linux-image-3.16.0-30-generic but it is not going to be installed
 linux-image-extra-3.16.0-43-generic : Depends: linux-image-3.16.0-43-generic but it is not going to be installed
 linux-image-extra-3.16.0-45-generic : Depends: linux-image-3.16.0-45-generic but it is not going to be installed
 linux-image-generic-lts-utopic : Depends: linux-image-3.16.0-45-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).

No dobrze, więc zróbmy to, co sugeruje Ubuntu, abyśmy wykonali polecenie „apt-get -f install” ... cóż, zdarza się, że mi to nie pozwala, ponieważ nie mam wystarczającej ilości miejsca:

$ 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:
  linux-headers-3.16.0-30 linux-headers-3.16.0-30-generic
  linux-headers-3.16.0-33 linux-headers-3.16.0-33-generic
  linux-headers-3.16.0-34 linux-headers-3.16.0-34-generic
  linux-headers-3.16.0-37 linux-headers-3.16.0-37-generic
  linux-headers-3.16.0-38 linux-headers-3.16.0-38-generic
  linux-headers-3.16.0-41 linux-headers-3.16.0-41-generic
  linux-headers-3.16.0-43 linux-headers-3.16.0-43-generic
  linux-image-3.16.0-30-generic linux-image-3.16.0-33-generic
  linux-image-3.16.0-34-generic linux-image-3.16.0-37-generic
  linux-image-3.16.0-38-generic linux-image-3.16.0-41-generic
  linux-image-3.16.0-43-generic linux-image-extra-3.16.0-30-generic
  linux-image-extra-3.16.0-33-generic linux-image-extra-3.16.0-34-generic
  linux-image-extra-3.16.0-37-generic linux-image-extra-3.16.0-38-generic
  linux-image-extra-3.16.0-41-generic linux-image-extra-3.16.0-43-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  linux-generic-lts-utopic linux-headers-3.16.0-45
  linux-headers-3.16.0-45-generic linux-headers-generic-lts-utopic
  linux-image-3.16.0-43-generic linux-image-3.16.0-45-generic
  linux-image-extra-3.16.0-45-generic linux-image-generic-lts-utopic
Suggested packages:
  fdutils linux-lts-utopic-tools
The following NEW packages will be installed
  linux-headers-3.16.0-45 linux-headers-3.16.0-45-generic
  linux-image-3.16.0-43-generic linux-image-3.16.0-45-generic
  linux-image-extra-3.16.0-45-generic
The following packages will be upgraded:
  linux-generic-lts-utopic linux-headers-generic-lts-utopic
  linux-image-generic-lts-utopic
3 to upgrade, 5 to newly install, 0 to remove and 78 not to upgrade.
21 not fully installed or removed.
Need to get 63.5 MB/79.6 MB of archives.
After this operation, 325 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-3.16.0-45-generic amd64 3.16.0-45.60~14.04.1 [16.2 MB]
Get:2 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-extra-3.16.0-45-generic amd64 3.16.0-45.60~14.04.1 [37.6 MB]
Get:3 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-generic-lts-utopic amd64 3.16.0.45.36 [1,802 B]
Get:4 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-image-generic-lts-utopic amd64 3.16.0.45.36 [2,280 B]
Get:5 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-3.16.0-45 all 3.16.0-45.60~14.04.1 [9,052 kB]
Get:6 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-3.16.0-45-generic amd64 3.16.0-45.60~14.04.1 [708 kB]
Get:7 http://gb.archive.ubuntu.com/ubuntu/ trusty-updates/main linux-headers-generic-lts-utopic amd64 3.16.0.45.36 [2,268 B]
Fetched 63.5 MB in 1s (50.7 MB/s)                       
Selecting previously unselected package linux-image-3.16.0-45-generic.
(Reading database ... 290402 files and directories currently installed.)
Preparing to unpack .../linux-image-3.16.0-45-generic_3.16.0-45.60~14.04.1_amd64.deb ...
Done.
Unpacking linux-image-3.16.0-45-generic (3.16.0-45.60~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-45-generic_3.16.0-45.60~14.04.1_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.16.0-45-generic' to '/boot/vmlinuz-3.16.0-45-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 3.16.0-45-generic /boot/vmlinuz-3.16.0-45-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-45-generic /boot/vmlinuz-3.16.0-45-generic
Selecting previously unselected package linux-image-extra-3.16.0-45-generic.
Preparing to unpack .../linux-image-extra-3.16.0-45-generic_3.16.0-45.60~14.04.1_amd64.deb ...
Unpacking linux-image-extra-3.16.0-45-generic (3.16.0-45.60~14.04.1) ...
Preparing to unpack .../linux-generic-lts-utopic_3.16.0.45.36_amd64.deb ...
Unpacking linux-generic-lts-utopic (3.16.0.45.36) over (3.16.0.43.34) ...
Preparing to unpack .../linux-image-generic-lts-utopic_3.16.0.45.36_amd64.deb ...
Unpacking linux-image-generic-lts-utopic (3.16.0.45.36) over (3.16.0.43.34) ...
Selecting previously unselected package linux-headers-3.16.0-45.
Preparing to unpack .../linux-headers-3.16.0-45_3.16.0-45.60~14.04.1_all.deb ...
Unpacking linux-headers-3.16.0-45 (3.16.0-45.60~14.04.1) ...
Selecting previously unselected package linux-headers-3.16.0-45-generic.
Preparing to unpack .../linux-headers-3.16.0-45-generic_3.16.0-45.60~14.04.1_amd64.deb ...
Unpacking linux-headers-3.16.0-45-generic (3.16.0-45.60~14.04.1) ...
Preparing to unpack .../linux-headers-generic-lts-utopic_3.16.0.45.36_amd64.deb ...
Unpacking linux-headers-generic-lts-utopic (3.16.0.45.36) over (3.16.0.43.34) ...
Preparing to unpack .../linux-image-3.16.0-43-generic_3.16.0-43.58~14.04.1_amd64.deb ...
Done.
Unpacking linux-image-3.16.0-43-generic (3.16.0-43.58~14.04.1) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-3.16.0-43-generic_3.16.0-43.58~14.04.1_amd64.deb (--unpack):
 cannot copy extracted data for './boot/vmlinuz-3.16.0-43-generic' to '/boot/vmlinuz-3.16.0-43-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 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.16.0-43-generic /boot/vmlinuz-3.16.0-43-generic
Errors were encountered while processing:
 /var/cache/apt/archives/linux-image-3.16.0-45-generic_3.16.0-45.60~14.04.1_amd64.deb
 /var/cache/apt/archives/linux-image-3.16.0-43-generic_3.16.0-43.58~14.04.1_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Czy znasz jakieś obejście tego problemu?


Co się stanie, jeśli spróbujesz apt-get remove --purgepojedynczego pakietu wersji jądra?
CVn

@ MichaelKjörling Otrzymuję prawie taki sam błąd, jak gdybym próbował wyczyścić wszystko. Właśnie dodałem dane wyjściowe dla jednego pakietu tylko w opisie
Juancho Ramone

Odpowiedzi:


4

Udało mi się zautomatyzować proces zgodnie z przykładem w http://ubuntuforums.org/showthread.php?t=1927867&p=11706655#post11706655

dpkg -l linux-* | awk '/^ii/{ print $2 }' | grep "\-3.5." | xargs dpkg --purge --dry-run

w moim przypadku, aby usunąć wszystkie stare jądra 3.5 * - zamieniając apt-get remove na dpkg --purge, ponieważ właśnie wszedł w pętlę z apt-get.

Usunąłem opcję --dry-run po przetestowaniu wyniku

dpkg -l linux-* | awk '/^ii/{ print $2 }' | grep "\-3.5." | xargs dpkg --purge

Następnie

apt-get -f install

aby ukończyć zepsutą instalację.


2

Udało mi się to naprawić, usuwając jeden po drugim pakiety z niespełnionymi zależnościami za pomocą tego polecenia:

sudo dpkg --purge package-name

i wtedy

sudo apt-get autoremove
Korzystając z naszej strony potwierdzasz, że przeczytałeś(-aś) i rozumiesz nasze zasady używania plików cookie i zasady ochrony prywatności.
Licensed under cc by-sa 3.0 with attribution required.