How To Install App In Linux

How To Install App In Linux

Reading time1 min
#Linux#OpenSource#Software#AppImage#Flatpak#Snap

Mastering App Installation on Linux: Beyond the Package Manager

Dependency deadlocks. Vendor releases that outpace your distro’s repositories. Desktop tools that need containers—or isolation from your core system. These are routine scenarios in modern Linux environments, and they demand a flexible approach to application installation.

Default to your distro’s package manager (apt, dnf, pacman, zypper). That’s what most do. But this isn’t always sufficient—especially if immediate access to the latest releases, minimized risk to base libraries, or isolated execution environments are required. Here’s a breakdown of alternative strategies, with practical examples and field-tested caveats.


When Package Managers Aren’t Enough

Native package managers solve most issues: transactional installs, signed repositories, and dependency resolution all help maintain system stability. Still, issues arise:

  • Delayed versions. Not uncommon: apt holds Firefox at ESR while upstream is multiple cycles ahead.
  • Missing software. Commercial vendors (e.g., VS Code) or niche open source tools may not be packaged.
  • Global side effects. System-level installs alter environments for all users.
  • Dependency hell. Conflicts or outdated system libraries occasionally break new installs.

Before reaching for manual workarounds, weigh the trade-off between reproducibility and convenience.


Direct Vendor Packages (.deb, .rpm, Tarballs)

Vendors frequently release distribution-specific packages or archive installs—sometimes only here are the latest security fixes or features available.

Example: Installing Google Chrome (Ubuntu 22.04, as of 2024-06):

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i google-chrome-stable_current_amd64.deb
# If dependencies break:
sudo apt-get -f install

Note: Dependency mismatches sometimes occur, particularly when backporting binaries to older distros. For auto-updates, always add the corresponding vendor repository.

Pros:

  • Bypass outdated repo versions
  • Vendor signatures (sometimes)

Cons:

  • Update process may be manual (‘dpkg -i’ is not transactional)
  • Uninstall inconsistencies between vendors

Gotcha: .tar.gz or .tar.xz archives often require manual extraction to /opt or ~/bin—and symbolic links or .desktop files aren’t always included.


Universal, Containerized Formats: Snap, Flatpak, AppImage

Cross-distro, sandboxed, and mostly vendor-agnostic. These formats emphasize dependency isolation over minimal size.

Snap (Canonical):

sudo snap install --classic code   # For VS Code, allows classic confinement

Updates are managed by snapd (~daily by default), but snaps may introduce slow startup times due to squashfs mounting.

Flatpak:

sudo apt install flatpak
flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo
flatpak install flathub org.videolan.VLC

Flatpaks run under Bubblewrap isolation; some apps require specific GTK versions, watch for them.

AppImage:

  • Download the .AppImage.
  • chmod +x ./AppName.AppImage
  • Run: ./AppName.AppImage

No background service required; updates are manual (integrate with appimaged to automate).

FormatIsolationUpdatesStart SpeedIntegrates with
SnapStrongAutoSlow*Ubuntu, others
FlatpakMediumSemiMediumGNOME, KDE
AppImageMinimalManualFastAny

*Snap startup lag is a widely-reported usability issue, especially on first run.


Building From Source

For edge-case requirements (custom compile flags, feature toggles not included by packagers, or security audits), direct compilation is still viable.

Install example (htop, 3.3.0):

sudo apt build-dep htop                # For all required build libs (on Ubuntu/Debian)
git clone https://github.com/htop-dev/htop.git
cd htop
./autogen.sh && ./configure
make -j4                               # Use all CPU cores
sudo make install

Error? Expect issues such as:

configure: error: no acceptable C compiler found in $PATH

which means you’re missing build-essential or equivalent.

Note: To avoid make install scattering files system-wide, use checkinstall to generate a .deb or .rpm for cleaner uninstalls:

sudo apt install checkinstall
sudo checkinstall

Language-Specific Package Managers

CLI tooling frequently lives outside base system RPMs/DEBs. Pip, npm, go, cargo—all offer rapid access to developer utilities or desktop integrations.

Examples:

pip3 install --user awscli==2.15.0
npm install -g yarn@1.22.19
cargo install ripgrep --version 14.0.2

Install with the --user (pip) or equivalent to avoid breaking system packages. Known issue: mixing OS-level and per-user installs can cause PATH conflicts or version drift.


Containers (Docker, Podman, LXD)

When total isolation is necessary (i.e., conflicting runtime libs, database sandboxes, or short-lived CI jobs), use containers.

Minimal nginx container:

docker run --rm -d -p 8080:80 --name testnginx nginx:1.25-alpine

Note: Disk footprint is non-trivial. Unused images and layers accumulate; prune periodically:

docker system prune -af

With rootless Podman or LXD, run user containers with tighter integration or lower privilege.


Summary Table

MethodGood ForDrawbacks / Side EffectsUpdate Mechanism
Package managerSystem cohesionVersion lag, repo policy limitsOS/Nightly cycles
Vendor .deb/.rpmLatest, proprietaryManual updates, repo divergenceVendor repo or manual
Snap/Flatpak/AppImageSandboxed, portableStart lag (Snap), file association quirks (AppImage)Snapd/Flatpak/appimaged
Source buildCustom flags, edgeTedious, risk of residue, uninstall painManual
Language managersDev CLI/toolsPATH conflicts, dependency driftTool-managed
ContainersEnvironment parityPull size, resource allocationDocker/Podman updates

Practical Tips

  • Always verify the cryptographic signature or checksum before running downloaded binaries or packages.
  • For production environments, favor repeatable sources (i.e., stick to your distribution package manager or CI-approved images).
  • If you must install globally, memorialize the change (/var/log/apt/history.log, or version-controlled install scripts).
  • Don’t mix system and per-user locations for Python (/usr/bin/python3 vs. ~/.local/bin) without necessity—makes troubleshooting sparse runtime failures easier.

Occasionally, none of these methods quite fit, and that’s the unsolved gap: hybrid packaging remains unfinished business on Linux. For now, keep your toolchain flexible and expect a little mess.


Non-obvious tip: AppImage tools like AppImageLauncher (see AppImageLauncher GitHub) can integrate frequent AppImage invocations more cleanly with your desktop environment—without heavy system modification. Worth a look if you use AppImages regularly.


Got a unique deployment scenario or niche installer? There’s nearly always a workaround. Evaluate side effects before pushing to production.