Skip to main content

Command Palette

Search for a command to run...

How Do I Install a Program in Linux

Updated
6 min read

Installing a program in Linux might seem tricky if you’re new to it. But once you get the hang of it, you’ll see it’s quite straightforward. Whether you want to install a simple app or a complex software package, Linux offers several ways to do it. You just need to know which method fits your needs best.

In this article, I’ll guide you through the most common ways to install programs in Linux. We’ll cover using package managers, terminal commands, and graphical software centers. By the end, you’ll feel confident installing any program on your Linux system.

Understanding Linux Software Installation

Linux doesn’t work like Windows or macOS when it comes to installing software. Instead of downloading an installer from a website, Linux uses package managers. These tools handle downloading, installing, updating, and removing software automatically.

Package managers connect to software repositories—online storage locations with thousands of programs tested for your Linux distribution. This system keeps your software safe and up to date.

Here are some popular package managers you might encounter:

  • APT (Advanced Package Tool): Used by Debian, Ubuntu, and related distros.
  • DNF (Dandified Yum): Used by Fedora and Red Hat-based distros.
  • Pacman: Used by Arch Linux and its derivatives.
  • Zypper: Used by openSUSE.

Knowing your Linux distribution helps you pick the right package manager and commands.

Installing Programs Using Package Managers

Using a package manager is the easiest and safest way to install software on Linux. You can do this through the terminal or a graphical interface.

Installing with APT (Debian, Ubuntu)

If you use Ubuntu, Debian, or Linux Mint, APT is your go-to tool.

  1. Open your terminal.
  2. Update your package list to get the latest software info:
    sudo apt update
    
  3. Install the program by typing:
    sudo apt install program-name
    
  4. Wait for the installation to finish.

For example, to install the VLC media player, you’d type:

sudo apt install vlc

Installing with DNF (Fedora, Red Hat)

Fedora users use DNF, which works similarly to APT.

  1. Open the terminal.
  2. Update your package list:
    sudo dnf check-update
    
  3. Install your program:
    sudo dnf install program-name
    

For example, to install GIMP, type:

sudo dnf install gimp

Installing with Pacman (Arch Linux)

Arch Linux users rely on Pacman.

  1. Open the terminal.
  2. Update your package database:
    sudo pacman -Sy
    
  3. Install the program:
    sudo pacman -S program-name
    

For example, to install Firefox:

sudo pacman -S firefox

Installing with Zypper (openSUSE)

openSUSE uses Zypper.

  1. Open the terminal.
  2. Refresh repositories:
    sudo zypper refresh
    
  3. Install the program:
    sudo zypper install program-name
    

For example, to install LibreOffice:

sudo zypper install libreoffice

Using Graphical Software Centers

If you prefer not to use the terminal, most Linux distributions offer graphical software centers. These apps let you browse, search, and install programs with a few clicks.

Ubuntu Software Center

Ubuntu’s Software Center is user-friendly and similar to app stores on other platforms.

  • Open the Software Center from your applications menu.
  • Use the search bar to find the program you want.
  • Click “Install” and enter your password if prompted.
  • The software installs automatically.

GNOME Software

Many distros with the GNOME desktop use GNOME Software.

  • Open GNOME Software.
  • Search for your app.
  • Click “Install” and wait for it to finish.

KDE Discover

KDE Plasma users have Discover.

  • Open Discover.
  • Browse or search for software.
  • Click “Install” and authenticate if needed.

Graphical centers are great for beginners or those who prefer a visual approach.

Installing Programs from .deb and .rpm Files

Sometimes, you might download software directly from a developer’s website. These files usually come as .deb or .rpm packages.

Installing .deb Files

Debian-based distros use .deb files.

  • Open the terminal.
  • Navigate to the folder with the .deb file.
  • Run:
    sudo dpkg -i package-name.deb
    
  • If there are missing dependencies, fix them with:
    sudo apt-get install -f
    

Installing .rpm Files

Fedora and openSUSE use .rpm files.

  • Open the terminal.
  • Navigate to the folder with the .rpm file.
  • Run:
    sudo rpm -i package-name.rpm
    
  • Or use DNF for better dependency handling:
    sudo dnf install package-name.rpm
    

Using Snap and Flatpak Packages

Snap and Flatpak are universal package formats that work across many Linux distributions. They bundle all dependencies, making installation easier.

Installing Snap Packages

Snap is developed by Canonical (Ubuntu’s parent company).

  • First, ensure snapd is installed:
    sudo apt install snapd
    
  • Search for a snap package:
    snap find program-name
    
  • Install it:
    sudo snap install program-name
    

For example, to install Spotify:

sudo snap install spotify

Installing Flatpak Packages

Flatpak is popular for sandboxed apps.

  • Install Flatpak support:
    sudo apt install flatpak
    
  • Add the Flathub repository (main source for Flatpak apps):
    flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
    
  • Search for an app:
    flatpak search program-name
    
  • Install it:
    flatpak install flathub program-name
    

For example, to install GIMP:

flatpak install flathub org.gimp.GIMP

Compiling Programs from Source Code

If a program isn’t available in repositories or as a package, you can compile it from source. This method is more advanced but sometimes necessary.

Steps usually include:

  1. Download the source code (often a .tar.gz file).
  2. Extract the archive:
    tar -xvzf program.tar.gz
    
  3. Navigate into the folder:
    cd program-folder
    
  4. Run configuration:
    ./configure
    
  5. Compile the program:
    make
    
  6. Install it:
    sudo make install
    

This process requires developer tools like gcc and make. You can install them with your package manager.

Tips for Troubleshooting Installation Issues

Sometimes installations don’t go smoothly. Here are some tips to help:

  • Check your internet connection: Package managers need internet to download software.
  • Update your package lists: Run sudo apt update or equivalent before installing.
  • Fix broken dependencies: Use commands like sudo apt-get install -f to fix missing packages.
  • Read error messages carefully: They often tell you what went wrong.
  • Search online: Linux forums and communities are great resources.

Conclusion

Installing programs in Linux is easier than it looks. Whether you use a package manager like APT or DNF, a graphical software center, or universal packages like Snap and Flatpak, you have many options. Knowing your Linux distribution and preferred method helps you install software quickly and safely.

You can also install software from downloaded .deb or .rpm files or compile from source if needed. With a little practice, you’ll find installing programs in Linux is a smooth and rewarding experience.

FAQs

How do I know which package manager my Linux uses?

Your Linux distribution determines the package manager. For example, Ubuntu uses APT, Fedora uses DNF, Arch uses Pacman, and openSUSE uses Zypper. You can check your distro’s documentation for details.

Can I install Windows programs on Linux?

Not directly. However, you can use compatibility layers like Wine or virtualization software to run some Windows programs on Linux.

What is the difference between Snap and Flatpak?

Both are universal package formats that bundle dependencies. Snap is developed by Canonical and integrates well with Ubuntu, while Flatpak is more desktop-agnostic and focuses on sandboxing apps.

Is it safe to install software from third-party .deb or .rpm files?

Only install from trusted sources. Third-party packages can pose security risks if they come from unknown or unverified sites.

How do I uninstall a program in Linux?

You can uninstall using your package manager. For example, with APT:

sudo apt remove program-name

Or use your graphical software center’s uninstall option.

More from this blog

L

LinuxBloke | Linux Tips, Tricks & Troubleshooting

672 posts