我知道对此有很多疑问,但我已经经历过很多了,似乎无法解决问题。
迄今步骤 -
- 通过 apt 删除旧内核 -> 由于空间不足而失败
因此,我继续尝试备份旧内核并将其从 /boot 中删除,以便创建空间来运行 apt-get -f install,但这仍然失败,出现以下情况:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following extra packages will be installed:
linux-headers-3.13.0-63
The following NEW packages will be installed:
linux-headers-3.13.0-63
0 upgraded, 1 newly installed, 0 to remove and 64 not upgraded.
7 not fully installed or removed.
Need to get 8,874 kB of archives.
After this operation, 63.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://mirror.eu.oneandone.net/ubuntu/ubuntu/ trusty-updates/main linux-headers-3.13.0-63 all 3.13.0-63.103 [8,874 kB]
Fetched 8,874 kB in 0s (9,998 kB/s)
(Reading database ... 330796 files and directories currently installed.)
Preparing to unpack .../linux-headers-3.13.0-63_3.13.0-63.103_all.deb ...
Unpacking linux-headers-3.13.0-63 (3.13.0-63.103) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.13.0-63_3.13.0-63.103_all.deb (--unpack):
unable to create `/usr/src/linux-headers-3.13.0-63/net/unix/Makefile.dpkg-new' (while processing `./usr/src/linux-headers-3.13.0-63/net/unix/Makefile'): 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-63_3.13.0-63.103_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
我已经阅读了关于这个问题的许多问题,但有点害怕开始运行随机命令,因为大多数人的问题似乎很容易解决,而且我不知道他们中的一些人在做什么!
以下是一些系统信息:
# uname -r
3.13.0-62-generic
-
# du -sk *|sort -n
48 lost+found
168 config-3.13.0-59-generic
168 config-3.13.0-61-generic
168 config-3.13.0-62-generic
168 config-3.13.0-63-generic
180 memtest86+.bin
180 memtest86+.elf
180 memtest86+_multiboot.bin
1144 abi-3.13.0-59-generic
1144 abi-3.13.0-61-generic
1144 abi-3.13.0-62-generic
1144 abi-3.13.0-63-generic
3320 System.map-3.13.0-59-generic
3320 System.map-3.13.0-61-generic
3320 System.map-3.13.0-62-generic
3320 System.map-3.13.0-63-generic
5084 grub
5700 vmlinuz-3.13.0-59-generic
5700 vmlinuz-3.13.0-61-generic
5700 vmlinuz-3.13.0-62-generic
5700 vmlinuz-3.13.0-63-generic
19840 initrd.img-3.13.0-59-generic
19844 initrd.img-3.13.0-61-generic
19844 initrd.img-3.13.0-62-generic
-
# df
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/md1 4095616 2243320 1852296 55% /
none 4 0 4 0% /sys/fs/cgroup
udev 4072164 4 4072160 1% /dev
tmpfs 816696 1076 815620 1% /run
none 5120 0 5120 0% /run/lock
none 4083476 8 4083468 1% /run/shm
none 102400 0 102400 0% /run/user
/dev/mapper/vg00-usr 3997376 2231708 1539572 60% /usr
/dev/mapper/vg00-var 3997376 1815572 1955708 49% /var
/dev/mapper/vg00-home 3997376 8188 3763092 1% /home
-
# df -h /boot
Filesystem Size Used Avail Use% Mounted on
/dev/md1 4.0G 2.2G 1.8G 55% /
有人能告诉我这里发生了什么吗?因为 /boot 中似乎还有空间。我对 Linux 还不熟悉,所以请慢慢来 :),如果您需要更多信息,请告诉我,谢谢!
编辑:
# df -i /usr
Filesystem Inodes IUsed IFree IUse% Mounted on
/dev/mapper/vg00-usr 262144 259723 2421 100% /usr
答案1
您的文件系统中的文件太多(可能非常小)。您需要删除文件才能继续。要查找包含大多数文件的文件夹,您可以使用类似下面的命令:
for FOLDER in $(ls -d1 /*/); do printf "$(find ${FOLDER} 2>/dev/null |wc -l)\t${FOLDER}\n"; done |sort -rn |head -n10
for FOLDER in $(ls -d1 /usr/*/); do printf "$(find ${FOLDER} 2>/dev/null |wc -l)\t${FOLDER}\n"; done |sort -rn |head -n10
for FOLDER in $(ls -d1 /usr/src/*/); do printf "$(find ${FOLDER} 2>/dev/null |wc -l)\t${FOLDER}\n"; done |sort -rn |head -n10
...
否则,您将需要备份您的系统并使用 创建一个新的文件系统mke2fs
,使用-N
选项来控制 inode 的数量。