0

I am facing a problem which seems to be unsolvable. I am trying to resolve the issue but to my disappointment nothing seems to work. The problem I'm facing are as follows

  1. Whenever I try to run sudo apt-get install or sudo apt-get update, I get the following error :

    apt-get: error while loading shared libraries: libapt-pkg.so.4.12: cannot open shared object file: No such file or directory
    
  2. To resolve this issue I downloaded libapt-pkg.so.4.12 and ran command sudo dpkg -i libapt-pkg.so.4.12.deb it gives error

    dpkg: error processing libapt-pkg4.12_1.0.9.7ubuntu4_i386.deb (--install):  cannot access archive: No such file or directory
    Errors were encountered while processing: libapt-pkg4.12_1.0.9.7ubuntu4_i386.deb
    
David Foerster
  • 36,890
  • 56
  • 97
  • 151

2 Answers2

1

Run in terminal

wget http://security.ubuntu.com/ubuntu/pool/main/a/apt/libapt-pkg4.12_0.8.16~exp12ubuntu10.21_amd64.deb
sudo dpkg -i libapt-pkg4.12_0.8.16~exp12ubuntu10.21_amd64.deb
Pilot6
  • 92,041
0
  1. Download the deb file for Precise

    cd; wget http://mirrors.kernel.org/ubuntu/pool/main/a/apt/libapt-pkg4.12_0.8.16\~exp12ubuntu10.25_amd64.deb
    
  2. Extract the deb file

    dpkg -x libapt-pkg4.12_0.8.16\~exp12ubuntu10.25_amd64.deb deb
    
  3. Copy the files

    sudo cp deb/usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12.0 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12.0
    
  4. Create a symbolic link

    sudo ln -s /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12.0 /usr/lib/x86_64-linux-gnu/libapt-pkg.so.4.12
    
  5. After the files are available again, your package system will work again. You should re-install the package libapt-pkg4.12 anyway

    sudo apt-get install --reinstall libapt-pkg4.12
    
A.B.
  • 92,125