How to Install Software Packages on Linux system

Welcome to our tutorial on how to Install software packages on Linux system. Most Linux users want to download, install an application and use it. Thus, different Linux distributions have created a system for bundling already compiled applications for distribution. This bundle is named a package, and it consists of most of the files required to run one application.

There are two different package management systems created by different Linux distributions. These are;

  • Red Hat package management (RPM)
  • Debian package management (APT)

Before you can install a package, you can check if the package is already installed in your system via the link below;

Check If a Package is Installed on Linux

How to Install Software Packages on Linux system

Installing Package on RPM Distributions

CentOS, Fedora are Red Hat-based distros and Red Hat Linux distribution use RPM. Also, there are other distributions that are not Red Hat based, such as openSUSE and OpenMandriva Lx, that employ RPM as well. RPM package files have an .rpm file extension and follow this naming format:

PACKAGE-NAME-VERSION-RELEASE.ARCHITECTURE.rpm

Install Software/Packages using rpm Command

The main tool for working with RPM files is the rpm program. The rpm utility is a commandline program that installs, modifies, and removes RPM software packages. Its basic format is as follows:

rpm ACTION [OPTION] PACKAGE-FILE

With super user privileges, you can obtain copies of RPM files on a Red Hat–based distro such as CentOS or Fedora, employ the yumdownloader utility.

example;

sudo yumdownloader telnet
CentOS Linux 8 - AppStream                                                                                                                169  B/s | 4.3 kB     00:26    
CentOS Linux 8 - AppStream                                                                                                                294 kB/s | 6.3 MB     00:21    
CentOS Linux 8 - BaseOS                                                                                                                   7.4 kB/s | 3.9 kB     00:00    
CentOS Linux 8 - BaseOS                                                                                                                   344 kB/s | 2.3 MB     00:06    
CentOS Linux 8 - Extras                                                                                                                   2.7 kB/s | 1.5 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                                     92 kB/s |  61 kB     00:00    
Extra Packages for Enterprise Linux Modular 8 - x86_64                                                                                    228 kB/s | 610 kB     00:02    
Extra Packages for Enterprise Linux 8 - x86_64                                                                                             71 kB/s |  36 kB     00:00    
Extra Packages for Enterprise Linux 8 - x86_64                                                                                            679 kB/s | 9.4 MB     00:14    
telnet-0.17-73.el8_1.1.x86_64.rpm

If we can check with ls command, we can see that we have obtained .rpm telnet package in our current directory;

ls
telnet-0.17-73.el8_1.1.x86_64.rpm

With rpm command, using -i or --install option installs the specified package and -U or --upgrade installs or upgrades the specified package. Now, we can install our telnet package above;

sudo rpm -ivh telnet-0.17-73.el8_1.1.x86_64.rpm
Verifying...                          ################################# [100%]
Preparing...                          ################################# [100%]
Updating / installing...
   1:telnet-1:0.17-73.el8_1.1         ################################# [100%]

Using the -vh option is a popular combination that shows the progress of an update and what it’s doing.

Install Software/Packages using yum Command

The core tool used for working with Red Hat repositories is that the YUM utility (acronym YellowDog Update Manager, originally developed for the YellowDog Linux distribution). Its yum command allows you to question , install, and take away software packages on your system directly from their official Red Hat repository.

yum command stores its files on /etc/yum.repos.d/ directory. We can check with ls command;

ls /etc/yum.repos.d
CentOS-Linux-AppStream.repo          CentOS-Linux-Devel.repo             CentOS-Linux-Media.repo       epel-modular.repo          epel-testing.repo
CentOS-Linux-BaseOS.repo             CentOS-Linux-Extras.repo            CentOS-Linux-Plus.repo        epel-playground.repo
CentOS-Linux-ContinuousRelease.repo  CentOS-Linux-FastTrack.repo         CentOS-Linux-PowerTools.repo  epel.repo
CentOS-Linux-Debuginfo.repo          CentOS-Linux-HighAvailability.repo  CentOS-Linux-Sources.repo     epel-testing-modular.repo

yum command has the following syntax;

yum [OPTIONS] [COMMAND] [PACKAGE…]

Installing software telnet with yum on a CentOS distro with super user privileges;

sudo yum install telnet
Last metadata expiration check: 0:24:54 ago on Tue 25 May 2021 07:24:48 AM UTC.
Dependencies resolved.
==========================================================================================================================================================================
 Package                              Architecture                         Version                                          Repository                               Size
==========================================================================================================================================================================
Installing:
 telnet                               x86_64                               1:0.17-73.el8_1.1                                appstream                                72 k

Transaction Summary
==========================================================================================================================================================================
Install  1 Package

Total download size: 72 k
Installed size: 153 k
Is this ok [y/N]: y
Downloading Packages:
telnet-0.17-73.el8_1.1.x86_64.rpm                                                                                                          61 kB/s |  72 kB     00:01    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                      61 kB/s |  72 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                  1/1 
  Installing       : telnet-1:0.17-73.el8_1.1.x86_64                                                                                                                  1/1 
  Running scriptlet: telnet-1:0.17-73.el8_1.1.x86_64                                                                                                                  1/1 
  Verifying        : telnet-1:0.17-73.el8_1.1.x86_64                                                                                                                  1/1 

Installed:
  telnet-1:0.17-73.el8_1.1.x86_64                                                                                                                                         

Complete!

