I'm unable to install or update any Ubuntu package or software. When I try to run any command with apt-get I'm getting the error below. I have tried following commands:

sudo apt-get update
apt-get: symbol lookup error: apt-get: undefined symbol: _ZN11CommandLine10GetCommandEPKNS_8DispatchEjPKPKc

sudo apt-get install --reinstall apt
apt-get: symbol lookup error: apt-get: undefined symbol: _ZN11CommandLine10GetCommandEPKNS_8DispatchEjPKPKc

I have tried the following solution: Download apt package from apt package and try to install using dpkg:

sudo dpkg -i apt_1.0.1ubuntu2.13_amd64.deb libapt-pkg4.12_0.8.16~exp12ubuntu10.21_amd64.deb
(Reading database ... 265812 files and directories currently installed.)
Preparing to unpack apt_1.0.1ubuntu2.13_amd64.deb ...
Unpacking apt (1.0.1ubuntu2.13) over (1.0.1ubuntu2.13) ...
Preparing to unpack libapt-pkg4.12_0.8.16~exp12ubuntu10.21_amd64.deb ...
Unpacking libapt-pkg4.12:amd64 (0.8.16~exp12ubuntu10.21) over 
(0.8.16~exp12ubuntu10.21) ...
dpkg: dependency problems prevent configuration of apt:
 apt depends on libapt-pkg4.12 (>= 0.9.16); however:
  Version of libapt-pkg4.12:amd64 on system is 0.8.16~exp12ubuntu10.21.

dpkg: error processing package apt (--install):
dependency problems - leaving unconfigured
Setting up libapt-pkg4.12:amd64 (0.8.16~exp12ubuntu10.21) ...
Processing triggers for man-db ( ...
Processing triggers for libc-bin (2.19-0ubuntu6.7) ...
Errors were encountered while processing:

Even when I try to reinstall Ubuntu it doesn't work.

  • 2
    Is that all? What command did you use? Can you post all output as is. Sep 9 '16 at 16:22
  • @mikewhatever not only update if i use any apt-get command. it is showing same error
    – learner
    Sep 9 '16 at 16:44
  • @mikewhatever i have updated question can you review again ?
    – learner
    Sep 9 '16 at 17:04
  • I'm getting suspicious that your system may be left in an inconsistent state after a botched release upgrade. Just to verify that you're truly on Ubuntu 14.04: could you please include the output of lsb_release -a? Sep 10 '16 at 17:54

You're on the right track with the manual re-installation of apt, but you need to do the same for all packages from the apt source package that are also a dependency of the apt package, i. e. most importantly libapt-pkg4.12.

The dpkg command will look something like this:

sudo dpkg -i apt_1.0.1ubuntu2.13_amd64.deb libapt-pkg4.12_1.0.1ubuntu2.13_amd64.deb

After that you should:

  1. Check that there are no package repositories from previous releases in the repository list:

    grep -e '^\s*[^\s#].*trusty' /etc/apt/sources.list /etc/apt/sources.list.d/*.list

    should have empty output.

    If you want to be perfectly safe, restore the default.

  2. Update the local package index:

    sudo apt-get update
  3. Upgrade potentially left-over packages from Precise to their newer version from Trusty:

    sudo apt-get dist-upgrade
  • @david-forester even i tried your suggestion, it doesnt work for me. i update error logs in question
    – learner
    Sep 10 '16 at 17:11
  • According to the added listing in your question you didn't choose the right version of libapt-pkg4.12. The current version for Trusty is 1.0.1ubuntu2.13, which is appears in the example command and behind the link in my answer. Sep 10 '16 at 17:51
  • I have installed libapt-pkg4.12 and 1.0.1ubuntu2.13. Removed package repositories. While updating ubuntu apt-get update I'm getting following error E: Some index files failed to download. They have been ignored, or old ones used instead.
    – learner
    Sep 10 '16 at 18:13
  • Could you please open a new question if you have a new or follow-up question? The comment section is not suitable or meant for new questions or extended discussion. Sep 10 '16 at 19:33
  • I have solved the way you explained me helped a lot.
    – learner
    Sep 11 '16 at 6:15

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.