World News

3 safe ways to install Linux apps that aren’t in your repo (without breaking anything)

https://www.profitableratecpm.com/f4ffsdxe?key=39b1ebce72f3758345b2155c98e6709c

Summary

  • Update your package cache (apt update, pacman -Sy) before assuming a package is missing.
  • Use AUR or PPAs for missing packages: AUR is community-vetted; vet PPAs before adding.
  • Use Snap/Flatpak/AppImage or install .deb/.rpm binaries; compile from source only as last resort.

Linux package managers make it super simple to install and upgrade software. However, you will inevitably run into a ‘target package not found’ error. Here is what you can do when that happens.

Before you give up on the official repos

Your package manager doesn’t search for packages online every time. The search actually runs on a local cache. If you haven’t updated that local list in some time, it falls out of sync with the online repos and your package manager can’t locate the package, even if it’s available in the official repos. So even if you get a message like ‘the target package has no installation candidate,’ it doesn’t necessarily mean that the package is unavailable on the remote servers.

The easiest way to fix this is to update the local database and re-sync it with the official repos. On Debian and Ubuntu systems, you can run the following command to update the local list of packages.

sudo apt update
Type sudo apt update into the Ubuntu terminal and press Enter to update your software package repository list.

On an Arch system, you can get Pacman to re-sync and refresh the package lists with this command.

sudo pacman -Syu
Screenshot showing upgrading CachyOS via the pacman command.

After running the update command, try installing your target app again.

Consider unofficial repos

The official Pacman repos aren’t as big as APT’s, so it’s a usual occurrence for Pacman to come up empty when you try to install a package. Lucky for us, the community picks up the slack. The Arch User Repository, or AUR, is a community-maintained repo with a huge library of packages that are missing from the official Pacman repos.

Instead of prebuilt packages, however, AUR is a library of “pkgbuild” scripts. These scripts act as recipes for compiling the software on-device. You don’t even have to run these scripts manually because there are tools called AUR helpers that automate the whole thing for you. For example, you can use Pacman to install an AUR helper like “yay” and then use that to install your target package.

sudo pacman -S yay
yay -S signal-desktop
Installing the Signal messenger with yay

Ubuntu and Debian users can check Canonical’s Launchpad or UbuntuUpdates for Personal Package Archives or PPAs. You have to manually add the target PPAs to the APT package manager and then attempt to install the app again.

sudo add-apt-repository 
Ubuntu terminal showing the confirmation prompt for adding a new PPA with APT

After updating the local app list again, run this command.

sudo apt update

Then try installing your target package with APT.

By and large, AUR packages are mostly safe because the community vets them, provides feedback, and flags harmful packages. However, compiling from source can take longer, even if you use an AUR helper.

The AUR Arch User Repository Homepage.

You have to be more cautious with PPAs because anyone can host them and there is no central portal where they can be vetted or flagged. Make you trust the provider before adding the repo APT.

Look for a universal package

There are a handful of package formats that are designed to run on any Linux distribution. Formats like Flatpaks and Snap packages can run on most Linux distributions. These packages are siloed, complete with all their dependencies, so they can run independently inside a sandbox. It also means that they’re heavier and take a little longer to launch. Since they don’t come from your distro’s default package manager, they’re not updated with the rest of your apps either. You have to manually update them.

A lot of people don’t like Flatpaks and Snap packages, but I think it’s better to have the option. Snap is already bundled with Ubuntu and Ubuntu-based distros. If your distro doesn’t have it, you can install it using the following APT command.

sudo apt install snapd

You can then use Snapd to install Snap packages from the Canonical app store.

sudo snap install firefox
A screenshot of installing Mozilla Firefox via Snap on Ubuntu.

Flatpaks are just as easy to install. We start by installing the Flatpak package manager.

sudo apt install flatpak

Then add the Flatpak repository.

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

You can install Flatpaks with one-line commands.

flatpak install flathub com.usebottles.bottles
Using Flatpak command to install bottles on Linux.

Install binaries

Platform-specific binaries like .deb archives for Debian or Ubuntu and .rpm for Fedora are another option. Sometimes, just double-clicking these file formats starts the GUI installer utility. Alternatively, you can stick with the terminal. Use “wget” to download the .deb or .rpm file and then install it using these commands.

For Ubuntu,

sudo dpkg -i ./package_name.deb

For .rpm packages,

sudo dnf install ./package_name.rpm

You might also find precompiled binaries as tarballs. The idea is to decompress the archive into the “usr/local/bin” directory and access the app from there.

For example, you can download the neovim package from the official GitHub repo.

wget https://github.com/neovim/neovim/releases/download/nightly/nvim-linux-x86_64.tar.gz
Using wget to download a tarball.

Then extract into a folder of your choice.

tar xzvf nvim-linux-x86_64.tar.gz

Then run neovim.

./nvim-linux-x86_64/bin/nvim

You can press Tab to autofill the file names.

If all else fails, you can always compile the app from the source. Depending on your hardware resources and the target software’s complexity, compiling from source can take quite some time.


If you’re using Arch or an Arch-based distro, AUR is your best bet for getting software outside the official repos. For other distros, it’ll be safer and more convenient to use a universal package format like Snap, Flatpak, or AppImage. If you don’t like Flatpaks or Snap, precompiled binaries are also an option. They’re easy to install and perform better than those universal packages.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button