Giter VIP home page Giter VIP logo

upt's Introduction

UPT — Universal Package-management Tool

Build status Crates.io

Upt provides a unified command interface to manage packages for any operating system.

Upt relies on the platform's package management tool to perform the task, it's more like a wrapper or adaptive alias.

Install

Use Cargo

Upt is written in the rust so you can install it using cargo.

cargo install upt

Use Shell (Mac, Linux)

curl -fsSL https://raw.githubusercontent.com/sigoden/upt/main/install.sh | sh -s -- --to /usr/local/bin

Binaries for macOS, Linux, Windows, BSD

Download from GitHub Releases, unzip and add upt to your $PATH.

Features

Unified command interface

Each operating system (OS) has its own package management tool, which requires different commands to complete the same operation. This can be inconvenient when switching between or trying new OSs.

apt install $pkg          # Ubuntu, Debian, Linux Mint...
apk add $pkg              # Alpine
pacman -S $pkg            # Arch, Manjaro...
nix-env -i $pkg           # Nixos
xbps-install $pkg         # Voidlinux
emerge $pkg               # Gentoo

With upt, You just need to remember one command:

upt install $pkg          # Works on any OS

Upt identifies the os type and runs the appropriate package management tool to install $pkg.

Act as another tool

Upt can act as another tool and use their syntax by renaming it.

cp upt brew
brew install $pkg

cp upt pacman
pacman -S $pkg

cp upt emerge
emerge $pkg

In this way, you can use the syntax of the tool you are most familiar with to manage packages.

Supported tools

| 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        | choco list                        |
| 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(termux) | 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 *           | scoop list                        |
| slackpkg    | slackpkg install $pkg       | slackpkg remove $pkg        | slackpkg upgrade $pkg           | slackpkg search $pkg  | slackpkg info $pkg             | 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 | xbps-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 |

OS Tools

+------------------------------------------------------+----------------------+
| OS                                                   | Tools                |
+------------------------------------------------------+----------------------+
| windows                                              | scoop, choco, winget |
+------------------------------------------------------+----------------------+
| macos                                                | brew, port           |
+------------------------------------------------------+----------------------+
| ubuntu, debian, linuxmint, pop, deepin, elementray   | apt                  |
| kali, raspbian, aosc, zorin, antix, devuan, bodhi    |                      |
| lxle, sparky                                         |                      |
+------------------------------------------------------+----------------------+
| fedora, redhat, rhel, amzn, ol, almalinux, rocky     | dnf, yum             |
| oubes, centos, qubes, eurolinux                      |                      |
+------------------------------------------------------+----------------------+
| arch, manjaro, endeavouros, arcolinux, garuda        | pacman               |
| antergos, kaos                                       |                      |
+------------------------------------------------------+----------------------+
| alpine, postmarket                                   | apk                  |
+------------------------------------------------------+----------------------+
| opensuse, opensuse-leap, opensuse-tumbleweed         | zypper               |
+------------------------------------------------------+----------------------+
| nixos                                                | nix-env              |
+------------------------------------------------------+----------------------+
| gentoo, funtoo                                       | emerge               |
+------------------------------------------------------+----------------------+
| void                                                 | xbps                 |
+------------------------------------------------------+----------------------+
| mageia                                               | urpm                 |
+------------------------------------------------------+----------------------+
| slackware                                            | slackpkg             |
+------------------------------------------------------+----------------------+
| solus                                                | eopkg                |
+------------------------------------------------------+----------------------+
| openwrt                                              | opkg                 |
+------------------------------------------------------+----------------------+
| nutyx                                                | cards                |
+------------------------------------------------------+----------------------+
| crux                                                 | prt-get              |
+------------------------------------------------------+----------------------+
| freebsd, ghostbsd                                    | pkg                  |
+------------------------------------------------------+----------------------+
| android                                              | pkg(termux)          |
+------------------------------------------------------+----------------------+
| haiku                                                | pkgman               |
+------------------------------------------------------+----------------------+
| *                                                    | apt, dnf, pacman     |
+------------------------------------------------------+----------------------+

Upt will determine which package management tool to use based on the above table.

Some platforms may support multiple package management tools, upt selects one of them in order.

You can specify the package manager that UPT should use by setting the UPT_TOOL environment variable.

UPT_TOOL=brew upt install $pkg            # equal to `brew install $pkg`
UPT_TOOL=nix-env upt install $pkg         # equal to `nix-env -i $pkg`

