How to install a Software in Linux
In computer science a software package is a bundle of files organized inside a single file, which when installed will instruct the computer to perform certain tasks. The files organized inside a package will include executables, configuration and library files. Installing a package is nothing but copying or extracting the files organized inside the package to specific locations of the file system. Every operating system has a Package Management System (PMS) to Install, Remove, Upgrade, Resolve dependencies.
Package management is one of the distinctive feature of Linux distros. When it comes to Linux distributions there are 3 major distros that stands out from the rest.
- Debian
- Redhat
- Slackware
Debian and its derivatives use dpkg Package Management System and their software package have the extension .deb. Debian, Ubuntu, Linux Mint, Elementary OS are examples of Linux distros following dpkg.
Redhat and its derivatives use RPM Package Management System and their software package have the extension .rpm. RHEL, Fedora, CentOS, OpenSUSE are examples of Linux distros following RPM
Slackware and its derivatives uses a much simpler tgz package system which is just an ordinary compressed tar file. Slackware packages have the extensions .tgz, .txz. Vector Linux, Slax, Stux, MiniSlack are examples of Linux distros following tgz package system
Install from packages
In this section we will see how to install a software from a packagedpkg for Debian based distros
dpkg is the package manager tool in debian based distros for installing, removing upgrading and managing debian packages. The syntax to install a package with dpkg command is
dpkg -i package_name
example:To install telnet client package, execute
dpkg -i telnet_0.17-36build1_amd64.deb
Sample Output:
Selecting previously unselected package telnet.
(Reading database ... 54238 files and directories currently installed.)
Unpacking telnet (from telnet_0.17-36build1_amd64.deb) ...
Setting up telnet (0.17-36build1) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (telnet) in auto mode.
Processing triggers for man-db ...
(Reading database ... 54238 files and directories currently installed.)
Unpacking telnet (from telnet_0.17-36build1_amd64.deb) ...
Setting up telnet (0.17-36build1) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (telnet) in auto mode.
Processing triggers for man-db ...
rpm for Redhat based distros
rpm is the tool in Redhat based distros for managing RPM packages. The syntax to install a rpm package using rpm command is
rpm -i package_name
example:
To install telnet client package, execute
rpm -ivh telnet-0.17-60.fc21.i686.rpm
Sample Output:
Preparing... ################################# [100%]
Updating / installing...
1:telnet-1:0.17-60.fc21 ################################# [100%]
Updating / installing...
1:telnet-1:0.17-60.fc21 ################################# [100%]
installpkg for Slackware based distros
installpkg is a tool used by Slackware based distros for installing txz, tgz packages. The syntax for using installpkg is
installpkg package_name
example:
installpkg /home/calypso/Downloads/gcc-4.8.2-x86_64-1.txz
Sample Output:
Verifying package gcc-4.8.2-x86_64-1.txz.
Installing package gcc-4.8.2-x86_64-1.txz:
PACKAGE DESCRIPTION:
# gcc (Base GCC package with C support)
#
# GCC is the GNU Compiler Collection.
#
# This package contains those parts of the compiler collection needed to
# compile C code. Other packages add C++, Fortran, Objective-C, and
# Java support to the compiler core.
#
Executing install script for gcc-4.8.2-x86_64-1.txz.
Package gcc-4.8.2-x86_64-1.txz installed.
Installing package gcc-4.8.2-x86_64-1.txz:
PACKAGE DESCRIPTION:
# gcc (Base GCC package with C support)
#
# GCC is the GNU Compiler Collection.
#
# This package contains those parts of the compiler collection needed to
# compile C code. Other packages add C++, Fortran, Objective-C, and
# Java support to the compiler core.
#
Executing install script for gcc-4.8.2-x86_64-1.txz.
Package gcc-4.8.2-x86_64-1.txz installed.
pkgtool for Slackware based distros
pkgtool is a simple, Text-based User Interface tool available in Slackware based distros for managing packages. For installing a package, instead of giving package name we have to provide the directory containing the packages. The tool will automatically detect the software packages and ask the user whether to continue with the installation or notInstallation using command line Package Manager
Most packages in Linux depends on another package. ie In order to install package A another package B should be available in the system. If not, package B need to be installed prior to installing package A. And package B might have its own dependencies.
apt-get for Debian based distros
apt-get is the command-line package management utility in Debian based distros. apt-get is one of the utilities that comes with APT ( Advanced Packaging Tool).
Syntax to install a package with apt-get utility is
apt-get install package-name
Example:To install vim package using ap-get command, execute
apt-get install vim
Sample Output:
yum for Redhat based distros
yum (Yellowdog Updater modified) is the command-line utility used by Redhat based distros that works on RPM Package Manager. Tasks that can be performed with yum are- install package
- update package
- remove package
- auto-resolve package dependency
- listing installed and available packages
yum install package_name
Installation using Graphical Utilities
Ubuntu Software Center |
Most of the Linux distros are shipped with a Graphical Package Management utility for installing, removing and updating software. It is just a front-end to package managers like dpkg and rpm. Like the command line utilities graphical utilities will also require one or more software repositories to work. gnu-software and Ubuntu Software Center are two most widely used graphical package management utilities
gnu-software running on Fedora |
To install a software you just have to enter the software name in the search field and if the software is present in the repository, the utility will display it. Within few mouse click the software will be installed in your system. Graphical utilities have additional features like auto-update checker, repository management and even purchase of proprietary software.
Installation using binary/run files.
Binary (.bin)/run (.run) files are self-extracting executable files. They are like .exe files in a Windows operating system. You can run a binary/run file from a terminal or by double-clicking, provided the file has execute permission set.
chmod +x filename.bin
chmod +x filename.run
Then run the file as
chmod +x filename.run
./filename.bin
./filename.run
example:
./filename.run
./postgresplus-9.0.2-1-linux.bin
Sample output:
Compiling and Installing from source.
This method requires a bit more Linux exposure than the other methods mentioned in this post. In most cases sources will be available online in archive/compressed form. You will have to download the file and unpack it first. Then the source code is compiled, which will create an binary install files.
There is no fixed approach to install from source but the general idea is the same. once the archive is downloaded and extracted cd into extracted path.
There is no fixed approach to install from source but the general idea is the same. once the archive is downloaded and extracted cd into extracted path.
cd /path/to/extracted_directory
A typical installation from source involves three steps
(a)
./configure
(b)
After running the configure script, we are now ready to compile the software with make command. i.e to compile, execute
make
Sample output:
(c) After successful completion of compiling its now time to install the software with make install command
make install
Sample output:
In some cases 'configure' file will not be available inside the extracted directory instead a file named make will be present. In such situation skip the first step and just run make and make install
Install from a pre-compiled binary archive
Some Linux software are available in the form of a pre-compiled binary archives. Which means you just have to extract the contents of the archive to a desired directory. That's all. The extracted files will include executable files. You can start running the program by double-clicking the executable file or running the executable file from a terminal. One thing you need to know is whether you are running a 32 bit or 64 bit OS. You can find the system architecture by executing
uname -m
If the command output is x86_64 you are running 64 bit kernel or if output i686 then it is a 32 bit kernel. While downloading the archive get the file corresponding to your system architecture and extract the contents to a desired directory
Installing Microsoft Windows application with wine
You can install and run applications native to Windows OS using Wine. But first you have to install Wine in your OS using any of the methods mentioned above. To run a program with wine, execute
wine file_name.exe
I
Comments
Post a Comment