A simple way to manage binaries from third parties.
When looking over the shoulders of my coleagues, I noticed them being unsure where to install 3rd party binaries 1.
when downloading a 3rd party software create a base directory in
~/3rd_partyfor it. That would be
download the software into a versioned subdirectory. For example
create a symlink with the name of the executable from the base directory to the subdirectory 5:
$ cd ~/3rd_party/k9s $ ln -s 0.8.4/k9s
create a symlink from your
~/binto the 3rd party directory 6:
cd ~/bin ln -s ~/3rd_party/k9s/k9s
Finally we have:
$ k9s -> ~/bin/k9s -> ~/3rd_party/k9s/k9s -> ~/3rd_party/k9s/0.8.4/k9s
by third party binaries I mean binaries downloaded from the internet, as opposed to programs/scripts which you have created yourself, or binaries coming from your distribution. It can be argued that distribution binaries should be prefered over “3rd party” respectively “upstream” binaries, however this is out of topic for this article.[return]
- simple both conceptually and implementation-wise [return]
modern Linux puts your private binaries into[return]
~/.local/bin. That way installation software can automatically add binaries into that path. The idea would be that
~/.local/binis in your
PATH. I prefer not to do things that way, since 1.
~/.local/binis “invisible” and I do not want my 3rd party binaries be invisible and 2. because I want to explicitly control, when executables get added to my
- this is usually done via
That way you can easily control which version is the default version you are using and can fall back if the new version doesn’t work.[return]
That way the “versioning” concern is isolated strictly inside[return]
~/3rd_party/PRODUCTand doesn’t bleed into