- How to install software from the Linux command line
- What is a package management system?
- Debian, Ubuntu, Mint, and others
- RHEL, CentOS, Fedora, Mageia, and OpenMandriva
- How to Install Application in Ubuntu using Command Line
- Basic of Software’s in Linux
- Installing Application using Package in Ubuntu Manually
- Installing Application using Package in Ubuntu from Internet
- Searching a Software Package
- Installing a Software Package
- Installing Application from tarball *.tar.gz files in Ubuntu
- Follow below steps to Install Software from tarball files.
How to install software from the Linux command line
If you use Linux for any amount of time, you’ll soon learn there are many different ways to do the same thing. This includes installing applications on a Linux machine via the command line. I have been a Linux user for roughly 25 years, and time and time again I find myself going back to the command line to install my apps.
The most common method of installing apps from the command line is through software repositories (a place where software is stored) using what’s called a package manager. All Linux apps are distributed as packages, which are nothing more than files associated with a package management system. Every Linux distribution comes with a package management system, but they are not all the same.
What is a package management system?
A package management system is comprised of sets of tools and file formats that are used together to install, update, and uninstall Linux apps. The two most common package management systems are from Red Hat and Debian. Red Hat, CentOS, and Fedora all use the rpm system (.rpm files), while Debian, Ubuntu, Mint, and Ubuntu use dpkg (.deb files). Gentoo Linux uses a system called Portage, and Arch Linux uses nothing but tarballs (.tar files). The primary difference between these systems is how they install and maintain apps.
You might be wondering what’s inside an .rpm , .deb , or .tar file. You might be surprised to learn that all are nothing more than plain old archive files (like .zip ) that contain an application’s code, instructions on how to install it, dependencies (what other apps it may depend on), and where its configuration files should be placed. The software that reads and executes all of those instructions is called a package manager.
Debian, Ubuntu, Mint, and others
Debian, Ubuntu, Mint, and other Debian-based distributions all use .deb files and the dpkg package management system. There are two ways to install apps via this system. You can use the apt application to install from a repository, or you can use the dpkg app to install apps from .deb files. Let’s take a look at how to do both.
Installing apps using apt is as easy as:
$ sudo apt install app_name
Uninstalling an app via apt is also super easy:
To upgrade your installed apps, you’ll first need to update the app repository:
Once finished, you can update any apps that need updating with the following:
What if you want to update only a single app? No problem.
Finally, let’s say the app you want to install is not available in the Debian repository, but it is available as a .deb download. You can install it manually using dpkg , the system that apt helps manage:
RHEL, CentOS, Fedora, Mageia, and OpenMandriva
Red Hat, its upstream project Fedora, and its «midstream» project CentOS, use the dnf package manager. It has its own syntax, and is a front-end to the RPM system. Although the syntax is different, dnf is similar to apt in the sense that the mechanisms and goals are the same. The Mageia and OpenMandriva distributions, once focused exclusively on urpmi for package management, now also includes dnf in their distributions.
The dnf package manager is the successor to the previous yum command. The yum had a long time to engrain itself in the minds and servers of users, so to avoid breaking custom scripts that have been around on users’ systems for over a decade, yum and dnf are now interchangeable (in fact, yum is now based on dnf .)
$ sudo dnf install app_name
Removing unwanted applications is just as easy.
The dnf (or yum ) command is a front-end for the RPM packaging system. If you can’t find an app in your software repository but you can find it for download directly from its vendor site, you can use dnf to manually install an .rpm file.
$ sudo dnf install ./app_name.rpm
As you can see, installing, uninstalling, and updating Linux apps from the command line isn’t hard at all. In fact, once you get used to it, you’ll find it’s faster than using desktop GUI-based management tools!
For more information on installing apps from the command line, please visit the Debian Apt wiki, the Yum cheat sheet, and the DNF wiki.
How to Install Application in Ubuntu using Command Line
“How to install an application in Ubuntu” The Most asked question by the majority of newbie. People who have migrated from windows to Ubuntu or trying their luck with Ubuntu, the basic problem they face is installing software on Ubuntu. However, Ubuntu has its own GUI Software Center and Software package in the format of .deb which make installing software on Ubuntu an easy task. Anyway, we would be looking forward to installing software through the command line. Installing software through the command line will save your valuable time since the keyboard is much faster than the mouse, anyhow installing software though the command line will help you understand the Linux better. In case in the future, you switch to another Linux distros the process of installing software using the command line will always remain the same unlike the GUI.
Basic of Software’s in Linux
Software in Linux is different than the usual software you find in windows like .exe setup file. Software’s in Linux contains packages, individual unit, modules and libraries. When you install a software, you need to install all those binary files and thousand of other files just to install an application which is very complicated, this is where the package manager comes in. Every Linux distros has its own package manager at your disposal to help.
The Standard Linux package format is RPM, which is used in RedHat, Fedora, Mandriva and SUSE. Another popular package format is DEB, which is a Debian software package used in Debian Linux. The Distributions based on Debian Linux are Ubuntu, Knoppix and Mepis. The Debian package file normally has the extension as Application-name.deb
Note: To Install any Application in Linux, you need to become superuser.
Installing Application using Package in Ubuntu Manually
If you have already downloaded any software in the package format, i.e. .deb File which is present on your local drive or Cd Drive then follow the below steps to install the package on your system.
Step 1: Open Terminal, Press Ctrl + Alt +T.
Step 2: Navigate to the directories were you have saved the .deb package on your system. For example, here we have saved in the download folder of home directories.
Use “cd” command to navigate to directories and use “ls” command to list directories content.
type cd home/username/download
Step 3: To install any software or making any modification on Linux require admin rights, which is here in Linux is SuperUser
Then type your Root password when prompted
Step 4: Here, we are installing Foxit Reader software package on the system, which is present in the download folder of home directories. Using “ls” command will list directory content.
type sudo dpkg –i filename.deb
Foxit Reader Installed Successfully…
sudo – we prefix most command with sudo because it’s a command which specifies super user permissions.
dpkg – dpkg is a tool to install, build, remove and to manage packages and –i specifies to install .deb file.
Installing Application using Package in Ubuntu from Internet
If you have been using or learning Ubuntu for a while, you might have observed the command named apt or apt-get. As said earlier, Every Linux distros has its own package management system (containing software list). For Ubuntu, it’s Advanced Packaging Tool (APT). In Ubuntu, it has a list of repositories of the software package which are available and act as a database of all package sources. Installing software using APT is very easy, but you need the internet to download the files.
Searching a Software Package
To search for a software package, we use the below command. For example, here I am searching for flash player and VLC Media Player.
type apt-cache search flashplayer
Installing a Software Package
Once you know the name of the package you want to install, type the below command to install that package. Here, VLC in the below command is the package name.
It may ask “Do you want to Continue”, type Y to Install.
Installing Application from tarball *.tar.gz files in Ubuntu
Other than normal package file like DEB and RPM, this types of files are also distributed. This type of format is a well-know format in Linux/Unix because, this files contains the source code for the software. The most Open-Source Software use tarball to distribute their software, tarball files have the extension as .tar.gz, tgz or tar.bz2
Since it’s a source code, You will need 3 command to run this software on the system
Follow below steps to Install Software from tarball files.
Step 1: Uncompress tarball
Tar ball is a archive files which are usually compressed similar to ZIP files on windows or SIT files on Mac. To uncompress or to extract the content of tar ball, use below command.
Note: If the extension of tar.bz2 then use “j” in place of “z” i.e. tar -xjvf
x – To extract the files.
z – use gzip to zip or unzip files, used when its .gz files.
v – verbose the files list which are extracted.
f – following is the archive file name.
j – use to decompress .bz2 files.
Step 2: Build and install software.
Since it is a source code, we need to compile, build and install it on the system. Okay, that look very complicated but don’t worry it’s not going to be that hard. Navigate to the extracted folder using the cd command. Once you are in the directory, run “./configure” command, which will verify whether your system has all the necessary functionality and libraries which is required to compile the package. Once that’s done run “make” command, which will compile the source file into executable binaries. And finally, run “make install” which will install the package in the appropriate location.
Note: Each tarball comes with an instruction or read me files, which mention some general information about the software and the installation procedure. This files are usually named as Install or README file.