How to Install Programs in Linux?

LINUX
FUNDAMENTALS
A Complete Guide for Beginners Enroll Course Now

Installing software programs or apps in Linux is a crucial skill that empowers users to customize their experience and increase productivity. This guide will show you many ways to install different types of apps in your Linux distribution. Typically, you can install a program in Linux using one of the following methods:

  1. From the software store of your distribution
  2. Using your distribution’s package manager
  3. From the source file of the software
  4. Universal package managers such as Flatpak

Let’s explore the methods step-by-step with examples.

Installing Programs from the Software Center

If you prefer a more visual approach to installing software, Linux offers a range of software centers that simplify the installation process. However, installing programs from the software store doesn’t require command-line knowledge. Here’s how to install a program from the Linux software center:

  1. Open the software store. Depending on your Linux distribution and desktop environment, the software store may have different names such as “Software Center,” “App Store,” “Discover,” etc.Opening software center in ubuntu

  2. Then, type the program name into the search bar and press ENTER. The search results will display a list of matching programs.searching for program
  3. Click on the program you want to install from the search results. It’ll open the program’s details page.

  4. Then, click the “Install” or “Get” button to begin the installation process.installing VLC program from software store

  5. Provide user password if prompted.

Once the installation is complete, you’ll usually see a notification or confirmation message indicating that the program has been successfully installed.

Installing Programs Using Distribution Package Managers

A package manager in Linux is a software utility that automates the installation, upgrade, configuration, and removal of software packages. It plays a crucial role in maintaining system integrity by managing software installations efficiently. However, different Linux distributions have different default package managers. Here’s how you can utilize them in installing programs:

1. Debian-Based: APT and APT-GET

APT is the default package manager for Debian-based Linux distributions such as Ubuntu, Linux Mint, elementaryOS, Kali Linux, etc. If you are using any one of the distributions, open the terminal and use the commands to install software:

  1. Update the repository using:
    sudo apt update

    It refreshes the local package index to ensure you get the latest version of the available software.

  2. Install the software using:
    sudo apt install <package-name>

    For example, to install Firefox browser, use:

    sudo apt install firefox
    Note: You can use apt-get instead of apt:

    sudo apt-get install firefox

    Both APT and APT-GET are Debian-based package managers. Explore their difference in Apt Vs Apt-get

  3. Provide the user password if asked.
  4. Type Y and press ENTER if asked for confirmation.

2. RedHat-Based: DNF and YUM

RedHat-based distributions such as Fedora and CentOS use DNF (Dandified Yum) as their main package manager. However, YUM is still available for compatibility. To install a program using these, use sudo dnf install <pacakge-name> or sudo yum install <package-name> command. For instance, use the commands to install Firefox using DNF :

sudo dnf update
sudo dnf install firefox

dnf install firefoxSimilarly, you can use YUM:

sudo yum update
sudo yum install firefox

Note: The dnf update or yum update command is not mandatory to install a program. However, it is recommended as it refreshes the repository, which aids in installing the latest version of available software.

3. Arch-Based: Pacman

Arch Linux and its derivatives like Manjaro, and EndeavourOS employ Pacman as the default package manager. It is renowned for its simplicity and efficiency. To install the Firefox using Pacman:

sudo pacman -S firefox

Here, the -S synchronizes the package databases before installation and the y option is to confirm the installation process. Next, if prompted, give the user’s password.

Installing Programs Using Universal Package Managers

Universal package managers provide a cross-distribution solution for installing and managing software packages across different Linux distributions. Here’s how to use the two commonly used universal package managers – Flatpak and Snapcraft to install programs in Linux:

1. Flatpak

Flatpak is a universal package manager that allows applications to run consistently across different Linux distributions without conflicts or compatibility issues. Before using it, you have to install flatpak manager using your distribution package manager. For instance, to install flatpak on Ubuntu or Debian-based distributions, use the following command:

sudo apt install flatpak

After that, you must add the Flathub repository, which hosts a vast collection of Flatpak applications. You can add the Flathub repository with the following command:

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Once Flatpak is installed and the Flathub repository is added, you can search for and install programs using flatpak command. For example, to install the popular image editor GIMP, use:

flatpak install flathub org.gimp.GIMP

flatpak install gimpTo run an installed Flatpak application, you can use the flatpak run command followed by the application ID. For example:

flatpak run org.gimp.GIMP

The main benefit of using Flatpak is it lets you install programs safely and conveniently. Also, it runs the apps in a boxed space apart from the rest of your computer.

Installing Flatpak: Select your Linux distribution and use the commands from install Flatpak quick setup guide.

2. Snapcraft

