I'm trying to do sudo apt-get dist-upgrade for upgrades all of the packages on the Linux system (14.04). In the middle, it gave an error and I ran sudo apt-get install -f, the PC got rebooted and went into recovery mode.

Tried to open Ubuntu it’s giving like: Failed to load Kernel modules Image

Then it’s going to another window for login: Login Image

In this, it is showing Ubuntu 16.04 LTS but I only use command sudo apt-get dist-upgrade. My OS is Ubuntu 14.04, why is it showing 16.04? This sudo apt-get dist-upgrade command is for kernel upgrades all of the packages in Linux system. Why is this happening?

After logged in, it’s giving apt-get: relocation error: apt_get relocation error Image

Error message after login:

$ apt apt: relocation error: /usr/lib/x86_64-linux-gnu/libapt-pkg.so.5.0: symbol _ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE7compareERKS4_, version GLIBCXX_3.4.21 not defined in file libstdc++.so.6 with link time referenc

Methods tried to solve the error:



It is giving the response no file or directory like this is not there.

2: Then I tried this way

 # ls /usr/lib/x86_64-linux-gnu/libstdc++.so.6*
libstdc++.so.6 -> libstdc++.so.6cd*
libstdc++.so.6cd -> libstdc++.so.6.0.20*

Which giving response permission denied.

3: For this commands, it’s giving the response command not found.


For me no need to update PC to 16.04. I just want to update the kernel modules. How can I solve this apt-get relocation error without loss of data in Ubuntu 14.04?

  • 2
    Did your system have a GUI originally and do you want to restore it? I think you are running 16.04 now actually, the reason might be a wrong command or wrong contents in /etc/apt/sources.list. The upgrade might not be done correctly but since you can log in to the terminal, everything can be fixed using the right commands. – Melebius Sep 6 '18 at 8:12
  • @Melebius i dont want to install 16.04. I can run commands on terminal . Which commands i need to fiz this issue? What commands i need to follow. – crackhead.h Sep 6 '18 at 9:00
  • I am sorry, you seem to have upgraded to 16.04 (at least partially) and there is (almost) no way back unless you have a backup. To get rid of the errors, check askubuntu.com/questions/777803/… if it helps. However, you should check your /etc/apt/sources.list first, whether it points to trusty or xenial. If you’re in doubt, add the contents to your question. – Melebius Sep 6 '18 at 9:11
  • @Melebius The method you suggested i tried that its giving no file or directory found. Is threre any proper way? – crackhead.h Sep 6 '18 at 9:15
  • 1
    The images primarily show a potential problem with your sources. @Melebius in the first comment suggested checking your sources (wrong contents in /etc/apt/sources.list or in a file in the sources.list.d/ subdirectory) that has caused the dist-upgrade to include xenial sources (thus [part] jump you to xenial/16.04). If you grep xenial /etc/apt/sources.list you should get no output (inc. the subdir), but I suspect you do have output (or 16.04 sources) which is I believe the cause for issues. – guiverc Sep 11 '18 at 1:54

Your Answer

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

Browse other questions tagged or ask your own question.