Ubuntu – How to unistall a program installed by a .sh installer

bashgamesscriptsshuninstall

I downloaded a .sh program (in this case is a game) and then I installed using "sh name.sh" (or maybe it was "bash name.sh". I don't remember quite well, but I guess it has no importance in this case :P).

Everything worked as planned. The .sh created a folder in /usr/local/games/ and from there I can run the game from a .bin (I created a "link to application" in my Desktop to run it faster).

So far so good, but now I want to remove/uninstall the game but I don't know how (I guess that neither apt-get or dpkg work in this particular case. Correct me if I'm wrong).

So my question is, how can I remove/unistall this game?

Tyvm in advance for any reply.

EDIT

I tried to open and read the .sh (actually, it was the first thing I did), but when I open it, the editor (kate in this case) warns me with the following message:

The file /home/user/Games/name/name.sh was opened with UTF-8 encoding but contained invalid characters.
It is set to read-only mode, as saving might destroy its content.
Either reopen the file with the correct encoding chosen or enable the read-write mode again in the menu to be able to edit it.

And when I try to do anything, such as find or select something, my computer gets numb and 'overloaded' and it doesn't let me do anything (almost as a freeze), and since the code is big I can't just read line by line until I find the part(s) I'm looking for.

The folder that was created when installed (in /usr/local/games/) has the following:

name.bin.x86_64
name.png
README.linux
xdg-utils (folder)
  xdg-desktop-menu
name.dat
lib64 (folder)
  libfreeimage.so.3
  libminizip.so.1
  libSDL2-2.0.so.0
xdg-open

I guess that xdg-desktop-menu is used in this case to uninstall the game since when I type in the terminal: "xdg-desktop-menu –help", one of the lines says:

xdg-desktop-menu uninstall [--noupdate] [--mode mode] directory-file(s)
desktop-file(s)

But I'm not sure how to use it. Have someone used something like this? or based in the line above, in this case, what should I type?

Best Answer

How do I uninstall?

The .sh file is an installer script. It does various actions to install the game. (like copying files to the /usr/local/games/)

Remove using an remove script (recommended)

Most applications that ship with a .sh installer also have a .sh remove script. Sometimes you can find the location of the remove script in the README of the application. Otherwise, you will have to search it yourself in the installation directory (/usr/local/games/<NAME_OF_GAME>). It's named uninstall.sh or something similar.

If you find the script, you can excecute it by typing ./<NAME_OF_SCRIPT>.sh in the terminal.

Remove manually

If the application does not have an uninstaller script, you can remove the application manually by removing the complete directory /usr/local/games/<NAME_OF_GAME> and removing the launcher. However, it could be that the application also has some files in other directories.

You can use the command in Terdon's answer to find all the directories that the installer script changes.

Can i uninstall using xdg-desktop-menu?

No. From the man-pages (man xdg-desktop-menu)

The xdg-desktop-menu program can be used to install new menu entries to the desktop's application menu.

So it is only used to install/remove the menu entry, not the complete program itself

Related Question