> ## Content Index
> Fetch the complete content index at: https://itsfoss.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# UPT: Universal Package Management Tool for Linux
- URL: https://itsfoss.com/upt/
- Published: 2024-03-13T05:05:32.000Z
- Updated: 2024-03-28T02:17:18.000Z
- Description: One command to rule them all! Or more like one command to manage all the packages on all the distributions.
- Author: Community
- Tags: Terminal

The world of software packages on Linux and other Unix-based systems is quite a savannah: each system has its own singular package management approach, making life hell for people who have to deal with multiple platforms.

There are [Pacman](https://wiki.archlinux.org/title/Pacman?ref=itsfoss.com) for Arch Linux and derivatives, [Alpine Package Keeper](https://docs.alpinelinux.org/user-handbook/0.1a/Working/apk.html?ref=itsfoss.com) (a.k.a. APK), [Advanced Package Tool](https://wiki.debian.org/Apt?ref=itsfoss.com) (a.k.a. APT) for Debian GNU/Linux and derivatives, [Aptitude](https://tracker.debian.org/pkg/aptitude?ref=itsfoss.com), a front-end for APT, [Snapcraft](https://snapcraft.io/?ref=itsfoss.com) for Ubuntu and derivatives, [Yellowdog Updater Modified](http://yum.baseurl.org/?ref=itsfoss.com) (a.k.a. Yum) for RPM-based systems, [Slackpkg](https://slackpkg.org/?ref=itsfoss.com) for Slackware, [Emerge](https://wiki.gentoo.org/wiki/Emerge?ref=itsfoss.com) for Gentoo, the `guix` command on [Guix](https://guix.gnu.org/?ref=itsfoss.com), and `nix-env` on [NixOS](https://nixos.org/?ref=itsfoss.com), among others, not to mention [pkg](https://man.freebsd.org/cgi/man.cgi?query=pkg&ref=itsfoss.com) on FreeBSD, [Homebrew](https://brew.sh/?ref=itsfoss.com) for macOS, and [Scoop](https://scoop.sh/?ref=itsfoss.com) for Windows. Every one of those has its own way of management, forcing you to learn different ways to do the same thing.

In short, it’s really a mess… or is it?

## Enter UPT

A developer called [sigoden](https://github.com/sigoden?ref=itsfoss.com) has created a universal tool called [Universal Package-management Tool](https://crates.io/crates/upt?ref=itsfoss.com), or **UPT** for short, able to put things together in this jungle. Once you have it installed, you won’t need to learn another package management’s *lifestyle* again.

UPT is written in Rust so you need to [install Rust and Cargo on Ubuntu](https://itsfoss.com/install-rust-cargo-ubuntu-linux/) or whatever Linux distribution you are using.

I recommend installing the [rustup](https://rustup.rs/?ref=itsfoss.com) package for your system – GNU/Linux systems usually have a `rustup` package available in their repositories.

📋

All the following commands are intended to be performed by the root user, unless stated otherwise, so don’t forget to run your `sudo -i` command.

```sh
# On Debian GNU/Linux and derivatives:
apt install gcc make rustup

# On Arch Linux and derivatives:
packman -S gcc make rustup

# On Alpine:
apk add gcc make rustup
rustup-init
source ~/.cargo/env

# On RPM-based systems:
yum install gcc make rustup

# On macOS with Homebrew (not Linux, obviously)
brew install clang make rustup

```

📋

I use `clang` instead of `gcc`, and it works as well for me, you’re just going to need to set your `CC` and `CPP` environment variables, if you also want to use it too, to `clang` and `clang++ -E` respectively.

After installing `rustup`, don’t forget to add `$HOME/.cargo/bin` to your `PATH`. If you’re using Bash as shell (usually the default shell), you have to add the following line to `~/.bash_profile`:

```bash
export PATH=$HOME/.cargo/bin:$PATH

```

If your shell is Zsh, you can add the same line above to `~/.zshrc` instead. Don’t forget to reload the shell.

Now you can install the `upt` command tool:

```sh
rustup default stable
cargo install upt

```

If you want to use an administration user (e.g. in the wheel or sudo group), you should perform the same commands above as the administrator user.

All set! Now you have a single package management tool you can use the same way across your systems.

## Using UPT

Updating the package manager:

```sh
sudo upt update

```

![running "upt update" command with sudo permissions in terminal](https://itsfoss.com/content/images/2024/03/upt-update-command-run.svg)

`upt update`

Installing a package:

```sh
sudo upt install package_name

```

![Install a package using upt](https://itsfoss.com/content/images/2024/03/install-package-upt.svg)

Install package

Upgrading a package:

```sh
sudo upt upgrade package_name

```

![Upgrade a package using upt upgrade command](https://itsfoss.com/content/images/2024/03/upgrade-a-package.svg)

Upgrade a package

Upgrading all installed packages:

```sh
sudo upt upgrade

```

![Upgrade packages using UPT command](https://itsfoss.com/content/images/2024/03/upt-upgrade-command.svg)

Upgrade packages

Removing a package:

```sh
sudo upt remove package_name

```

![Remove a package using UPT](https://itsfoss.com/content/images/2024/03/remove-a-package-using-upt.svg)

Remove a package

Searching for a package (`vtk` for instance):

```sh
sudo upt search vtk

```

![Search for a package using UPT](https://itsfoss.com/content/images/2024/03/search-for-a-package.svg)

Search for a package

If the same package is available in apt (deb), Snap, Flatpak etc., which one should UPT choose while installing? It is determined by the order listed in [this table](| Tool        | Install                     | Uninstall                   | Upgrade                         | Search                     | Info                           | Update Index             | Upgrade All              | List Installed                    | | ----------- | --------------------------- | --------------------------- | ------------------------------- | -------------------------- | ------------------------------ | ------------------------ | ------------------------ | --------------------------------- | | upt         | upt install $pkg            | upt remove/uninstall $pkg   | upt upgrade $pkg                | upt search $pkg            | upt info/show $pkg             | upt update               | upt upgrade              | upt list                          | | apk         | apk add $pkg                | apk del $pkg                | apk upgrade $pkg                | apk search $pkg            | apk info $pkg                  | apk update               | apk upgrade              | apk list -I/--installed           | | apt         | apt install $pkg            | apt remove $pkg             | apt install --only-upgrade $pkg | apt search $pkg            | apt show $pkg                  | apt update               | apt upgrade              | apt list -i/--installed           | | brew        | brew install $pkg           | brew uninstall $pkg         | brew upgrade $pkg               | brew search $pkg           | brew info $pkg                 | brew update              | brew upgrade             | brew list                         | | cards       | cards install $pkg          | cards remove $pkg           | cards install -u/--upgrade $pkg | cards search $pkg          | cards info $pkg                | cards sync               | cards upgrade            | cards list                        | | choco       | choco install $pkg          | choco uninstall $pkg        | choco upgrade $pkg              | choco search $pkg          | choco info $pkg                | choco upgrade all --noop | choco upgrade all        | choco list -l/--local-only        | | dnf         | dnf install $pkg            | dnf remove $pkg             | dnf upgrade $pkg                | dnf search $pkg            | dnf info $pkg                  | dnf check-update         | dnf update               | dnf list --installed              | | emerge      | emerge $pkg                 | emerge --depclean $pkg      | emerge --update $pkg            | emerge --search $pkg       | emerge --info $pkg             | emerge --sync            | emerge -vuDN @world      | qlist -lv                         | | eopkg       | eopkg install $pkg          | eopkg remove $pkg           | eopkg upgrade $pkg              | eopkg search $pkg          | eopkg info $pkg                | eopkg update-repo        | eopkg upgrade            | eopkg list-installed              | | flatpak     | flatpak install $pkg        | flatpak uninstall $pkg      | flatpak update $pkg             | flatpak search $pkg        | flatpak info $pkg              | -                        | flatpak update           | flatpak list                      | | guix        | guix install $pkg           | guix remove $pkg            | guix upgrade $pkg               | guix search $pkg           | guix show $pkg                 | guix refresh             | guix upgrade             | guix package -I/--list-installed  | | nix-env     | nix-env -i/--install $pkg   | nix-env -e/--uninstall $pkg | nix-env -u/--upgrade $pkg       | nix-env -qaP $pkg          | nix-env -qa --description $pkg | nix-channel --update     | nix-env -u/--upgrade     | nix-env -q/--query --installed    | | opkg        | opkg install $pkg           | opkg remove $pkg            | opkg upgrade $pkg               | opkg find $pkg             | opkg info $pkg                 | opkg update              | opkg upgrade             | opkg list --installed             | | pacman      | pacman -S $pkg              | pacman -Rs $pkg             | pacman -S $pkg                  | pacman -Ss $pkg            | pacman -Si $pkg                | pacman -Sy               | pacman -Syu              | pacman -Q                         | | pkg         | pkg install $pkg            | pkg remove $pkg             | pkg install $pkg                | pkg search $pkg            | pkg info $pkg                  | pkg update               | pkg upgrade              | pkg info -a/--all                 | | pkg%28termux%29 | pkg install $pkg            | pkg uninstall $pkg          | pkg install $pkg                | pkg search $pkg            | pkg show $pkg                  | pkg update               | pkg upgrade              | pkg list-installed                | | pkgman      | pkgman install $pkg         | pkgman uninstall $pkg       | pkgman update $pkg              | pkgman search $pkg         | -                              | pkgman refresh           | pkgman update            | pkgman search -i -a               | | prt-get     | prt-get install $pkg        | prt-get remove $pkg         | prt-get update $pkg             | prt-get search $pkg        | prt-get info $pkg              | ports -u                 | prt-get sysup            | prt-get listinst                  | | scoop       | scoop install $pkg          | scoop uninstall $pkg        | scoop update $pkg               | scoop search $pkg          | scoop info $pkg                | scoop update             | scoop update %2A           | scoop list                        | | slackpkg    | slackpkg install <slackpkg> | slackpkg remove <slackpkg>  | slackpkg upgrade <slackpkg>     | slackpkg search <slackpkg> | slackpkg info <slackpkg>       | slackpkg update          | slackpkg upgrade-all     | ls -1 /var/log/packages           | | snap        | snap install --classic $pkg | snap remove $pkg            | snap refresh $pkg               | snap find $pkg             | snap info $pkg                 | -                        | snap refresh             | snap list                         | | urpm        | urpmi $pkg                  | urpme $pkg                  | urpmi $pkg                      | urpmq -y/--fuzzy $pkg      | urpmq -i $pkg                  | urpmi.update -a          | urpmi --auto-update      | rpm -q/--query --all              | | winget      | winget install $pkg         | winget uninstall $pkg       | winget upgrade $pkg             | winget search $pkg         | winget show $pkg               | -                        | winget upgrade --all     | winget list                       | | xbps        | xbps-install $pkg           | xbps-remove $pkg            | xbps-install -u/--update $pkg   | xbps-query -Rs $pkg        | xbps-query -RS $pkg            | xbps-install -S/--sync   | xbps-install -u/--update | qxbps-query -l/--list-pkgs        | | yum         | yum install $pkg            | yum remove $pkg             | yum upgrade $pkg                | yum search $pkg            | yum info $pkg                  | yum check-update         | yum update               | yum list --installed              | | zypper      | zypper install $pkg         | zypper remove $pkg          | zypper update $pkg              | zypper search $pkg         | zypper info $pkg               | zypper refresh           | zypper update            | zypper search -i/--installed-only ).

To prefer a snap package over another, you can set the `UPT_TOOL` environment variable. On the bottom of your bashrc file, add the line:

```
export UPT_TOOL='snap'
```

Now, if you run (do not use sudo on the below command):

```
sudo upt install vlc
```

It will prompt for a password. Give it and the snap package will be installed.

0:00 

/0:15 

1× 

Install snap package using UPT

You can see that, the snap version of VLC has been installed.

![Snap version of VLC is installed](https://itsfoss.com/content/images/2024/03/upt-install-snap.png)

Snap version of VLC is installed

## Conclusion

As you can see, UPT needs initial effort to install, which is not a lot for seasoned Linux users. 

Unfortunately, although the package manager is the same across different systems, it’s still a front-end for each system's default package manager. That means package names are still the same used by each distro, you can’t use a single package name for different systems.

For instance, if you want to install the Python development package, you’ll need different packages for different systems:

```sh
# On Alpine, Debian GNU/Linux, and derivatives
upt install python3-dev

# On RPM-based systems:
upt install python3-devel

# On Arch Linux
upt install python

```

![](https://itsfoss.com/content/images/2024/03/python-has-no-installation-candidate.png)

Package `Python` has no installation candidate 

For Ubuntu users, there is a similar tool called Nala that may interest you. 

[Apt++? Nala is Like Apt in Ubuntu but BetterNala is a Python-based frontend for apt package management. Inspired by the DNF package manager, Nala seems like a promising tool for Ubuntu and Debian users.![](https://itsfoss.com/content/images/size/w256h256/2022/12/android-chrome-192x192.png)It's FOSSSagar Sharma![](https://itsfoss.com/content/images/wordpress/2022/11/nala-apt-frontend.png)](https://itsfoss.com/nala/)

I hope you like learning about such interesting CLI tools. Stay tuned for more.

✍️

[Rodrigo Montegasppα Cacilhας](https://github.com/cacilhas?ref=itsfoss.com) is a Linux veteran with over 25 years of experience playing with Linux systems and writing code.