How to Install Software in Linux

How to Install Software in Linux Linux is one of the most powerful, secure, and flexible operating systems available today. Whether you're a developer, sysadmin, student, or hobbyist, the ability to install software efficiently and securely is a foundational skill. Unlike Windows or macOS, where applications are often installed via graphical installers, Linux relies on package managers, repositori

Oct 30, 2025 - 10:12
Oct 30, 2025 - 10:12
 0

How to Install Software in Linux

Linux is one of the most powerful, secure, and flexible operating systems available today. Whether you're a developer, sysadmin, student, or hobbyist, the ability to install software efficiently and securely is a foundational skill. Unlike Windows or macOS, where applications are often installed via graphical installers, Linux relies on package managers, repositories, and command-line tools to manage software. This can seem intimidating at first, but once understood, it offers unparalleled control, consistency, and security.

This guide provides a comprehensive, step-by-step walkthrough of how to install software in Linux. We’ll cover the most common package managers, best practices for safe installations, essential tools, real-world examples, and answers to frequently asked questions. By the end, you’ll be able to install, update, and remove software confidently on any major Linux distribution—whether it’s Ubuntu, Fedora, Debian, Arch, or CentOS.

Step-by-Step Guide

Installing software on Linux begins with understanding the ecosystem. Linux distributions use package managers to handle software installation, dependencies, and updates. These tools connect to centralized repositories—trusted sources where software is vetted and maintained. Below is a detailed breakdown of how to install software using the most common package managers across major Linux distributions.

Understanding Package Managers and Repositories

Before installing any software, it’s crucial to understand the role of package managers and repositories.

  • Package Manager: A tool that automates the installation, upgrading, configuration, and removal of software packages. Examples include apt, dnf, pacman, and zypper.
  • Repository: A server or directory that stores software packages. Repositories are maintained by the distribution’s community or vendor and are trusted sources for safe, tested software.

Most Linux systems come preconfigured with default repositories. These include base system packages, security updates, and commonly used applications. Additional repositories (called PPAs, COPR, or AUR) can be added for newer or third-party software.

Installing Software on Ubuntu and Debian (apt)

Ubuntu and Debian use the Advanced Package Tool (APT) as their default package manager. APT works with .deb packages and is one of the most widely used systems in the Linux world.

Step 1: Update the Package List

Before installing any software, always update your local package index to ensure you’re installing the latest versions available in the repositories.

sudo apt update

This command fetches the latest package lists from all configured repositories. It does not install anything—it only refreshes your system’s knowledge of what’s available.

Step 2: Search for a Package (Optional)

If you’re unsure of the exact package name, search for it:

apt search firefox

This will return a list of packages related to “firefox,” including the main browser package, language packs, and development libraries.

Step 3: Install the Package

Once you know the package name, install it using:

sudo apt install firefox

APT will automatically resolve and install all dependencies required for Firefox to run.

Step 4: Verify Installation

After installation, verify the software is installed and accessible:

firefox --version

or launch it from the application menu.

Step 5: Remove Software (Optional)

To uninstall a package:

sudo apt remove firefox

To remove the package and its unused dependencies:

sudo apt autoremove

Installing Software on Fedora, RHEL, and CentOS (dnf)

Fedora, Red Hat Enterprise Linux (RHEL), and CentOS use DNF (Dandified YUM) as their default package manager. DNF is faster and more reliable than its predecessor, YUM.

Step 1: Update the System

sudo dnf update

This ensures all existing packages are up to date before installing new software.

Step 2: Search for a Package

dnf search chrome

This returns packages matching “chrome,” such as google-chrome-stable.

Step 3: Install the Package

sudo dnf install google-chrome-stable

DNF will automatically resolve dependencies and prompt you to confirm the installation. Type y and press Enter to proceed.

Step 4: Check Installation

google-chrome --version

Step 5: Remove Software

sudo dnf remove google-chrome-stable

To clean up unused dependencies:

sudo dnf autoremove

Installing Software on Arch Linux and Derivatives (pacman)

Arch Linux and its derivatives (like Manjaro) use pacman as their package manager. Arch follows a rolling-release model, meaning packages are constantly updated, and users are expected to keep their systems current.

Step 1: Update the System

sudo pacman -Syu
  • -S: Sync (install)
  • -y: Refresh package database
  • -u: Upgrade all packages

This command ensures your system is fully updated before installing new software.

Step 2: Search for a Package

pacman -Ss firefox

This searches the package database for matches.

