In the case where tried to install a file:
sudo apt-get install libstdc++.so.6
instead of a package. You get the error message:
E: Unable to locate package libstdc++.so.6
E: Couldn't find any package by regex 'libstdc++.so.6'
because you tried to install a file libstdc++.so.6
that you can't install, because it is located in a debian package.
You can use apt-file
to search for the package that contains that file. To install it, type:
sudo apt-get install apt-file
Then you have to update the index.
sudo apt-file update
After that, you can search for the package which contains the file libstdc++.so.6
:
sudo apt-file find libstdc++.so.6
Then you find a lot packages that contains the searched file. For this example I paste only one search result:
libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6
Then you can install the needed package libstdc++6
:
sudo apt-get install libstdc++6
debootstrap
anddocker
. For some reason, if I usedebootstrap
to start with a base Ubuntu image (e.g.xenial
), I hit this error where some packages cannot be found withapt-get
. The solution ends up being to switch to thedocker
BootStrap, then it functions again.sudo apt update
. Useapt-cache search
followed by a search term to search for the correct package name.