Snapcraft is an additional universal package manager that uses the installing methodology akin to Flatpak. It allows you to use programs in a containerized manner. Before using it, you have to install snapcraft on your Linux using the distribution package manager. For instance, to install it on Ubuntu or Debian-based distributions, use the following command:

sudo apt install snapd

After that, you must enable the Snapd socket service. To do that, use the below command:

sudo systemctl enable --now snapd.socket

Once Snapd is installed and the service is enabled, you can search for and install Snap packages using the snap command. For example, to install the Spotify music player, use:

sudo snap install spotify

snapcraft install spotifyTo launch an installed Snap application, simply type its name in the terminal or search for it in the application menu.

Installing Proprietary Programs from Source

Installing from the source is a method to install a program when its pre-build binary package is unavailable in the distribution’s repositories. Here’s a guide on how to do it:

  1. Visit the official website of the proprietary program and locate the source code download section.
  2. Download the source code archive (usually a compressed file such as .tar.gz or .zip) to your computer.
  3. Extract the archive file to a directory of your choice.
  4. Use your package manager to install necessary libraries or dependencies.
  5. Open a terminal and navigate to the directory that contains the extracted source code.
  6. Run the appropriate build commands indicated in the installation instructions. ./configure and make are two common build commands.
  7. Once the program has been successfully built, run sudo make install to install the program.

For example, if you want to install the latest version of Git, first download the source code of git from the official Git website. Then, extract the archive file to a directory. After that, navigate to the extracted directory in the terminal, and run the following commands:

./configure
make
sudo make install

The above commands will configure, compile, and install Git from the source code.

Common Installation Issues in Linux

Here are some of the most common program installation issues in Linux and how to troubleshoot them:

  • Dependency Errors: Dependency errors occur when a program requires other software components (dependencies) to function properly, but those dependencies are not installed on the system.
  • Permission Denied Errors: These errors occur when the user does not have the necessary permissions to install or execute a program.
  • Incorrect Package Version: This error occurs when the installed version of a software does not match the required version. Also, dependency mismatch can cause this error.
  • Repository Configuration Errors: Repository configuration errors can occur if the repository URLs are incorrect or if the repository is unreachable.
  • Disk Space Issues: Insufficient disk space can prevent the installation of large software packages or updates.
  • Incompatible Hardware or Software: Some software may be incompatible with certain hardware configurations or other software components for your Linux system.

To solve these installation issues in Linux, try the following steps:

  1. Install missing dependencies before installing the program.
  2. Use sudo to ensure necessary permissions to install software.
  3. Free up disk space if necessary.
  4. Check if repository configurations and sources.list file is okay.
  5. Update repository.
  6. Retry the installation after clearing the package cache.

Conclusion

In conclusion, expertise in program installation on Linux is essential for customizing systems and boosting productivity. For that, Linux provides a wide range of options including command-line tools, graphical interfaces, and source-based installation. I hope, this guide will help you to understand the basics of software installation in any Linux distribution.

People Also Ask

How do I list all installed programs?

To list all installed programs on a Linux system, you can use the package manager of your Linux distribution. For example, on Debian-based systems like Ubuntu, you can use the dpkg -l command. Similarly, on RedHat-based systems like CentOS, you can use the rpm-qa command.

How to search programs for installation in Linux?

To search a program for installation on a Linux system, you can use the package manager of your Linux distribution. For example, on Debian-based systems like Ubuntu, use apt search command followed by the keyword. Similarly, on RedHat-based systems like CentOS, use yum search <keyword> command. For Arch Linux, use pacman -Ss <keyword> command.

Where to install programs in Linux?

Package managers of your system handle the installation location automatically. However, install executable binaries in directories like /usr/bin or /usr/local/bin, configuration files in /etc, libraries in /usr/lib or /usr/local/lib, and additional program data may reside in directories such as /var or /opt such as /opt/appname.

How to install software on Linux Mint?

To install software on Linux Mint, you can use either the command-line package manager or the graphical software manager. In the command-line, use the apt install command followed by the package name. For example, to install the VLC media player, run sudo apt install vlc. To use the Software Manager, open it from Menu and type the program name in the search bar. Then click on “Install” button.

1/5 - (1 vote)
Ashikur Rahman

Hello, I’m Ashikur Rahman, currently working as a Linux Content Developer Executive at SOFTEKO. I have completed my graduation in Computer Science and Engineering from Khulna University of Engineering & Technology (KUET). Also, I’m pursuing my master’s in the same department at Bangladesh University of Engineering & Technology (BUET). I like to learn new technologies, contribute, and share those with others. Here my goal is to provide beneficial and user-friendly articles on Linux distribution for everyone. Read Full Bio

Leave a Comment