The historically 'standard' place for your own binaries and scripts to go that you don't want to (or can't) install in /usr/local/[s]bin is ~/bin
(i.e., the folder bin
in your home directory).
You may need to add that folder to your $PATH environment variable in .bashrc, .profile or .cshrc etc depending on your shell.
1. Directory structure
This should be covered in the Filesystem Hierarchy Standard
(2.3 PDF)
/bin/ Essential command binaries that need to be available in single user mode;
for all users, e.g., cat, ls, cp
/sbin/ Essential system binaries, e.g., init, ip, mount.
/usr/bin/ Non-essential command binaries (not needed in single user mode);
for all users
/usr/sbin/ Non-essential system binaries, e.g. daemons for various network-services.
/usr/local/ Tertiary hierarchy for local data, specific to this host.
Typically has further subdirectories, e.g., bin/, lib/, share/
2. Installation
I use a package manager wherever possible (e.g. yum or apt-get). This is possible for a very large number of applications, in a few cases you may have to add a repository. My second choice would be lower level packages such as RPMs and compiling from source would be my last resort (but some people prefer this)
Some package managers can install from RPMs (e.g. yum install oddity.rpm
)
If you are compiling from source, its probably not a huge step to create your own package so that the system installer knows what you've done.
Then your problem reduces to e.g. yum remove packagename
The alternative is to keep good documentation about all sysadmin activities undertaken (I keep a journal in a text file anyway)
Best Answer
Edit your PATH, so /usr/bin appears before /usr/local/bin. You find out your current path with
echo $PATH
. To change this depends on your system, usually~/.bashrc
. There are questions here and on ServerFault dealing with where to find environment variables and which to use,~/.bashrc
or~/.bash_profile
:-)If you do have software installed in
/usr/local/bin/
that "overrides" what the system put in/usr/bin
, you can create an alias to specify which executable to run on a per-program basis. For example with this ctags program, put this in your~/.bashrc
.(though one of the SF links was about cygwin specifically, it is applicable on other platforms as well)