It doesn’t matter whether you’re using Windows, Mac OS, or a Linux distro like Ubuntu, the names programs display in the titlebar and the names of the actual files that run them can be quite different. A familiar example for many would be Microsoft Office Word (or Word for Windows in the old days) – or winword.exe, to be precise.
In Ubuntu, you can guess the package names of many programs simply by making all characters lower-case, and perhaps removing a space between words, or even abbreviating it. For example, KAlarm is actually kalarm, tovid GUI is tovidgui, and Downloader for X is d4x.
But you can’t guess them all, so you’ll need to look at the properties of launchers to the programs you want to know more about. Since you can’t really right-click launchers in the Applications menu for this purpose, by far the easiest method is to temporarily add them to your panel (or desktop), then just delete them when no longer needed. You can actually get the properties of launchers while editing the Applications menu, but this method is simpler and quicker.
For any program you need to know the package name of, right-click it in the Applications menu and choose either Add this launcher to panel or Add this launcher to desktop. When you right-click the new launcher on your panel or desktop, choose Properties, and the Command field will reveal the program’s actual name.
Just remember to ignore any options on the end of a command, since a program name must be one word without spaces (this can of course include many words strung together with hyphens or underscores). So while Amarok‘s launcher says amarok %U, the %U is an option, and amarok is the command. Even if you can see nothing familiar, you can bet whatever the command starts with, and is before the first space, is the command. For example, Downloader for X is actually no longer d4x, and since the command string is now nt -a %U, one has to assume nt is now the name of the command that runs this program.
The exceptions to this rule are when the path or address of the command is specified, or when another command precedes it. A good example is gksu /usr/sbin/firestarter for Firestarter, as not only is the path specified before the command, firestarter, but in order to run it with superuser privileges, the whole lot starts with gksu (basically, sudo for GUI programs). In a situation like this, one would look to the end, not the beginning.
‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡‡
If you need to find out the version numbers of installed packages, read this.
Hi,
Thanks for the post. I however think that this method is not reliable nor the fastest/simplest. For example, if you try to uninstall Aisleriot Solitaire using this method, you will find out that the command in the launcher is “/usr/games/sol”. sol is NOT the package name used for Aisleriot Solitaire. In my opinion, a better method would be to open Synaptic Package Manager and just search for the program. It will show you the correct name to use.
Cheers!
Yes, as you say there are exceptions. I’ve got plenty of pages on Synaptic and package management covering searching for programs. Looks like I forgot to link them to this post, so will have to rectify that. My point was to get newbies familiar with simple concepts like knowing what the command for a “program” is by looking at the launcher. Like what you can do with finding the .exe behind a Windows program via the shortcut, which is a revelation to newbies.
In most cases, that suffices as the package name; in cases where many packages make up the “program”, they’re not usually handled by a “metapackage”, so as you know when you select the main package for installation, Synaptic advises it will install dependencies. That should also happen with apt at the command line.
But yeah, at times this doesn’t apply, even with single package programs. A good example is Compiz-Config Settings Manager, which installs via the package compizconfig-settings-manager, but runs via the command ccsm.
In the case of that example, using Synaptic to locate ccsm is actually useless, as it will only locate 2 library packages with “ccsm” in their names. What I will do is add some info on using apt-file to locate whatever it is you’re after, be it a package within a metapackage, or command or file within a package.
But your comment did bring to my attention that perhaps I should have used “command” rather than “package” in the title, so I might change that. “Package” could imply more than I actually meant, though as I’ve said, very often in Linux the command and package names are one and the same. So I might edit it to “Command/Package” in the title. Thanks for taking the time to comment. Cheers..