Step 3: Install the Package

sudo pacman -S firefox

Pacman will download and install Firefox along with its dependencies.

Step 4: Verify Installation

firefox --version

Step 5: Remove Software

sudo pacman -R firefox

To remove dependencies no longer needed:

sudo pacman -Rns firefox
  • -n: Remove config files
  • -s: Remove unused dependencies

Installing Software on openSUSE (zypper)

openSUSE uses zypper as its command-line package manager. It’s known for its robust dependency resolution and clear output.

Step 1: Refresh Repositories

sudo zypper refresh

This updates the list of available packages from all configured repositories.

Step 2: Search for a Package

zypper search firefox

Step 3: Install the Package

sudo zypper install firefox

Zypper will display a summary of what will be installed and ask for confirmation.

Step 4: Verify Installation

firefox --version

Step 5: Remove Software

sudo zypper remove firefox

To clean up orphaned dependencies:

sudo zypper autoremove

Installing Software from Source Code (tar.gz or .tar.xz)

Sometimes, software is not available in official repositories. In such cases, you may need to compile from source. This method gives you full control over build options but requires more technical knowledge.

Step 1: Install Build Tools

Most distributions require a compiler and development libraries. Install them using your package manager:

  • Debian/Ubuntu: sudo apt install build-essential
  • Fedora/RHEL: sudo dnf groupinstall "Development Tools"
  • Arch: sudo pacman -S base-devel

Step 2: Download the Source Code

Visit the official project website and download the source archive (usually .tar.gz or .tar.xz). For example:

wget https://example.com/software-1.2.3.tar.gz

Step 3: Extract the Archive

tar -xzf software-1.2.3.tar.gz

Step 4: Navigate to the Extracted Directory

cd software-1.2.3

Step 5: Read the Installation Instructions

Always check for files like README or INSTALL before proceeding:

cat README

Step 6: Configure the Build

Run the configuration script (usually provided by autotools):

./configure

This script checks your system for required libraries and sets up build parameters. You may pass options:

./configure --prefix=/usr/local --enable-features

Step 7: Compile the Software

make

This step compiles the source code into executable binaries. It may take several minutes depending on the software and your hardware.

Step 8: Install the Compiled Software

sudo make install

This copies the compiled files to system directories (e.g., /usr/local/bin).

Step 9: Verify Installation

software-name --version

Important Note: Software installed from source is not tracked by your package manager. To remove it later, you may need to manually delete files or use make uninstall if the project supports it.

Installing Software Using Snap, Flatpak, and AppImage

As Linux fragmentation increases, universal packaging formats like Snap, Flatpak, and AppImage have gained popularity. They bundle applications with all dependencies, making them distribution-agnostic.

Snap Packages

Snap is developed by Canonical (Ubuntu’s parent company) and is supported on most major distributions.

Install Snap (if not already present)

sudo apt install snapd

Search for a Snap

snap find firefox

Install a Snap

sudo snap install firefox

Snap packages auto-update and are sandboxed for security.

Flatpak Packages

Flatpak is a more open alternative to Snap, supported by the freedesktop.org community.

Install Flatpak

sudo apt install flatpak

Add the Flathub Repository

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

Search for an App

flatpak search firefox

Install the App

flatpak install flathub org.mozilla.firefox

Run the App

flatpak run org.mozilla.firefox

AppImage

AppImage is a single-file format that requires no installation. It’s ideal for portable applications.

Download an AppImage

Visit https://appimage.org/ and download an .AppImage file (e.g., Firefox.AppImage).

Make It Executable

chmod +x Firefox.AppImage

Run It

./Firefox.AppImage

AppImages can be moved anywhere and deleted without leaving traces. No root access is required.

Best Practices

Installing software on Linux is straightforward, but following best practices ensures system stability, security, and maintainability.

Always Prefer Official Repositories

Software from official repositories is tested, signed, and maintained by your distribution’s team. It’s the safest and most reliable source. Avoid downloading .deb or .rpm files from random websites.

Use Package Managers Over Manual Downloads

Package managers handle dependencies automatically. Installing a .deb or .rpm manually may break your system if dependencies are missing or conflicting.

Keep Your System Updated Regularly

Regular updates include security patches and bug fixes. Schedule weekly updates using:

  • Debian/Ubuntu: sudo apt update && sudo apt upgrade
  • Fedora: sudo dnf upgrade
  • Arch: sudo pacman -Syu

Avoid Running Untrusted Code

Never run shell scripts from the internet without reviewing them first. For example:

