因磁盘已满而导致 apt-get upgrade 失败并恢复

因磁盘已满而导致 apt-get upgrade 失败并恢复

我正在对一个 Ubuntu 12.04.5 LTS 机器执行 apt-get 升级,这个机器已经有一段时间没有更新了,升级失败,原因是“设备上没有剩余空间”。过了一会儿,我才明白空间指的是 inode,我释放了一些空间,但不幸的是,事情有些不对劲。我尝试使用 dpkg -i 手动安装提到的旧版本软件包,但这没有帮助。

我尝试过 apt-get upgrade 和 apt-get -f install,但无济于事。结果如下。有什么办法可以解决这个问题吗?


固定的:

通过 dpkg -i 然后 apt-get -f install 再次手动安装早期版本已成功。不确定为什么第一次没有成功。下面列出了相关软件包,但它们可能会有所不同。

libssl1.0.0_1.0.1-4ubuntu5.14_i386.deb 
linux-headers-3.2.0-64-generic-pae_3.2.0-64.97_i386.deb 
linux-image-generic-pae_3.2.0.64.76_i386.deb 
linux-headers-3.2.0-64_3.2.0-64.97_all.deb linux-headers-generic-pae_3.2.0.64.76_i386.deb

root@unlinked:/tmp# 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.
 libssl-dev : Depends: libssl1.0.0 (= 1.0.1-4ubuntu5.14) but 1.0.1-4ubuntu5.17 is installed
 linux-generic-pae : Depends: linux-image-generic-pae (= 3.2.0.64.76) but 3.2.0.67.79 is installed
                     Depends: linux-headers-generic-pae (= 3.2.0.64.76) but 3.2.0.67.79 is installed
E: Unmet dependencies. Try using -f.

root@unlinked:/tmp# apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages were automatically installed and are no longer required:
  linux-headers-3.2.0-43-generic-pae linux-headers-3.2.0-38-generic-pae linux-headers-3.2.0-41-generic-pae linux-headers-3.2.0-36-generic-pae
  linux-headers-3.2.0-63-generic-pae linux-headers-3.2.0-58-generic-pae linux-headers-3.2.0-60-generic-pae linux-headers-3.2.0-55-generic-pae linux-headers-3.2.0-40
  linux-headers-3.2.0-41 linux-headers-3.2.0-36 linux-headers-3.2.0-37 linux-headers-3.2.0-43 linux-headers-3.2.0-38 linux-headers-3.2.0-44 linux-headers-3.2.0-39
  linux-headers-3.2.0-45 linux-headers-3.2.0-51 linux-headers-3.2.0-52 linux-headers-3.2.0-53 linux-headers-3.2.0-48 linux-headers-3.2.0-54 linux-headers-3.2.0-60
  linux-headers-3.2.0-55 linux-headers-3.2.0-61 linux-headers-3.2.0-56 linux-headers-3.2.0-57 linux-headers-3.2.0-63 linux-headers-3.2.0-58 linux-headers-3.2.0-59
  linux-headers-3.2.0-52-generic-pae linux-headers-3.2.0-44-generic-pae linux-headers-3.2.0-39-generic-pae linux-headers-3.2.0-37-generic-pae
  linux-headers-3.2.0-59-generic-pae linux-headers-3.2.0-61-generic-pae linux-headers-3.2.0-56-generic-pae linux-headers-3.2.0-53-generic-pae
  linux-headers-3.2.0-48-generic-pae linux-headers-3.2.0-45-generic-pae linux-headers-3.2.0-40-generic-pae linux-headers-3.2.0-57-generic-pae
  linux-headers-3.2.0-54-generic-pae linux-headers-3.2.0-51-generic-pae
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
  libssl-dev linux-generic-pae
The following packages will be upgraded:
  libssl-dev linux-generic-pae
2 to upgrade, 0 to newly install, 0 to remove and 0 not to upgrade.
2 not fully installed or removed.
Need to get 0 B/1,427 kB of archives.
After this operation, 1,024 B of additional disk space will be used.
Do you want to continue [Y/n]? y
dpkg: dependency problems prevent configuration of libssl-dev:
 libssl-dev depends on libssl1.0.0 (= 1.0.1-4ubuntu5.14); however:
  Version of libssl1.0.0 on system is 1.0.1-4ubuntu5.17.
dpkg: error processing libssl-dev (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                                                                                                            dpkg: dependency problems prevent configuration of linux-generic-pae:
 linux-generic-pae depends on linux-image-generic-pae (= 3.2.0.64.76); however:
  Version of linux-image-generic-pae on system is 3.2.0.67.79.
 linux-generic-pae depends on linux-headers-generic-pae (= 3.2.0.64.76); however:
  Version of linux-headers-generic-pae on system is 3.2.0.67.79.
dpkg: error processing linux-generic-pae (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates it's a follow-up error from a previous failure.
                                                                                                            Errors were encountered while processing:
 libssl-dev
 linux-generic-pae
E: Sub-process /usr/bin/dpkg returned an error code (1)

答案1

  1. apt-get autoremove
  2. apt-get -f install

从你的文本中挑选出来似乎相当合适...
你试过吗?

如果一切顺利的话:
3 apt-get update && apt-get upgrade
.......可能已经到位。

编辑您的帖子并添加<小时>标签到其末尾,然后添加更多文本来回答这个问题/说明出了什么问题。

答案2

由于您说过您已经手动安装了一些软件包,因此错误消息中的这些行:

dpkg: dependency problems prevent configuration of libssl-dev:
 libssl-dev depends on libssl1.0.0 (= 1.0.1-4ubuntu5.14); however:
  Version of libssl1.0.0 on system is 1.0.1-4ubuntu5.17.

dpkg: dependency problems prevent configuration of linux-generic-pae:
 linux-generic-pae depends on linux-image-generic-pae (= 3.2.0.64.76); however:
  Version of linux-image-generic-pae on system is 3.2.0.67.79.
 linux-generic-pae depends on linux-headers-generic-pae (= 3.2.0.64.76); however:
  Version of linux-headers-generic-pae on system is 3.2.0.67.79.

提示已安装的部分软件包是较新的版本。安装此软件包的旧版本和相关软件包应该可以apt继续。

相关内容