apt-get 损坏,无法修复或删除 libapt-pkg4.12

apt-get 损坏,无法修复或删除 libapt-pkg4.12

我设法破坏了我的软件包管理。如果我尝试升级,我会得到:

$ sudo apt-get dist-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:
 libapt-pkg4.12 : Breaks: libapt-pkg4.12:i386 (!= 0.8.16~exp12ubuntu10.3) but 0.8.16~exp12ubuntu10.2 is installed
 libapt-pkg4.12:i386 : Breaks: libapt-pkg4.12 (!= 0.8.16~exp12ubuntu10.2) but 0.8.16~exp12ubuntu10.3 is installed
E: Unmet dependencies. Try using -f.

然后我尝试遵循 apt-get 的建议:

$ sudo apt-get -f install
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following packages will be REMOVED:
  libapt-inst1.4:i386 libapt-pkg4.12:i386
0 upgraded, 0 newly installed, 2 to remove and 33 not upgraded.
48 not fully installed or removed.
After this operation, 3 866 kB disk space will be freed.
Do you want to continue [Y/n]? 
E: Internal Error, No file name for libapt-pkg4.12

Kubuntu 12.04 64bit。有人能帮我解决这个问题吗?

答案1

跑步:

dpkg --configure -a

然后再试一次。

您也可以libapt-pkg从以下位置下载软件包这里并手动安装:


如果上述命令不起作用:

更新:以下命令不起作用。直接在以下位置下载相应版本http://security.ubuntu.com/ubuntu/pool/main/a/apt/

使用以下命令下载该包:

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_0.9.7.1ubuntu2_amd64.deb

现在删除当前安装的包:

sudo dpkg --force-depends -r libapt-pkg4.12
sudo dpkg --force-depends -r libapt-pkg4.12:i386

然后,安装下载的包:

sudo dpkg -i libapt-pkg4.12_0.9.7.1ubuntu2_amd64.deb

再次运行以下命令并检查:

sudo apt-get -f install 

答案2

我是这样做的:

首先,我下载了这 2 个 deb 文件:

apt_0.9.7.7ubuntu3_i386.deb
libapt-pkg4.12_0.9.7.7ubuntu3_i386.deb

其次,我运行这个命令:

sudo dpkg --force-depends -r libapt-pkg4.12

然后我使用以下命令安装这 2 个 deb 文件:

sudo dpkg -i apt_0.9.7.7ubuntu3_i386.deb libapt-pkg4.12_0.9.7.7ubuntu3_i386.deb

并且它有效....

答案3

我的 Debian Striking 出现了依赖 apt、apt-get、apt-key 错误,在经历了数千个浏览器选项卡、重启和程序崩溃之后,我通过清除现有的 apt 版本并重新下载和安装最新的 apt 解决了这个问题这里并得到 => (apt_1.8.0_alpha2_amd64.deb),这解决了我的问题。从(手动)下载文件夹,dpkg -i apt_1.8.0_alpha2_amd64.deb以 root 身份运行。

相关内容