wget https://example.com/install.sh && sudo bash install.sh

This is extremely dangerous. Always inspect scripts before executing them. Look for commands like rm -rf, curl piping to bash, or modifications to system files.

Use Version Control for Custom Installs

If you install software from source or use custom configurations, keep a log of what you installed, where you downloaded it from, and any flags used. This helps with troubleshooting and reproducibility.

Be Cautious with Third-Party Repositories

Adding repositories like PPAs (Ubuntu) or COPR (Fedora) can provide newer software, but they may introduce instability or security risks. Only add repositories from trusted sources (e.g., official project pages).

Use Snap or Flatpak for Desktop Apps

For GUI applications, Snap and Flatpak offer sandboxing, automatic updates, and consistent behavior across distributions. They’re ideal for end-user software like browsers, media players, and office suites.

Don’t Use Root Unless Necessary

Only use sudo when installing system-wide packages. Avoid running applications as root. Use your regular user account for daily tasks.

Backup Your System Before Major Changes

Before installing large software suites or updating your kernel, consider creating a snapshot (if using Btrfs or LVM) or backing up critical data.

Document Your Installations

Keep a simple text file or Markdown document listing installed software, versions, and installation methods. This is invaluable for system recovery or migration.

Tools and Resources

Several tools and online resources can enhance your software management experience on Linux.

Package Managers Summary

Distribution Package Manager Command to Install
Ubuntu, Debian apt sudo apt install package-name
Fedora, RHEL, CentOS dnf sudo dnf install package-name
Arch Linux pacman sudo pacman -S package-name
openSUSE zypper sudo zypper install package-name

Universal Packaging Tools

  • Snap: https://snapcraft.io/ — Universal packages with automatic updates and sandboxing.
  • Flatpak: https://flatpak.org/ — Open standard for desktop apps with Flathub as the main repository.
  • AppImage: https://appimage.org/ — Portable, single-file applications that run without installation.

Package Search Engines

  • Debian/Ubuntu: https://packages.ubuntu.com/
  • Fedora: https://packages.fedoraproject.org/
  • Arch: https://archlinux.org/packages/
  • Flathub: https://flathub.org/apps/ — Search and install Flatpak apps.
  • Snap Store: https://snapcraft.io/store

Command-Line Utilities

  • dpkg -l — List all installed packages on Debian-based systems.
  • rpm -qa — List all installed RPM packages on RHEL/Fedora.
  • pacman -Q — List installed packages on Arch.
  • which command — Find the path of an executable (e.g., which python3).
  • whereis command — Locate binary, source, and manual files.
  • man command — View manual pages for any installed tool.

Monitoring Installed Software

To see what’s consuming disk space:

