Удалите старые ядра из /boot, чтобы освободить место
Я хочу освободить часть пространства в /boot, но я не могу это сделать.
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 474730 463590 0 100% /boot
я пытался sudo apt-get autoremove --purge
но следующая ошибка
sudo apt-get autoremove --purge
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
linux-image-extra-4.4.0-137-generic : Depends: linux-image-4.4.0-137-generic but it is not installed
linux-image-extra-4.4.0-142-generic : Depends: linux-image-4.4.0-142-generic but it is not installed
linux-image-generic : Depends: linux-image-4.4.0-142-generic but it is not installed
Recommends: thermald but it is not installed
E: Unmet dependencies. Try using -f.
я пытался sudo apt-get -f install
но из-за отсутствия свободного места я не могу успешно запустить его и получаю следующую ошибку
Unpacking linux-image-4.4.0-137-generic (4.4.0-137.163) ...
dpkg: error processing archive /var/cache/apt/archives/linux-image-4.4.0-
137-generic_4.4.0-137.163_amd64.deb (--unpack):
cannot copy extracted data for './boot/abi-4.4.0-137-generic' to '/boot/abi-
4.4.0-137-generic.dpkg-new': failed to write (No space left on device)
Я также пытался удалить его с помощью dpkg
со следующим кодом
dpkg --list | grep linux-image | awk '{ print $2 }' | sort -V | sed -n '/'`uname -r`'/q;p' | xargs sudo apt-get -y purge
Я получил следующую ошибку для вышеуказанной команды.
root@servername:/# dpkg --list | grep linux-image | awk '{ print $2 }' |
sort -V | sed -n '/'`uname -r`'/q;p' | 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-112-generic : Depends: linux-image-4.4.0-112-generic
but it is not going to be installed
linux-image-extra-4.4.0-116-generic : Depends: linux-image-4.4.0-116-generic
but it is not going to be installed
linux-image-extra-4.4.0-119-generic : Depends: linux-image-4.4.0-119-generic
but it is not going to be installed
linux-image-extra-4.4.0-121-generic : Depends: linux-image-4.4.0-121-generic
but it is not going to be installed
linux-image-extra-4.4.0-124-generic : Depends: linux-image-4.4.0-124-generic
but it is not going to be installed
linux-image-extra-4.4.0-127-generic : Depends: linux-image-4.4.0-127-generic
but it is not going to be installed
linux-image-extra-4.4.0-128-generic : Depends: linux-image-4.4.0-128-generic
but it is not going to be installed
linux-image-extra-4.4.0-21-generic : Depends: linux-image-4.4.0-21-generic
but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-142-generic but it is not
going to be installed
Depends: linux-image-extra-4.4.0-142-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@servername:/# sudo apt-get purge linux-image-4.4.0-112-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-112-generic : Depends: linux-image-4.4.0-112-generic
but it is not going to be installed
linux-image-generic : Depends: linux-image-4.4.0-142-generic but it is not
going to be installed
Depends: linux-image-extra-4.4.0-142-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).
Я тоже пробовал с sudo rm -rf /boot/*-34.4.0-{112,116,119,121,124,127,128,21}-*
но все равно не повезло.
Кто-нибудь знает как это решить?
Заранее спасибо.
1 ответ
Решение
Единственное решение - удалить их вручную, это будет первый раз, когда rm -rf не работает. Ваши условия не соответствуют, вероятно.
sudo rm -rf /boot/*-4.4.0-{112,116,119,121,124,127,128,21}-*