sodcalculator

10 Tech How-To

Install Software in Linux Distros: A Guide

Guide 10-55995 · Updated · Step by step

Installing software on Linux varies by distribution, but the core methods are package managers, graphical software centers, and manual installation. This guide explains the main approaches, how to choose the right one, and how to troubleshoot common issues.

Background: Why Linux Installation Differs

Unlike Windows or macOS, where you typically download an installer from a website, Linux distributions use package managers to handle software. A package manager tracks every file, dependency, and update for each program. This centralization makes installation, updating, and removal more reliable and secure. Different distributions use different package formats and managers, which is why a command that works on Ubuntu may not work on Fedora.

Package Managers: The Core of Installation

Most distributions are divided into two families based on their package format:

  • Debian/Ubuntu family uses .deb packages and the apt package manager. Commands include apt update, apt install, and apt remove.
  • Red Hat/Fedora family uses .rpm packages and the dnf (or yum on older systems) package manager. Commands include dnf install and dnf remove.
  • Arch Linux uses the pacman package manager with its own format. Commands include pacman -S and pacman -R.
  • openSUSE uses zypper with .rpm packages.

There are also universal formats like Snap, Flatpak, and AppImage that work across many distributions. These bundle dependencies with the application, which reduces compatibility issues but uses more disk space.

How to Install via Command Line

Using the terminal is often the fastest and most reliable method. Here are the basic steps for Debian/Ubuntu and Fedora:

  1. Update the package list to ensure you get the latest versions: sudo apt update (Debian) or sudo dnf check-update (Fedora).
  2. Search for a package if you are unsure of the exact name: apt search keyword or dnf search keyword.
  3. Install the package: sudo apt install package-name or sudo dnf install package-name.
  4. Remove a package when no longer needed: sudo apt remove package-name or sudo dnf remove package-name.

Always use sudo for system-wide changes, as it grants administrator privileges. If you omit sudo, you may get a permission error.

Graphical Software Centers

For users who prefer a graphical interface, most distributions include a software center. These are front-ends to the package manager and allow you to search, install, and update applications with a few clicks. Examples include:

  • GNOME Software (on Ubuntu, Fedora, and others)
  • Discover (on KDE Plasma)
  • Pamac (on Manjaro)

These tools often support multiple sources, such as Flatpak and Snap, so you can install apps from different repositories. They also handle automatic updates, which is convenient for less technical users.

Manual Installation: .deb, .rpm, and AppImage

Sometimes a package is not in your distribution’s repositories. You may need to download a file from the software’s website. Here are the common formats:

  • .deb files are for Debian/Ubuntu. Install with sudo dpkg -i file.deb. If dependencies are missing, run sudo apt install -f to fix them.
  • .rpm files are for Fedora/RHEL. Install with sudo rpm -i file.rpm or sudo dnf install file.rpm (which also resolves dependencies).
  • AppImage is a portable format. You download a single file, make it executable with chmod +x file.AppImage, and run it. No installation is needed.
  • Snap and Flatpak packages can be installed via their respective commands (snap install or flatpak install) or through the software center.

Manual installation can lead to dependency issues, so it is best to prefer the official repositories when possible.

Common Problems and Solutions

Here are a few issues you might encounter and how to resolve them:

  • “Package not found”: The package name may be different, or it is not in your repositories. Try searching with apt search or check if the software is available as a Snap or Flatpak.
  • Dependency errors: When installing a .deb or .rpm manually, dependencies may be missing. Run sudo apt install -f or sudo dnf install file.rpm to let the manager fetch them.
  • Permission denied: You need to use sudo for system-wide installations. For user-level installs, consider using --user flags or Flatpak.
  • Broken packages: If a previous installation left the system in an inconsistent state, run sudo apt --fix-broken install (Debian) or sudo dnf distro-sync (Fedora).

Choosing the Right Method

For most users, the default package manager is the best choice because it ensures compatibility and ease of updates. Use the software center if you prefer a GUI. Use Snap or Flatpak when you need the latest version or an application not in the official repos. Manual installation should be your last resort, as it requires more maintenance.

If you are new to Linux, start with a beginner-friendly distribution like Ubuntu or Linux Mint, which have excellent software centers and extensive documentation.

Frequently Asked Questions

How do I update all installed software?

On Debian/Ubuntu, run sudo apt update followed by sudo apt upgrade. On Fedora, use sudo dnf upgrade. For Snap and Flatpak, run sudo snap refresh and flatpak update respectively.

Why does my distribution use a different package manager?

Different distributions are built around different philosophies and technical choices. Debian and its derivatives use apt because it is mature and stable. Fedora uses dnf for its modern features and performance. Arch uses pacman for its simplicity and rolling-release model. Each has its own community and support structure.

Can I install software without an internet connection?

Yes, but it is more complicated. You can download .deb or .rpm files on another computer and transfer them via USB. However, dependencies may be missing. Some distributions allow you to create a local repository from installation media, but this is advanced.

What is the difference between Snap and Flatpak?

Both are universal packaging systems that bundle dependencies. Snap is developed by Canonical and works on many distributions, but its backend is proprietary. Flatpak is community-driven and focuses on desktop applications, with a more open backend. Both can be installed on most modern distributions.

Is it safe to install software from the internet?

It depends on the source. Official repositories are vetted and secure. Third-party websites may offer modified or malicious packages. Always download from the official site of the software and verify checksums if possible. Use apt or dnf to install from trusted repositories.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →