Why are a lot of apps not available in package repos?
There could be many reasons:
There's no one single reason. If you'd like to see your favorite app in your distro's package manager, you should treat each case separately. Try to get in touch with the devs (on an IRC channel or a mailing list for instance) and ask how you could help packaging.
How to install a tarball?
A tarball (.tar.gz package) could contain anything. Until you actually open it, you have no way of assuming how to install it. Again, each package should be approached differently.
Look for documentation! Any (semi-)decent package will provide instructions on how to install the application. Your first reflex should always be to look for a text file called README, INSTALL or something like this. Checking out the website of the publisher might also help.
Since every package is different, there's no universal way to process every tarball in the world. That's like asking for a recipe which works on all the ingredients in the world. Not happening.
A good knowledge of your system, your distro and your desktop environment will help, so, if this is reassuring, things will look more and more predictable as you spend time in the linux world.
A special case: Autotools
As projects grow bigger, they need to provide easy ways to move from source code to binary to full install on the system. This is why they ship with an embedded build system, a collection of scripts to do the necessary.
In the Linux/Open Source/Free Software world, one build system got a wider adoption: GNU Autotools. If you ever deal with a(n open) source package, there's a solid chance that you'll be using Autotools.
In the simplest case, here's how to install an app packaged with autotools:
./configure
: A script that will generate the Makefiles corresponding to your system (it also often checks for the availability of dependencies).
make
: Compiling the source code according to the Makefiles generated earlier.
make install
: Copies the binaries to the appropriate locations, creates symlinks, and any other step defined by the developer.
Notes
configure
scripts usually have a lot of options, like which compiler to use or how to define the target directory. If you need flexibility, it's worth looking at ./configure --help
.
- Even if you're sure it's Autotools and you know it really well, always start by reading docs (README, INSTALL, ...)
Answer to the update in the question
What you're asking for has no definite answer. Everyone here might have an opinion on what constitutes "good practice", but at the end of the day, only you can find what works for you. If there was an easy answer, you wouldn't be asking the question. Your distro would've answered it for you.
This being said, here're a few personal remarks.
On my system, I reserve /usr/local/bin
for the packages installed by my package manager. Everything I compile/install by hand goes in /opt
. This is a detail but it helps avoiding major headaches when dealing with several versions of the same program.
xxx.desktop
, and GUI issues in general, are specific to the desktop environment you're using. If it works for your system, great. But it cannot be generalized to all the environments available on Unix.
/usr/local/bin
has the advantage of already being in your PATH. If you want to use another directory (like /opt
as I suggest), be sure to include it in your PATH. If you don't know how to do it, open a terminal and execute the following in a terminal (not the prettiest way to do it, but without knowing anything about your system, I cannot suggest anything else): echo 'export PATH=$PATH:/opt' >> ~/.bashrc
Best Answer
The syntax is usually
(plus a few optional arguments that I omitted).
So you could do like this:
Then you can re-run that same command and choose
leafpad
to be your editor.In my example I gave it a priority of zero. You can choose something different. It only affects when the alternative goes to automatic mode. Don't give Leafpad a high priority, though. You don't want a graphical editor being the default choice in case anything goes wrong and the package is automatically reconfigured.