License

Copyright (c) 2023-∞ upt-developers.

Upt is made available under the terms of either the MIT License or the Apache License 2.0, at your option.

See the LICENSE-APACHE and LICENSE-MIT files for license details.

upt's People

Contributors

eatradish avatar jdkelley avatar pascalberger avatar sigoden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

upt's Issues

Purge operation

UPT is really awesome (Now I will not have to deal with the one-character syntax of pacman anymore :D).
However, to uninstall a package, you can :

  1. Remove the package
  2. Purge the package

But UPT does not support the second method.
Could you add support for it (maybe not supported by all the package manager)?

Anyway, thanks for the project!

Support scoop

First, I love the program idea! I have had something similar on my todo for quite some time.

For Windows users, there is a popular package manager called scoop

https://scoop.sh/

It would be great if upt could support it just as it handles choco today.

Currently on my Windows 10 system using scoop, all I get when running upt is

$ scoop info wget
Name: wget
Description: A command-line utility for retrieving files using HTTP, HTTPS, FTP, and FTPS protocols.
Version: 1.20.3
Website: https://eternallybored.org/misc/wget/
License: GPL-3.0-or-later (https://spdx.org/licenses/GPL-3.0-or-later.html)
Manifest:
  C:\Users\m\scoop\buckets\main\bucket\wget.json
Installed: No
Binaries:
  wget.exe

$ upt show wget
The system cannot find the file specified. (os error 2)

$ upt update
The system cannot find the file specified. (os error 2)

sudo apt upgrade '-y' feature ?

Any chance the '-y' gets added to the blenders ? Its pretty much what annoys me on arch linux... and this could be an killer feature if well adapted as well as this wonderfull universal package tool you guys got going on.

Unable to run upt subcommand that requires sudo

I installed UPT via cargo. And I'm using Ubuntu under WSL2.
When I attempt to run show subcommand, it works:

Details
❯ upt show tldr
Package: tldr
Version: 0.6.4-1build6.3
Priority: optional
Section: universe/doc
Source: haskell-tldr
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Original-Maintainer: Debian Haskell Group <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 2903 kB
Depends: libc6 (>= 2.34), libcmark0.30.2 (>= 0.30.2), libffi8 (>= 3.4), libgmp10, git
Conflicts: tldr-py (<< 0.7.0-2~)
Homepage: https://github.com/psibi/tldr-hs#readme
Download-Size: 573 kB
APT-Sources: http://archive.ubuntu.com/ubuntu jammy/universe amd64 Packages
Description: Haskell tldr client
 Haskell tldr client with support for updating and viewing tldr pages.
 .
 The TLDR pages are a community effort to simplify the beloved man
 pages with practical examples.  See https://tldr.sh/

But when I tried to run install:

❯ upt install tldr
E: Could not open lock file /var/lib/dpkg/lock-frontend - open (13: Permission denied)
E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?

So I ran it with sudo:

❯ sudo upt install tldr
sudo: upt: command not found

What is it that I need to do here to allow upt to be run with sudo?
I think I'm missing something obvious but not mentioned in the documentation.
Thanks!

Alias to remove

Upt is the best tool I’ve found for package installation management.

I’d like to require a feature, nothing quite new… it’s almost a muscle memory for me to type uninstall instead of remove, so I wanna ask you to add upt uninstall as an alias to upt remove.

Would it be a problem? Could you do it? I believe I could do it if you don’t mind.

Please don't use --classic with snap install

Snaps come in various confinement levels. Most common are strict, classic and (sometimes) devmode. The majority are strict and so are confined, such that the application cannot access things outside the approved interfaces such as home, network, and camera.

A classic snap has no such confinement, and can access all files on the computer.

When using snap install, if the user selects a classic snap, they will be informed of this fact, with this message:

alan@nuc:~$ snap install code
error: This revision of snap "code" was published using classic confinement and
       thus may perform arbitrary system changes outside of the security
       sandbox that snaps are usually confined to, which may put your system at
       risk.

       If you understand and want to proceed repeat the command including
       --classic.

If and only if the user decides they want to take the risk of installing the snap, they can optionally choose to install the snap by adding the --classic option.

upt pre-fills --classic on every snap install, whether the user asked or not. Even worse, it only actually shows its own warning about classic snaps on non classic snaps!

This is not a good way to implement snap installation. upt should ideally show the user the message above, and allow them the choice to use the --classic option or not.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.