LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 11-16-2013, 03:13 AM   #1
veeruk101
Member
 
Registered: Mar 2005
Distribution: Ubuntu 12.04 LTS
Posts: 249

Rep: Reputation: 16
Where on file system to place command-line tools from GitHub?


Where on the file system do you place command-line tools that you install manually (but that require no compilation) from places like GitHub? For example, things like https://github.com/rg3/youtube-dl/ and https://github.com/sivel/speedtest-cli.

I've just been putting them in my home directory then updating PATH env variable manually to include the subdirectory containing the executables, for each of those projects. What's a cleaner way to do this? Is there a location outside of /home where I could be placing these?

I put things in /usr/local/sbin but those are just standalone scripts, not whole directories. And sbin is for administrative things and the kinds of tools I'm talking about aren't really for administration. There's also /opt, but that seems to be the location where tools that were installed by .deb packages put themselves (e.g. Vagrant).

What are some options I have for where to put these things?

And is there any way around having to manually update PATH to include each of these tools separately?
 
Old 11-16-2013, 04:38 AM   #2
jpollard
Senior Member
 
Registered: Dec 2012
Location: Washington DC area
Distribution: Fedora, CentOS, Slackware
Posts: 4,912

Rep: Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513Reputation: 1513
The usual place is /usr/local.

The contents of /usr/local is usually a etc, bin, lib,... as a mirror of the systems construct.

Personally, I have extended it slightly by putting a package_name.version in /usr/local which allows me to put multiple versions, then (as admin) I can create a symbolic link package_name to point to whichever is the current version. In bin I create symbolic links to the executables by with the structure "binname ../package_name/bin/executable", so that if I switch versions, everything gets switched. The same goes for the /usr/local/lib.

Sometimes calls for a bit of cleanup in the /usr/local/bin as executable names are dropped or changed, but it does allow me to keep an older version around (just in case), the current version, and a new test version. Though to use the new/old version I have to put its entry in my path before
putting /usr/local/bin.

The advantage of keeping these packages separated from the system is to avoid potential collisions... and allows a separate backup to be made easily. When I was at work, we kept the /usr/local directory on a separate partition, so that even if the OS is completely replaced, the
/usr/local filesystem could just be mounted normally, and all those packages would not have to be reinstalled.
 
1 members found this post helpful.
Old 03-05-2014, 01:17 AM   #3
andrew.46
Senior Member
 
Registered: Oct 2007
Distribution: Slackware
Posts: 1,365

Rep: Reputation: 493Reputation: 493Reputation: 493Reputation: 493Reputation: 493
For simple stuff like youtube-dl I am quite happy using $HOME/bin.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
command line -> Network Tools devilboy09 Linux - Networking 2 04-05-2012 04:46 AM
[SOLVED] How do I use command line tools? LAPIII Linux - Software 2 06-23-2011 08:50 AM
must have command line tools. slimm609 Slackware 28 05-29-2007 06:45 AM
C++ Interfacing with command line tools khermans Programming 2 04-14-2005 02:00 PM
group command line tools m2azer Linux - General 4 10-31-2004 09:37 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration