我在华硕定制服务器上运行 12.04 LTS。我提前道歉,因为我最近花更多时间在网络设备上,所以我的 Linux 技能有些生疏了。
sudo apt-get upgrade
我跑步后继续跑步sudo apt-get update
,得到以下结果:
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-server : Depends: linux-image-3.2.0-39-generic but it is not installed
linux-server : Depends: linux-headers-server (= 3.2.0.39.47) but 3.2.0.40.48 is installed
E: Unmet dependencies. Try using -f.
因此当我运行时,sudo apt-get -f install
我得到以下信息:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Correcting dependencies... Done
The following package was automatically installed and is no longer required:
linux-image-3.2.0-37-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-image-3.2.0-40-generic linux-image-server linux-server
Suggested packages:
fdutils linux-doc-3.2.0 linux-source-3.2.0 linux-tools
The following NEW packages will be installed:
linux-image-3.2.0-40-generic
The following packages will be upgraded:
linux-image-server linux-server
2 upgraded, 1 newly installed, 0 to remove and 124 not upgraded.
3 not fully installed or removed.
Need to get 0 B/38.6 MB of archives.
After this operation, 150 MB of additional disk space will be used.
Do you want to continue [Y/n]? y
(Reading database ... 373700 files and directories currently installed.)
Unpacking linux-image-3.2.0-40-generic (from .../linux-image-3.2.0-40-generic_3.2.0-40.64_amd64.deb) ...
Done.
dpkg: error processing /var/cache/apt/archives/linux-image-3.2.0-40-generic_3.2.0-40.64_amd64.deb (--unpack):
failed in write on buffer copy for backend dpkg-deb during ./boot/abi-3.2.0-40-generic': 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.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
run-parts: executing /etc/kernel/postrm.d/zz-update-grub 3.2.0-40-generic /boot/vmlinuz-3.2.0-40-generic
Errors were encountered while processing:
/var/cache/apt/archives/linux-image-3.2.0-40-generic_3.2.0-40.64_amd64.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)`
如您所见,出现了磁盘已满错误消息,因此我尝试按照我在另一问题上发现的流程清除一些未使用的内核。
我运行了xxxx 是一个我没有使用的内核版本,但我得到了与运行时sudo apt-get purge linux-image-x.x.x.x-generic
相同的建议运行错误。apt-get -f install
sudo apt-get upgrade
是不是有什么我忘了的东西可以帮助我清理这里的空间,或者有其他方法可以清除不需要的内核映像?
尝试运行sudo dpkg --configure -a
结果:
Setting up initramfs-tools (0.99ubuntu13.1) ...
update-initramfs: deferring update (trigger activated)
dpkg: dependency problems prevent configuration of linux-image-server:
linux-image-server depends on linux-image-3.2.0-39-generic; however:
Package linux-image-3.2.0-39-generic is not installed.
dpkg: error processing linux-image-server (--configure):
dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of linux-server:
linux-server depends on linux-image-server (= 3.2.0.39.47); however:
Package linux-image-server is not configured yet.
linux-server depends on linux-headers-server (= 3.2.0.39.47); however:
Version of linux-headers-server on system is 3.2.0.40.48.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
Processing triggers for initramfs-tools ...
update-initramfs: Generating /boot/initrd.img-3.2.0-38-generic
gzip: stdout: No space left on device
E: mkinitramfs failure cpio 141 gzip 1
update-initramfs: failed for /boot/initrd.img-3.2.0-38-generic with 1.
dpkg: error processing initramfs-tools (--configure):
subprocess installed post-installation script returned error exit status 1
Errors were encountered while processing:
linux-image-server
linux-server
initramfs-tools
结果df -h
。我怎么也想不起来查看空间的命令。看到启动大小,我笑了,尤其是因为它在那个 500GB 的驱动器上,而且那里用得不多。我无法从 /dev/sdb1 窃取,因为那是独立的物理驱动器,用于所有用户共享空间,如果需要,可以轻松取出并移动到任何系统。
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/NAS-root 455G 11G 421G 3% /
udev 2.0G 4.0K 2.0G 1% /dev
tmpfs 791M 768K 790M 1% /run
none 5.0M 0 5.0M 0% /run/lock
none 2.0G 0 2.0G 0% /run/shm
/dev/sdb1 1.8T 929G 813G 54% /media/windows
/dev/sda1 228M 228M 0 100% /boot
我不记得我什么时候构建了这台服务器,但这将是我最后一次让它自动选择分区大小。我猜我最好的选择是按照这些说明来增加分区大小? http://ubuntuforums.org/showthread.php?t=1219270
是否担心从 /dev/mapper/NAS-root 窃取数据会造成损坏?
好吧,我终于正确地清理了空间,但是在尝试运行时仍然遇到依赖问题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-image-server linux-server
The following packages will be upgraded:
linux-image-server linux-server
2 upgraded, 0 newly installed, 0 to remove and 124 not upgraded.
2 not fully installed or removed.
Need to get 0 B/4,320 B of archives.
After this operation, 2,048 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of linux-image-server:
linux-image-server depends on linux-image-3.2.0-39-generic; however:
Package linux-image-3.2.0-39-generic is not installed.
dpkg: error processing linux-image-server (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
dpkg: dependency problems prevent configuration of linux-server:
linux-server depends on linux-image-server (= 3.2.0.39.47); however:
Package linux-image-server is not configured yet.
linux-server depends on linux-headers-server (= 3.2.0.39.47); however:
Version of linux-headers-server on system is 3.2.0.40.48.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
No apport report written because MaxReports is reached already
Errors were encountered while processing:
linux-image-server
linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
不确定如何开始解决这个问题,因为那里有一个较新版本的内核文件,但它正在寻找一个较旧的版本。
答案1
如果sudo apt-get -f install
没有效果,那么尝试这个:
sudo apt-get clean
或者,
sudo apt-get 自动清理
对于sudo apt-get -f install
,尝试运行:
sudo dpkg--configure-a
然后运行:
sudo apt-get -f 安装
希望这可以帮助!