Apt, DNF, Zypper, Pip, Cargo, XYZ! App Rules Them All

Distrohopping and don't remember the package management commands all the time. App tries to solve this problem.
Warp Terminal

Managing packages in Linux distribution varies depending on the distribution. All the Debian-based distros use APT as the package management app. While Fedora uses DNF, openSUSE depends on Zypper package manager.

Recently, distro-agnostic package managers like Snap, Flatpak, AppImage, etc. made the scene even more fragmented.

More package managers mean more commands to get familiar with.

If that's what you feel as you distrohop around the Linux-verse, I have a new app for you. It's called app 😬

App, a cross-platform package management assistant written in Go, can help you in this scenario. Basically it is a wrapper for package managersand offers the same commands on all supported distributions. It means you don't need to memorize per-distro package management commands.

That's not it. The app keeps a record of installed applications in its config file. So, if you move distros, just use the previous config file to install the same packages in the new distro.

🚧
In my opinion, you should stick to the official package managers, specially if you are managing a critcal infrastructure. Don't experiment with such tools if you easily get overwhelmed and don't like to troubleshoot.

Install App Package Management Assistant

The App provides an installation script, which you can install on any Linux distribution. Open a terminal and run the command below:

bash <(curl -sL https://hkdb.github.io/app/getapp.sh)
Install App package management assistant using the installation script provided by the project.
Install App Utility

To update the app to the latest version, use:

app -m app update
Update App utility to a latest version.
Update App Utility

What happens behind the scene

App utility has its own simpler syntax. Since the utility uses the same syntax across distributions, you only need to remember the syntax of App utility.

When you install an app using the app command, it records the action. Be it an installation or removal of the package, the information is stored inside the ~/.config/app directory.

Now, when you want to migrate to another distribution, you can copy this directory and paste it inside the ~/.config folder of the new distribution to start installing packages. We will see the process in detail in the next section.

πŸ“‹
For the App to work, you need to install the packages using the app command. Only then the package details are stored and restored on a new system.

Basic App utility commands

Let's see some of the important commands you need to remember while using this tool.

Enable/Disable necessary package managers

By default, package managers like Flatpak, Snap, AppImage, Yay, Pip, Go, and Cargo are disabled.

You can enable them using the general syntax:

app -m <package-manager> enable

For example, to enable Flatpak support,

app -m flatpak enable
Enable Flatpak support in App to log details of Flatpak Apps.
Enable Flatpak Support

To disable an enabled package manager, use the command:

app -m <package-manager> disable
Disable a Pacakge Manager to stop logging details about packages installed through that package manager.
Disable a Package Manager

Search for packages

In order to search for packages using the App utility, do the following:

app search <package-name>
Search for packages in the official repos. Here, Ubuntu 24.04 is used, so apt is the default package manager and Ubuntu repos are searched.
Search for packages in official repos

To search for a package on another package manager like Flathub, specify the package manager.

app -m <package-manager> search <package-name>

For example, if I am searching for Blackbox terminal emulator in Flatpak, I will run:

app -m flatpak search blackbox
Search for a package from the Flathub repo by explicitly specifying flatpak.
Search packages in Flatpak Flathub

Install a package

To install a package on your system, run the command:

app install <package-name>

Let's say I want to install fortune. So I will run:

app install fortune
Install an app from the official repositories using the App utility.
Install a package

Install apps from other package manager

To install an app as a Flatpak, use the command:

app -m flatpak install <package-name>
Install a Flatpak package using the App package management utility.
Install a Flatpak package

This is a general formula, so, we can install packages from other package managers using:

app -m <package-manager> install <package-name>

Install an AppImage

First go to the directory where the AppImage file is downloaded. Now, to install the AppImage file:

app -m appimage install <appimage-file-name>

I have an AppImage of Standard Notes app. So, I will open my Downloads directory in a terminal and run:

app -m appimage install standard-notes-3.195.1-linux-x86_64.AppImage
Install an AppImage file to log the details to the App utility.
Install an AppImage File

On the official page, you have a detailed description of all package managers that are supported and respective installation methods.

πŸ’‘
The project has a neat documentation on installing apps like Brave browser, that needs its own repo configuration.

List installed packages

You can list the packages that were installed using App from official repos by using the command:

app history

Similarly, to list all the installed packages from a particular repository, run:

app -m <package-manager> history
Get the app install history with the app utility
App install history

Remove a package

To remove a package, you can use:

app remove <package-name>
Remove a package using the App commad so that the detail of that package is removed from the database.
Remove a Package

For other package managers, use:

app -m <package-manager> remove <package-name>
Remove a Flatpak app using the app command so that the details about the particular package is removed from the database.
Remove a Flatpak Package

If you are on a Debian-based distribution, you can use purge as well.

app purge <package-name>

Similarly, App supports autoremove for native package managers.

app autoremove

Upgrade packages

To upgrade all the packages installed on the system, use the command:

app update
app upgrade all

At the same time, the App allows individual package manager upgrades as well. For this, use the syntax:

app -m <package-manager> upgrade

Add PPA in Ubuntu

In an Ubuntu-based system, you can use PPA to install additional packages that are not available in the native Ubuntu repositories or there are old versions available in the repos.

So, if you are using the App for installing packages, you need to use the syntax:

app add-repo ppa:graphics-drivers/ppa

Restoring the packages in another distro

🚧
While restoring packages in cross-platform, not all platforms have the same package names.

Now, when you want to hop to a new distro, or want to replicate the current distribution, all you need to do is described below.

πŸ“‹
You need to set up the extra package managers like Flatpak, Snap, etc. before starts restoring.

First, install the App utility on the new system, as mentioned in the first section.

Now, copy the ~/.config/app directory to the new system. Then open a terminal and run:

app -r all

That's it. Your packages will be installed on the new system.

🚧
Restoring Flatpak apps on a new system asked me to select an app from a huge list. So, when I inspected its ~/.config/app/packages/flatpak.json file, there was an additional space present on the beginning of the line.
I removed that space and rerun the command to restore Flatpak apps successfully.

You can restore individual package managers separately by using the command:

app -r <package-manager>

Conclusion

This seems like a useful tool if you distrohop quite often. You can get the list of the packages you install regularly and you can install them with less effort on a new system.

There are a few tools like Nala that try to provide similar features.

By the way, we are also offering Linux courses through our other portal. Something you might be interested in.

Linux For DevOps - Courses by Linux Handbook
Welcome to the β€œLinux for DevOps” course! In the fast-paced world of DevOps, proficiency in Linux is not just a skill but a necessity. Whether you are new to Linux or looking to deepen your skills, this course will guide you through essential concepts, command-line operations, and system administration tasks…
About the author
Sreenath

Sreenath

Linux tinkerer by day, Lord of the Rings fanatic by night. When I'm not busy conquering the command line, you can find me kicking back and watching some football while quoting JRR Tolkien

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.