Install Software/Packages using ZYpp Command

The openSUSE Linux distribution uses the RPM package management system and distributes software in .rpm files and it has created its own package management tool called ZYpp (also called libzypp). Therefore, zypper command allows you to query, install, and remove software packages on your system directly from an openSUSE repository.

Installing software with the zypper utility with super user privileges;

sudo zypper install telnet
Loading repository data...
Reading installed packages...
Resolving package dependencies...

The following NEW package is going to be installed:
  telnet

1 new package to install.
Overall download size: 57.3 KiB. Already cached: 0 B. After the operation, additional 113.4 KiB will be used.
Continue? [y/n/v/...? shows all options] (y): y
Retrieving package telnet-1.2-lp151.2.3.x86_64                                                                                       (1/1),  57.3 KiB (113.4 KiB unpacked)
Retrieving: telnet-1.2-lp151.2.3.x86_64.rpm ...........................................................................................................[done (14.3 KiB/s)]

Checking for file conflicts: .......................................................................................................................................[done]
(1/1) Installing: telnet-1.2-lp151.2.3.x86_64 ......................................................................................................................[done]

Install Software/Packages using dnf Command

The dnf command (accronym dandified yum) is the package management tool used on Fedora, and may be a fork of yum. And as such, many of the commands and parameters are similar.

Syntax;

dnf [options] <command> [<args>...]

When installing a package with dnf command, we use dnf install PACKAGENAME, where PACKAGENAME is the name of the package you wish to install. You can find the name by performing a search.

Now, we can install our telnet package with super user privilages;

sudo dnf install telnet
Last metadata expiration check: 0:00:00 ago on Tue 25 May 2021 08:57:13 AM UTC.
Dependencies resolved.
==========================================================================================================================================================================
 Package                               Arch                                  Version                                         Repository                              Size
==========================================================================================================================================================================
Installing:
 telnet                                x86_64                                1:0.17-74.fc28                                  updates                                 70 k

Transaction Summary
==========================================================================================================================================================================
Install  1 Package

Total download size: 70 k
Installed size: 117 k
Is this ok [y/N]: y
Downloading Packages:
telnet-0.17-74.fc28.x86_64.rpm                                                                                                            179 kB/s |  70 kB     00:00    
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                      43 kB/s |  70 kB     00:01     
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                                                                                                                  1/1 
  Installing       : telnet-1:0.17-74.fc28.x86_64                                                                                                                     1/1 
  Running scriptlet: telnet-1:0.17-74.fc28.x86_64                                                                                                                     1/1 
  Verifying        : telnet-1:0.17-74.fc28.x86_64                                                                                                                     1/1 

Installed:
  telnet.x86_64 1:0.17-74.fc28                                                                                                                                            

Complete!

Installing Package on Debian Distributions

Debian-based Linux distros such as Ubuntu use Debian package management system to install, modify, upgrade, and remove software packages.

Debian Package File

Debian bundles application files into a single .deb package file for distribution that uses the following filename format:

PACKAGE-NAME-VERSION-RELEASE_ARCHITECTURE.deb

You can obtain copies of Debian package files on a Debian-based distro, such as Ubuntu, using the apt-get download command with super user privileges.

example;

sudo apt-get download telnet

We can us ls command to check if the packaged is downloaded in the current directory;

ls
telnet_0.17-41.2build1_amd64.deb

Install Software/Packages using dpkg Command

In Debian-based distribution, the core tool to use for handling .deb files is the dpkg command, which is a command-line utility that has options for installing, updating, and removing .deb package files on your Linux system.

Syntax;

dpkg [OPTIONS] ACTION PACKAGE-FILE

Where ACTION parameter defines the action to be taken on the file.

When installing a .deb package with the dpkg command, use -i option;

sudo dpkg -i telnet_0.17-41.2build1_amd64.deb
Selecting previously unselected package telnet.
(Reading database ... 95016 files and directories currently installed.)
Preparing to unpack telnet_0.17-41.2build1_amd64.deb ...
Unpacking telnet (0.17-41.2build1) ...
Setting up telnet (0.17-41.2build1) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (telnet) in auto mode
Processing triggers for man-db (2.9.1-1) ...

Install Software/Packages using apt Command

apt command is used to install, update, and remove packages from a Debian package repository. istall action Installs or updates a package and updates the package management database.

Installing a package telnet with the apt install command;

sudo apt intsall telnet
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  telnet
0 upgraded, 1 newly installed, 0 to remove and 39 not upgraded.
Need to get 64.0 kB of archives.
After this operation, 163 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu focal/main amd64 telnet amd64 0.17-41.2build1 [64.0 kB]
Fetched 64.0 kB in 1s (53.0 kB/s) 
Selecting previously unselected package telnet.
(Reading database ... 95016 files and directories currently installed.)
Preparing to unpack .../telnet_0.17-41.2build1_amd64.deb ...
Unpacking telnet (0.17-41.2build1) ...
Setting up telnet (0.17-41.2build1) ...
update-alternatives: using /usr/bin/telnet.netkit to provide /usr/bin/telnet (telnet) in auto mode
Processing triggers for man-db (2.9.1-1) ...

That concludes our guide on how to install software packages on Linux system.

Other tutorials

Manage Disk Partitions in Linux using gdisk

How to Use fdisk Partitioning Tool on Linux

Example Usage of df Command on Linux

Leave a Comment