Installing Software on Linux from Source Code

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

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

echo $PATH
[ec2-user@ip-172-30-1-107 ~]$ echo $PATH
/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/.local/bin:/home/ec2-user/bin

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.

Leave a Reply

Your email address will not be published. Required fields are marked *