我今天试图更新我的软件包:
$ sudo apt-get upgrade
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-headers-3.16.0-44-generic : Depends: linux-headers-3.16.0-44 but it is not installed
E: Unmet dependencies. Try using -f.
Run Code Online (Sandbox Code Playgroud)
所以,我继续尝试apt-get -f install:
$ sudo 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.16.0-44
The following NEW packages will be installed:
linux-headers-3.16.0-44
0 upgraded, 1 newly installed, 0 to remove and 3 not upgraded.
3 not fully installed or removed.
Need to get 0 B/9,101 kB of archives.
After this operation, 64.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
(Reading database ... 688666 files and directories currently installed.)
Preparing to unpack .../linux-headers-3.16.0-44_3.16.0-44.59_all.deb ...
Unpacking linux-headers-3.16.0-44 (3.16.0-44.59) ...
dpkg: error processing archive /var/cache/apt/archives/linux-headers-3.16.0-44_3.16.0-44.59_all.deb (--unpack):
unable to create `/usr/src/linux-headers-3.16.0-44/scripts/genksyms/Makefile.dpkg-new' (while processing `./usr/src/linux-headers-3.16.0-44/scripts/genksyms/Makefile'): No space left on device
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Errors were encountered while processing:
/var/cache/apt/archives/linux-headers-3.16.0-44_3.16.0-44.59_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)
Run Code Online (Sandbox Code Playgroud)
抱怨说No space left on device。df -Th告诉我有足够的空间:
$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda6 3.3G 2.5G 571M 82% /
udev 2.0G 0 2.0G 0% /dev
tmpfs 395M 11M 384M 3% /run
tmpfs 2.0G 28M 1.9G 2% /dev/shm
tmpfs 2.0G 0 2.0G 0% /sys/fs/cgroup
tmpfs 100M 72K 100M 1% /run/user
tmpfs 5.0M 8.0K 5.0M 1% /run/lock
/dev/sda7 9.3G 7.6G 1.3G 87% /usr
/dev/sda8 188G 176G 3.0G 99% /home
/dev/sda1 945M 394M 487M 45% /boot
/dev/sda9 256G 9.6G 233G 4% /var
Run Code Online (Sandbox Code Playgroud)
但是,df -i告诉我/usr已经用完了所有的inode。
这些是目录及其 inode 用法:
/usr/bin = 2846
/usr/etc = 1
/usr/games = 8
/usr/include = 3204
/usr/lib = 42317
/usr/local = 105
/usr/lost+found = 1
/usr/sbin = 306
/usr/share = 228141
/usr/src = 348704
Run Code Online (Sandbox Code Playgroud)
因此,如果我可以清除/usr/src(其中包含当前和旧内核),我可能可以解决问题。但是,我一直遇到第一个错误:
$ sudo apt-get purge linux-image-3.8.0-35-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-headers-3.16.0-44-generic : Depends: linux-headers-3.16.0-44 but it is not going to be installed
linux-image-extra-3.8.0-35-generic : Depends: linux-image-3.8.0-35-generic but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
Run Code Online (Sandbox Code Playgroud)
关于如何删除旧内核的任何建议?谢谢!
我的选择和时间都用完了,所以我尝试了这个,它奏效了:
我想出了我正在使用的内核:
$ uname -r
3.16.0-44-generic
Run Code Online (Sandbox Code Playgroud)
我决定将真正旧的内核移到我的外部存储中:
sudo mv linux-headers-3.8* /media/housni/linux-headers
Run Code Online (Sandbox Code Playgroud)
df -i 然后显示大量的 inode 已被释放,因此我迅速卸载了我知道不需要的标头:
sudo apt-get purge linux-headers-3.8*
Run Code Online (Sandbox Code Playgroud)
之后,我更新了 grub 并重新启动
sudo update-grub2 && sudo shutdown now -r
Run Code Online (Sandbox Code Playgroud)
然后我做了一些额外的清理工作,比如清理我的缓存 ( sudo apt-get clean) 并运行 autoremove ( sudo apt-get autoremove) 只是为了安全,现在一切似乎都恢复正常了:)
| 归档时间: |
|
| 查看次数: |
2780 次 |
| 最近记录: |