7

I managed to break my package management. If I try to make an upgrade, I get:

$ 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.

Then I try to follow apt-get recommendation:

$ 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. Can anyone help me to solve it?

3 Answers 3

12

Run:

dpkg --configure -a

and try again.

You can also download the libapt-pkg package from here and install it manually:


If the above commands don't work:

Update: The command below doesn't work. Download the appropriate version directly at http://security.ubuntu.com/ubuntu/pool/main/a/apt/.

Download the package using the following command:

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

Now remove the currently installed package:

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

Then, install the downloaded package:

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

Run, the following command again and check:

sudo apt-get -f install 
6
  • Did that. It finished upgrade, but I still get this when I try to upgrade: 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
    – Märt Rang
    Aug 22, 2012 at 9:25
  • try the updated answer.
    – green
    Aug 22, 2012 at 9:54
  • 1
    thanks, it works now. I had to remove libapt-pkg4.12:i386 too. Linux package management can cause a lot of headaches.
    – Märt Rang
    Aug 22, 2012 at 10:16
  • For wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_0.9.7.1ubuntu2_amd64.deb I get the error: HTTP request sent, awaiting response... 404 Not Found 2012-10-06 22:04:10 ERROR 404: Not Found. . Gulp.
    – Mochan
    Oct 6, 2012 at 12:04
  • look for appropriate version at security.ubuntu.com/ubuntu/pool/main/a/apt.
    – green
    Oct 6, 2012 at 12:16
5

This is how I did it:

First, I downloaded this 2 deb files:

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

Second, I run this command:

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

Then I install the 2 deb files with this command:

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

and it works....

0

I had the dependency apt, apt-get, apt-key error on my debian stretch and after thousands of browser tabs, reboots and program crashes, I solved it by purging the apt version I had and re-downloading and installing the latest apt here and got => (apt_1.8.0_alpha2_amd64.deb) which solved my problems. from (manual) download folder, rundpkg -i apt_1.8.0_alpha2_amd64.deb as root.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.