How To Install A Package In Linux

How To Install A Package In Linux

Reading time1 min
#Linux#OpenSource#Software#PackageManagement#LinuxPackages

Mastering Package Installation on Linux: Beyond Apt and Yum

Forget the one-size-fits-all approach; exploring lesser-known package managers and manual installation methods reveals the true flexibility and power of Linux systems. Whether you’re a developer, sysadmin, or a passionate Linux user, understanding how to install software beyond the popular apt (Debian/Ubuntu) and yum (CentOS/RHEL) commands can significantly boost your productivity and system stability.

In this post, we’ll dive into alternative package managers and manual installation techniques that work across various Linux flavors. By the end, you’ll feel confident handling software installs regardless of your distro or setup.


Why Go Beyond Apt and Yum?

Typically, when we need to install a program on Linux, we reach for:

  • sudo apt install package-name on Debian-based distros
  • sudo yum install package-name or dnf on Red Hat-based systems

But what if:

  • Your distro doesn’t use apt or yum? (e.g., Arch Linux uses pacman)
  • You want more control over the software version or build options
  • The package isn't available in standard repos
  • You want to install from source or use containerized package formats

Exploring other methods empowers you to work efficiently regardless of environment.


Alternative Package Managers You Should Know

1. Pacman — The Arch Linux Powerhouse

If you’re using Arch or derivatives like Manjaro, pacman is your go-to.

Installing a package

sudo pacman -S package-name

Example

sudo pacman -S neofetch

Pacman combines binary package management with build capabilities via AUR helpers (like yay)—more on that soon.


2. Zypper — OpenSUSE’s Robust Tool

OpenSUSE uses zypper, which offers advanced dependency resolution.

sudo zypper install package-name

Example:

sudo zypper install vim

Zypper can also add repos, patch the system, or rollback changes — handy when managing complex setups.


3. Snap — Universal Linux Packages From Canonical

Snap packages bundle dependencies neatly and run in confined sandboxes. They work across many distros without worrying about underlying libraries.

Install snapd if not installed

sudo apt update && sudo apt install snapd      # Ubuntu/Debian example

Install a snap package

sudo snap install vlc

Snaps auto-update and separate applications cleanly from your base system.


4. Flatpak — Another Universal Format

Flatpak is similar to Snap but often preferred in Fedora, GNOME-focused distros, and more.

Install Flatpak

sudo apt install flatpak   # Debian/Ubuntu example

Add Flathub repo

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

Install a flatpak app

flatpak install flathub org.gimp.GIMP

Run it via:

flatpak run org.gimp.GIMP

Manual Install: Compiling From Source

Sometimes precompiled packages aren’t available or are outdated. Compiling from source can be a rewarding option.

Typical steps:

  1. Install build dependencies

    On Debian/Ubuntu:

    sudo apt update && sudo apt install build-essential checkinstall libssl-dev
    
  2. Download source code

    Usually from GitHub or official websites:

    git clone https://github.com/example/project.git
    cd project/
    
  3. Configure the build

    Many projects use ./configure; others might use CMake:

    ./configure --prefix=/usr/local
    
  4. Build & Install

    make            # Compile the source code 
    sudo make install  # Install binaries and resources system-wide 
    
  5. Verify installation

    Check the program version or run it directly:

    project-name --version
    

Note: Using tools like checkinstall instead of make install creates a native .deb or .rpm package for easier uninstall later.


Bonus: Using AppImage for Portable Software

AppImage is an easy way to run applications without installing anything system-wide.

Steps:

  1. Download an AppImage file from the official site.
  2. Make it executable:
chmod +x MyApp.AppImage 
  1. Run it directly:
./MyApp.AppImage 

No root permissions needed, no system pollution — great for testing!


Summary Table of Package Managers & Methods

MethodExample CommandUse CaseDistribution Coverage
Aptsudo apt install <pkg>Popular Debian/Ubuntu installsUbuntu, Debian
Yum/DNFsudo yum install <pkg>RHEL-family distributionsCentOS, Fedora (later replaced by DNF)
Pacmansudo pacman -S <pkg>Arch Linux ecosystemArch Linux
Zyppersudo zypper install <pkg>OpenSUSE usersOpenSUSE
Snapsudo snap install <pkg>Universal containerized appsCross-distro support
Flatpakflatpak install flathub <app-id>Universal sandboxed appsCross-distro support
Manual Source BuildCompile via: configure → make → make installCustomized builds & cutting-edge versionsAny distro w/ build tools
AppImageRun .AppImage directlyPortable appsAny distro w/ FUSE support

Final Tips for Smooth Package Installing Experience

  • Always read official documentation when possible.
  • Use your distro’s native manager first to keep things clean.
  • When compiling from source, keep track of installed files.
  • Use sandboxed formats like Snap or Flatpak to avoid dependency hell.
  • Update your repos regularly to get latest security fixes.

Mastering these tools opens doors to experimenting with fewer boundaries — truly harnessing the flexibility of Linux!

Happy installing! 🚀


Did you find this guide helpful? Feel free to share your experiences installing tricky packages below!