Installing Software on the Grid

There are many cases where a user would need to install software on the Grid. Please note the Grid’s operating system is CentOS 6 (x86_64).

Process

Download the CentOS 6 x86_64 version of the software. For this approach, it must be a RPM file.

wget URL

Unpack the RPM file

rpm2cpio FILE | cpio –idv

Update PATH for the current session

export PATH=”FULLPATH:$PATH”              (change FULLPATH)

Update PATH for future sessions

Every time you start a session, settings will be taken from your .bash_profile and .bashrc

Create ~/.bash_profile and point it to ~/.bashrc

nano ~/.bash_profile

You will now be in a text editor. Enter on the first line:

source ~/.bashrc

Exit the text editor with CTRL + X and be sure to say YES to save

Create ~/.bashrc and add to default PATH

nano ~/.bashrc

You will now be in a text editor. Be sure the following is present:

# .bashrc

# source global definitions

if [ -f /etc/bashrc ]; then

. /etc/bashrc   (note there is a space between the period and /)

fi

# Update PATH to include user-installed software

export PATH=”FULLPATH:$PATH”              (change FULLPATH)

Exit the text editor with CTRL + X and be sure to say YES to save

Example Working Code – Personal

In this example, we will install unrar which allows for extracting files from RAR archives. We will install this in our home directory for personal use.

Create a folder to hold unrar

mkdir ~/Programs (creates Programs folder in your home directory)

mkdir ~/Programs/unrar (creates unrar subfolder)

cd ~/Programs/unrar (go to our new folder)

Download and unpack unrar

wget https://forensics.cert.org/centos/cert/6/x86_64/unrar-5.3.0-1.el6.x86_64.rpm

Notice this is the CentOS 6 x86_64 version

rpm2cpio unrar-5.3.0-1.el6.x86_64.rpm | cpio –idv

The output from the last command will indicate that unrar is within ./usr/bin

./usr/bin is equivalent to ~/Programs/unrar/usr/bin

Update PATH for the current session

export PATH=”$HOME/Programs/unrar/usr/bin:$PATH”

Update PATH for future sessions

nano ~/.bash_profile

You will now be in a text editor. Enter on the first line:

source ~/.bashrc

Exit the text editor with CTRL + X and be sure to say YES to save

nano ~/.bashrc

You will now be in a text editor. Be sure the following is present:

# .bashrc

# source global definitions

if [ -f /etc/bashrc ]; then

. /etc/bashrc (note there is a space between the period and /)

fi

 # Update PATH to include user-installed software

export PATH=”$HOME/Programs/unrar/usr/bin:$PATH”

Exit the text editor with CTRL + X and be sure to say YES to save

Example Working Code – Project Space

In this example, we will install unrar in a project space for shared use. Only one user needs to unpack unrar into the project space, but every user will need to update their PATH.

Create a folder to hold unrar

mkdir /export/projects/PROJECT/unrar

cd /export/projects/PROJECT/unrar

Download and unpack unrar

wget https://forensics.cert.org/centos/cert/6/x86_64/unrar-5.3.0-1.el6.x86_64.rpm

Notice this is the CentOS 6 x86_64 version

rpm2cpio unrar-5.3.0-1.el6.x86_64.rpm | cpio –idv

The output from the last command will indicate that unrar is within ./usr/bin

 ./usr/bin is equivalent to /export/projects/PROJECT/unrar/usr/bin

Update PATH for the current session (to be done by every user!)

                export PATH=”/export/projects/PROJECT/unrar/usr/bin:$PATH”

Update PATH for future sessions (to be done by every user!)

nano ~/.bash_profile

You will now be in a text editor. Enter on the first line:

source ~/.bashrc

Exit the text editor with CTRL + X and be sure to say YES to save

nano ~/.bashrc

You will now be in a text editor. Be sure the following is present:

# .bashrc

# source global definitions

if [ -f /etc/bashrc ]; then

. /etc/bashrc (note there is a space between the period and /)

fi

# Update PATH to include user-installed software

export PATH=”/export/projects/PROJECT/unrar/usr/bin:$PATH”

Exit the text editor with CTRL + X and be sure to say YES to save