du -sh /usr/* | sort -h

To list recently installed packages:

  • Debian/Ubuntu: cat /var/log/apt/history.log
  • Fedora: dnf history
  • Arch: cat /var/log/pacman.log

Automated Tools

  • Ansible: Automate software deployment across multiple Linux servers.
  • Chocolatey (for WSL): Use Windows package manager inside Linux Subsystem for Windows.
  • Homebrew (on macOS and Linux): Popular for developers using macOS who also work on Linux.

Real Examples

Let’s walk through real-world scenarios to solidify your understanding.

Example 1: Installing Python 3.11 on Ubuntu

Ubuntu 22.04 ships with Python 3.10. You need Python 3.11 for a project.

Step 1: Update

sudo apt update

Step 2: Install Software Properties Common

sudo apt install software-properties-common

Step 3: Add the Dead Snakes PPA

sudo add-apt-repository ppa:deadsnakes/ppa

Step 4: Update Again

sudo apt update

Step 5: Install Python 3.11

sudo apt install python3.11

Step 6: Verify

python3.11 --version

Output: Python 3.11.5

Example 2: Installing Docker on Fedora

Docker is not in the default Fedora repos, but it’s available via a third-party repository.

Step 1: Install Dependencies

sudo dnf -y install dnf-plugins-core

Step 2: Add Docker Repository

sudo dnf config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

Step 3: Install Docker

sudo dnf install docker-ce docker-ce-cli containerd.io

Step 4: Start and Enable Docker

sudo systemctl start docker

sudo systemctl enable docker

Step 5: Test Docker

sudo docker run hello-world

Output: Hello from Docker! — Installation successful.

Example 3: Installing Visual Studio Code via Snap

VS Code is available as a Snap package and offers seamless updates.

Step 1: Install Snap (if needed)

sudo apt install snapd

Step 2: Install VS Code

sudo snap install code --classic

The --classic flag grants broader system access required by the editor.

Step 3: Launch

Search for “Code” in your application menu or run:

code

Example 4: Installing a Game (Steam) via Flatpak

Steam is available on Flathub.

Step 1: Install Flatpak and Add Flathub

sudo apt install flatpak

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

Step 2: Install Steam

flatpak install flathub com.valvesoftware.Steam

Step 3: Launch

flatpak run com.valvesoftware.Steam

Steam will download its own runtime and set up libraries automatically.

Example 5: Compiling and Installing Neovim from Source

Neovim is not always the latest version in repositories.

Step 1: Install Build Dependencies

sudo apt install ninja-build gettext libtool libtool-bin autoconf automake cmake g++ pkg-config unzip

Step 2: Clone the Repository

git clone https://github.com/neovim/neovim.git

cd neovim

Step 3: Build

make CMAKE_BUILD_TYPE=RelWithDebInfo

Step 4: Install

sudo make install

Step 5: Verify

nvim --version

Now you’re running the latest Neovim version compiled from source.

FAQs

Can I install Windows software on Linux?

You cannot install native Windows .exe files directly on Linux. However, you can use compatibility layers like Wine to run some Windows applications. Alternatively, use virtual machines (VirtualBox, QEMU) or dual-booting for full compatibility.

Is it safe to use third-party repositories like PPAs?

PPAs and other third-party repos can be safe if they come from trusted developers or official project pages. However, they are not vetted by the distribution’s core team. Always research the maintainer, check for community feedback, and avoid PPAs that ask for root access during installation.

What’s the difference between apt, snap, and flatpak?

  • apt: Native package manager for Debian/Ubuntu. Fast, lightweight, integrates with the system.
  • snap: Universal, sandboxed, auto-updating. Larger file size due to bundled dependencies.
  • flatpak: Also universal and sandboxed, but more open and lightweight than Snap. Requires Flathub for most apps.

Why does installing from source take so long?

Compiling from source requires your system to translate human-readable code into machine instructions. This process involves parsing thousands of files, linking libraries, and optimizing for your hardware. It’s slower than installing a pre-compiled binary but allows customization and optimization.

How do I know which package manager to use?

Use the package manager native to your distribution. If you’re unsure, run cat /etc/os-release to identify your Linux distribution. Then follow the corresponding guide in this tutorial.

Can I install multiple versions of the same software?

Yes. For example, you can install Python 3.10 and Python 3.11 side-by-side. Use versioned commands (python3.10, python3.11) or tools like update-alternatives to manage defaults.

How do I uninstall software installed from source?

If the software supports it, run sudo make uninstall from the build directory. Otherwise, you’ll need to manually delete files (usually in /usr/local/bin, /usr/local/lib, etc.). Always document your installations to make removal easier.

Why can’t I find a package with apt or dnf?

The package may not be in the default repositories. Try searching online for the package name and your distribution. You may need to add a third-party repo, use Snap/Flatpak, or compile from source.

Do Snap and Flatpak slow down my system?

Snap packages are larger due to bundled dependencies, which can use more disk space. Flatpak is more efficient. Both are sandboxed, which may add minor overhead during startup, but performance impact is negligible on modern hardware.

Is Linux software installation harder than Windows?

Initially, yes—because it’s command-line driven and requires understanding repositories. But once mastered, it’s more reliable, secure, and automated than manually downloading .exe files. Package managers handle updates, dependencies, and removals seamlessly.

Conclusion

Installing software in Linux is not just a technical task—it’s a gateway to understanding how open-source systems operate. From the simplicity of apt install to the flexibility of compiling from source, Linux offers multiple paths to achieve the same goal, each with its own trade-offs.

By following the best practices outlined in this guide, you ensure your system remains secure, stable, and efficient. Always prefer official repositories, keep your system updated, and avoid running untrusted scripts. Use Snap, Flatpak, or AppImage for desktop applications when you want portability and automatic updates. Reserve source compilation for when you need the latest features or custom configurations.

Linux’s power lies in its control. You’re not just installing software—you’re managing a system. With time and practice, the command line becomes second nature, and software installation becomes a routine, almost intuitive process.

Whether you’re setting up a server, configuring a development environment, or installing your favorite desktop app, the principles in this guide will serve you across distributions and use cases. Bookmark this page, refer back to it often, and soon, you’ll be helping others navigate the Linux software ecosystem with confidence.