install from packages when possible
Sometimes the package manager may not have the updated version.
In keeping with my previous posts I will use the program htop as an example. This time I will walk you through how to install a program on Linux from Source code.
What is source code?
Download the source code of Htop and compile it on your system.
wget is preinstalled on your Linux machine
Using Source Code
tar xzf htop-2.1.0.tar.gz
sudo make && sudo make install
Compile htop from the Source on CentOS
Another option is to compile and install htop from the source. This option is useful when you want to install the latest version of htop.
Here is how to download the source and install htop from the source
Download the source files using wget
Wget is a free software package and command line tool used for retrieving files using widely-used Internet protocols like HTTP and FTP.
It is likely preinstalled on your Linux machine but as always we can check with our
which searches your for your not only for the executable but also if it is in the $PATH environment variable.
Is wget installed an in my path?
[ec2-user@ip-172-30-1-107 ~]$ which wget /usr/bin/wget
yes it is here!
whereis locates source/binary and manuals sections for specified files.
To find the paths of $PATH environment variable
[ec2-user@ip-172-30-1-107 ~]$ echo $PATH
This basically mean any executables in any of these path (directories) will excute from the command line regardless of where you are in the file system if you have the right permissions.