Installing software/applications on Linux
- Manual
- Debian/Rpm Package
- Apt/Yum
File Permissions
- Any file has three permissions
- Read => 4
- Write => 2
- Execute => 1
- If you want to give
only Read => 4
Read and Write => 4+2 => 6
Read, Write and Execute => 4+2+1 => 7
- Any application should have execute permissions
sh install.sh
./install.sh
python app.py
./app.py
- File Permission on Linux are generally in the following format <ownerpermissions><grouppermission><otherspermission> examples:
-rwxrw-r-- (RWX => owner, RW=> group, read for others)
-rw-r--r--
444
644
640
-
Exercise-1: Find the permissions of the files in following folders using command (ls -la <folderpath>)
- /usr/share
- /tmp
- /var
- /etc
-
Exercise-2: Create a shell file with the following content and give the execute permissions to this file using
chmod 777 <filename>
#!/bin/bash
echo hello
Manual installation of Software
-
Exercise: Lets install maven
- Installation
# Ensure Java is installed Download maven from https://maven.apache.org/download.cgi wget http://apachemirror.wuchna.com/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz tar -xvzf apache-maven-3.6.3-bin.tar.gz # in the folder extracted cd bin ls -la # check mvn permissions
- Configuration:
mvn --version # This command fails because mvn executable is not part of ENV Variable called as PATH export PATH="/home/ubuntu/apache-maven-3.6.3/bin:$PATH" mvn --version
-
Exercise-2: Install Ruby
- Download Ruby from https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.gz and untar
wget https://cache.ruby-lang.org/pub/ruby/2.6/ruby-2.6.5.tar.gz tar -xvzf ruby-2.6.5.tar.gz ./configure make sudo make install
Debian Packages and RPM Packages
- Debian Package:
- Can be used on all debian distributions
dpkg dpkg -i <debian package>
- Example: Install chefdk from here
wget https://packages.chef.io/files/stable/chefdk/4.6.35/ubuntu/18.04/chefdk_4.6.35-1_amd64.deb sudo dpkg -i sudo dpkg -i chefdk_4.6.35-1_amd64.deb
- RPM Package:
- Can be used by os from RedHat family
rpm -ivh
- Example: Try installing chefdk on Centos7
APT or YUM based installations
- In your linux machines you configure apt/yum repositories
- when the commands such as
apt install <package name>
oryum install <package name>
the package name is searched in the configured repositories. - This package will be downloaded and installed on the machines using references from repositories.
- If the Repository is present in your organization, which only allows you to install some packages, These kind of implementations are called as Satellite Servers.
- Lets examine Jenkins installation on Ubuntu. Refer Here
wget -q -O - https://pkg.jenkins.io/debian-stable/jenkins.io.key | sudo apt-key add -
# Add the following line to /etc/apt/sources.list
sudo apt-get update
sudo apt-get install jenkins -y