![无法使用 apt-get](https://linux22.com/image/1047042/%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20apt-get%20.png)
root@mc:/home/sdtd# apt-get install rpm
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-server : Depends: linux-image-server (= 3.2.0.38.46) but 3.2.0.64.76 is to be installed
Depends: linux-headers-server (= 3.2.0.38.46) but 3.2.0.64.76 is to be installed
rpm : Depends: librpm2 (>= 4.9.0) but it is not going to be installed
Depends: librpmbuild2 (>= 4.9.0) but it is not going to be installed
Depends: librpmio2 (>= 4.9.0) but it is not going to be installed
Depends: librpmsign0 (>= 4.9.0) but it is not going to be installed
Depends: rpm2cpio
Depends: rpm-common (= 4.9.1.1-1ubuntu0.2) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
root@mc:/home/sdtd#
apt-get -f 安装后:
root@mc:/home/sdtd# sudo 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-31-generic libicu48 linux-headers-3.2.0-30 linux-headers-3.2.0-31 linux-headers-3.2.0-32
linux-headers-3.2.0-33 linux-headers-3.2.0-34 linux-headers-3.2.0-35 linux-headers-3.2.0-36
linux-headers-3.2.0-34-generic linux-headers-3.2.0-32-generic libdumbnet1 linux-headers-3.2.0-35-generic
linux-headers-3.2.0-30-generic linux-headers-3.2.0-33-generic linux-headers-3.2.0-36-generic
Use 'apt-get autoremove' to remove them.
The following extra packages will be installed:
linux-server
The following packages will be upgraded:
linux-server
1 upgraded, 0 newly installed, 0 to remove and 155 not upgraded.
1 not fully installed or removed.
Need to get 0 B/1,734 B 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 linux-server:
linux-server depends on linux-image-server (= 3.2.0.38.46); however:
Version of linux-image-server on system is 3.2.0.64.76.
linux-server depends on linux-headers-server (= 3.2.0.38.46); however:
Version of linux-headers-server on system is 3.2.0.64.76.
dpkg: error processing linux-server (--configure):
dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
Errors were encountered while processing:
linux-server
E: Sub-process /usr/bin/dpkg returned an error code (1)
答案1
跑步:
sudo su
apt-get remove --purge linux-server
apt-get autoremove
apt-get clean
dpkg --configure -a
apt-get update
apt-get dist-upgrade
apt-get clean
reboot