15

I wrastled with the program according to the info in this question. Now it is installed but I can't figure out how to run it. A friend running the same version of Ubuntu had no problems getting it to start after installing it the same way.

This is what I've done:

$ ./Psychonauts
./Psychonauts: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

So I went ahead and:

$ sudo apt-get install libstdc++.so.6
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libstdc++.so.6
E: Couldn't find any package by regex 'libstdc++.so.6'

It should be noted that I only started using Linux a few days ago.

Okay, so I did manage to install apt-file and apt-file update.

However then we hit another snag.

usagiyojimbo@Usagi:~$ sudo apt-file find libstdc++.so.6
[sudo] password for usagiyojimbo: 
E: The cache is empty. You need to run 'apt-file update' first.

I have done that, when I do it says:

File is up-to-date.
Ignoring source without Contents File:
a link they won't let me post

Or

File is up-to-date.
Downloading Index a link
No Index available.
Downloading complete file a link

I am still getting the same error when I try to run Psychonauts.

2

5 Answers 5

23

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. In your case, the correct package is libstdc++6:

libstdc++6: /usr/lib/x86_64-linux-gnu/libstdc++.so.6

Then you can install the needed package:

sudo apt-get install libstdc++6
4
  • Okay, so I did manage to install apt-file and apt-file update. However then we hit another snag. usagiyojimbo@Usagi:~$ sudo apt-file find libstdc++.so.6 [sudo] password for usagiyojimbo: E: The cache is empty. You need to run 'apt-file update' first. Feb 5, 2014 at 21:22
  • Run sudo apt-file update and after that sudo apt-file find libstdc++.so.6. Read above answer exactly.
    – BuZZ-dEE
    Feb 5, 2014 at 21:44
  • 2
    Not sure what I did differently, but it apt-file find worked this time. I get the list of packages. When I try to install it says libstdc++6 is already the newest version. When I try to ./Psychonauts it still says no such file or directory. Feb 5, 2014 at 22:01
  • And if you're messing around with 32-bit hardware, make sure to specify at the end: sudo apt-get install libstdc++6:i386 Oct 14, 2016 at 0:39
12

I think Psychonauts is a 32bit application. You will need to install:

apt-get install lib32stdc++6
1
3

You are almost there, just used a few more characters than you needed:

sudo apt-get install libstdc++6

... should do the trick.

1

I could fix it with the help of a friend of mine.

Since the binary was of 32-bit, we could fix it with the following command:

sudo apt-get install libstdc++5:i386
0

I'll share with you the way that worked for me. First of all you should find if any other copy of this file is already on your machine:

$ locate libstdc++.so.6

the output:

/snap/core/6405/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/6405/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
/snap/core/6405/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py
/snap/core/6531/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/6531/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
/snap/core/6531/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py
/snap/core/6673/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/snap/core/6673/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
/snap/core/6673/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21-gdb.py
/usr/lib/x86_64-linux-gnu/libstdc++.so.6
/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25
/usr/share/gdb/auto-load/usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.25-gdb.py

As you can see there are many /snap/core/... versions of this file. (if not this method doesn't works for you)

The you should make a backup from the existing file:

$ sudo mv /usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.backup

Then you can replace the latest snap version into the corrupted file:

sudo cp /snap/core/6673/usr/lib/x86_64-linux-gnu/libstdc++.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6

The try running desired command again .

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .