Я встретился со следующей ошибкой при обновлении моего сервера Ubuntu 12.04. Теперь apt-get
не может установить или удалил любой пакет.
Unpacking linux-headers-3.13.0-62 (from .../linux-headers-3.13.0-62_3.13.0-62.102~precise1_all.deb) ... dpkg: error processing /var/cache/apt/archives/linux-headers-3.13.0-62_3.13.0-62.102~precise1_all.deb (--unpack): unable to create `/usr/src/linux-headers-3.13.0-62/arch/arm/include/asm/ptrace.h.dpkg-new' (while processing `./usr/src/linux-headers-3.13.0-62/arch/arm/include/asm/ptrace.h'): 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-3.13.0-62_3.13.0-62.102~precise1_all.deb E: Sub-process /usr/bin/dpkg returned an error code (1)
Хотя я не действительно вне дискового пространства,
# df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 6.8G 4.7G 1.8G 69% /
Во всяком случае мои inodes полны,
# df -i
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/sda1 458752 455214 3538 100% /
У меня есть больше чем десять старых ядер, но я не могу удалить тех как мой apt-get
самостоятельно Ламе. Таким образом, я не могу следовать этому сообщению, которое сообщает о подобной проблеме.
Единственная опция, кажется, удаляет несколько более старых ядер вручную. Это вызовет какую-либо проблему?
Есть ли какой-либо лучший выход? Я могу использовать зарезервированное пространство для корня в настоящее время и удалить более старые ядра?
Я знаю, что это сообщение немного старо, но я нашел ответ здесь для кого-либо, который может наткнуться на это сообщение: https://help.ubuntu.com/community/RemoveOldKernels
В случае, если та связь разорвана, вот является соответствующим отрывком:
Для пользователей систем LVM, зашифрованных систем или ограниченных систем хранения, самая частая проблема - то, что / раздел начальной загрузки просто полон. Диспетчер пакетов не может установить незаконченное обновление из-за недостатка места. Кроме того, склонный - добираются, не может удалить пакет из-за поврежденной зависимости.
Эта проблема может быть решена быстро и легко от оболочки. Просто определите одно или два старых ядра для удаления вручную, который предоставит диспетчеру пакетов достаточно пространства для установки обновления с очередями.
$ sudo rm -rv ${TMPDIR:-/var/tmp}/mkinitramfs-*
## In Ubuntu 16.04 and earlier there may be leftover temporary
## files to delete.
## See: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=814345
$ uname -r ## This command identifies the currently-running kernel
4.2.0-21-generic ## This is the current kernel.
## DO NOT REMOVE it!
$ dpkg -l | tail -n +6 | grep -E 'linux-image-[0-9]+' | grep -Fv $(uname -r)
## This command lists all the kernels excluding the booted
## kernel in the package database, and their status.
rc linux-image-4.2.0-14-generic ## The oldest kernel in the database
## Status 'rc' means it's already been removed
ii linux-image-4.2.0-15-generic ## The oldest installed kernel. Eligible for removal.
## Status 'ii' means Installed.
ii linux-image-4.2.0-16-generic ## Another old installed kernel. Eligible for removal
ii linux-image-4.2.0-18-generic ## Another old installed kernel. Eligible for removal
ii linux-image-4.2.0-19-generic ## The previous good kernel. Keep
iU linux-image-4.2.0-22-generic ## DO NOT REMOVE. Status 'iU' means it's not installed,
## but queued for install in apt.
## This is the package we want apt to install.
## Purge the oldest kernel package using dpkg instead of apt.
## First you need to remove the image initrd.img file manually
## due to Bug #1678187.
$ sudo update-initramfs -d -k 4.2.0-15-generic
$ sudo dpkg --purge linux-image-4.2.0-15-generic linux-image-extra-4.2.0-15-generic
## If the previous command fails, some installed package
## depends on the kernel. The output of dpkg tells the name
## of the package. Purge it first.
## Also purge the respective header package.
$ sudo dpkg --purge linux-headers-4.2.0-15-generic
## Try also purging the common header package.
$ sudo dpkg --purge linux-headers-4.2.0-15
## Do not worry, if the previous command fails.
$ sudo apt-get -f install ## Try to fix the broken dependency.
я следовал за этим с:
sudo apt-get autoremove --purge
Я нашел теперь выход из ситуации и удалил несколько более старых ядер от /usr/src
для избавлений от ситуации. К счастью, все подходило и способная запущенная работа снова.
Это настоятельно рекомендовано для забирания прежде, чем удалить более старые ядра на производственной машине.