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
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:
Then you can install the needed package
sudo apt-get install libstdc++6
docker. For some reason, if I use
debootstrapto start with a base Ubuntu image (e.g.
xenial), I hit this error where some packages cannot be found with
apt-get. The solution ends up being to switch to the
dockerBootStrap, then it functions again.
sudo apt update. Use
apt-cache searchfollowed by a search term to search for the correct package name.