All Projects β†’ rami3l β†’ Pacaptr

rami3l / Pacaptr

Licence: gpl-3.0
Pacman-like syntax wrapper for many package managers.

Programming Languages

rust
11053 projects

Projects that are alternatives of or similar to Pacaptr

meta-package-manager
🎁 a wrapper around all package managers
Stars: ✭ 277 (+100.72%)
Mutual labels:  homebrew, package-manager, apt, pacman
Whalebrew
Homebrew, but with Docker images
Stars: ✭ 3,352 (+2328.99%)
Mutual labels:  package-manager, homebrew
choco
Chocolatey - the package manager for Windows
Stars: ✭ 8,643 (+6163.04%)
Mutual labels:  package-manager, chocolatey
Hb Appstore
Homebrew App Store - GUI for downloading/managing homebrew apps for video game consoles
Stars: ✭ 463 (+235.51%)
Mutual labels:  package-manager, homebrew
Termux Apt Repo
Script to create Termux apt repositories.
Stars: ✭ 131 (-5.07%)
Mutual labels:  package-manager, apt
Brew
🍺🐧 The Homebrew package manager for Linux
Stars: ✭ 2,600 (+1784.06%)
Mutual labels:  package-manager, homebrew
ansible-apt
Ansible role to manage packages and up(date|grade)s in Debian-like systems
Stars: ✭ 21 (-84.78%)
Mutual labels:  package-manager, apt
Aura
A secure, multilingual package manager for Arch Linux and the AUR.
Stars: ✭ 998 (+623.19%)
Mutual labels:  package-manager, pacman
Trizen
Lightweight AUR Package Manager
Stars: ✭ 696 (+404.35%)
Mutual labels:  package-manager, pacman
Brew
🍺 The missing package manager for macOS (or Linux)
Stars: ✭ 30,318 (+21869.57%)
Mutual labels:  package-manager, homebrew
Ansible Role Homebrew
Ansible Role - Homebrew
Stars: ✭ 195 (+41.3%)
Mutual labels:  package-manager, homebrew
Apt Offline
Offline APT Package Manager
Stars: ✭ 102 (-26.09%)
Mutual labels:  package-manager, apt
Xrepo
πŸ—‚οΈ A cross-platform C/C++ package manager based on Xmake
Stars: ✭ 162 (+17.39%)
Mutual labels:  package-manager, homebrew
pakket
The last package manager macOS will ever need. Simple, functional, and fast.
Stars: ✭ 20 (-85.51%)
Mutual labels:  homebrew, package-manager
Ansible Aur
Ansible module to manage packages from the AUR
Stars: ✭ 149 (+7.97%)
Mutual labels:  package-manager, pacman
Fzf Scripts
a collection of scripts that rely on https://github.com/junegunn/fzf
Stars: ✭ 158 (+14.49%)
Mutual labels:  apt, pacman
Zebra
πŸ¦“ A Useful Package Manager for iOS
Stars: ✭ 667 (+383.33%)
Mutual labels:  package-manager, apt
Cli
The command line vault (Windows, macOS, & Linux).
Stars: ✭ 1,044 (+656.52%)
Mutual labels:  homebrew, chocolatey
Pacui
Bash script providing advanced Pacman and Yay/Pikaur/Aurman/Pakku/Trizen/Pacaur/Pamac-cli functionality in a simple UI
Stars: ✭ 103 (-25.36%)
Mutual labels:  package-manager, pacman
Borealis
Hardware accelerated, controller and TV oriented UI library for PC and Nintendo Switch (libnx).
Stars: ✭ 135 (-2.17%)
Mutual labels:  homebrew

pacaptr

pacaptr

pacΒ·aptΒ·r, or the PACman AdaPTeR, is a wrapper for many package managers with pacman-style command syntax, started as a Rust port of icy/pacapt.

It's highly recommended to set pacman as the alias of pacaptr on your non-ArchLinux OS.

Run pacman -Syu on the OS of your choice!

> pacaptr -S neofetch
  Pending `brew reinstall neofetch`
  Proceed [YES/All/No/^C]? y
  Running `brew reinstall neofetch`
==> Downloading https://homebrew.bintray.com/bottles/neofetch-7.1.0
########################################################### 100.0%
==> Reinstalling neofetch
==> Pouring neofetch-7.1.0.big_sur.bottle.tar.gz
🍺  /usr/local/Cellar/neofetch/7.1.0: 6 files, 351.7KB

Contents


Supported Package Managers

pacaptr currently supports the following package managers (in order of precedence):

Windows

scoop, choco

macOS

brew, port

Linux

apt, apk, dnf, zypper

External

conda, brew, pip/pip3, tlmgr

These are only available with the pacaptr --using <name> syntax.

Notes

As for now, the precedence is still (unfortunately) hardcoded. For example, if both scoop and choco are installed, scoop will be the default. You can however edit the default package manager in your config.

Please refer to the compatibility table for more details on which operations are supported.

Feel free to open a feature/pull request to add support for other package managers :)

Installation

We needs your help to achieve binary distribution of pacaptr on more platforms!

With brew

brew install rami3l/tap/pacaptr

With choco

choco install pacaptr

With cargo

As for now, uploading pacaptr to crates.io has been blocked by cargo/#4468, so we have to stick with GitHub when building from source:

# To install:
cargo install --git https://github.com/rami3l/pacaptr.git

# To clone and install (for Rustaceans):
git clone https://github.com/rami3l/pacaptr.git && cd pacaptr
cargo install --path .

# To uninstall:
cargo uninstall pacaptr

With default settings, the binary should be installed as:

$HOME/.cargo/bin/pacaptr

For Alpine Linux users, cargo build won't just work, please try this instead:

RUSTFLAGS="-C target-feature=-crt-static" cargo build

Packaging for Debian

cargo install cargo-deb
cargo deb

Configuration

The default path for the config file is $HOME/.config/pacaptr/pacaptr.toml, which can be overridden by the PACAPTR_CONFIG environment variable.

I decided not to trash user's $HOME without their permission, so:

  • If the user hasn't yet specified any path to look at, we will look for the config file in the default path.

  • If the config file is not present anyway, a default one will be loaded with Default::default, and no files will be written.

Example
# This enforces the use of `install` instead of
# `reinstall` in `pacaptr -S`
needed = true

# Explicitly set the default package manager
default_pm = "choco"

# dry_run = false
# no_confirm = false
# no_cache = false

General Tips

--using, --pm

Use this flag to explicitly specify the underlying package manager to be invoked.

# Here we force the use of `choco`,
# so the following output is platform-independent:
pacaptr --using choco -Su --dryrun
# Canceled: choco upgrade all

This can be useful when you are running Linux and you want to use linuxbrew, for example. In that case, you can --using brew.

Automatic sudo invocation (since v0.9.0)

If you are not root and you wish to do something requiring sudo, pacaptr will do it for you by invoking sudo -S.

This feature is currently available for apk, apt, dnf, port and zypper.

Extra flags support

The flags after a -- will be passed directly to the underlying package manager:

pacaptr -h
# USAGE:
#     pacaptr [FLAGS] [KEYWORDS]... [-- <EXTRA_FLAGS>...]

pacaptr -S curl docker --dryrun -- --proxy=localhost:1234
# Canceled: foo install curl --proxy=localhost:1234
# Canceled: foo install docker --proxy=localhost:1234

Here foo is the name of your package manager. (The actual output is platform-specific, which largely depends on if foo can actually read the flags given.)

--dryrun, --dry-run

Use this flag to just print out the command to be executed (sometimes with a --dry-run flag to activate the package manager's dryrun option).

Pending means that the command execution has been blocked by a prompt; Canceled means it has been canceled in a dry run; Running means that it has started running.

Some query commands might still be run, but anything "big" should have been stopped from running, eg. installation. For instance:

# Nothing will be installed,
# as `brew install curl` won't run:
pacaptr -S curl --dryrun
# Canceled: brew install curl

# Nothing will be deleted here,
# but `brew cleanup --dry-run` is actually running:
pacaptr -Sc --dryrun
# Running: brew cleanup --dry-run
# .. (showing the files to be removed)

# To remove the forementioned files,
# run the command above again without `--dryrun`:
pacaptr -Sc
# Running: brew cleanup
# .. (cleaning up)

--yes, --noconfirm, --no-confirm

Use this flag to trigger the corresponding flag of your package manager (if possible) in order to answer "yes" to every incoming question.

This option is useful when you don't want to be asked during installation, for example, but it can also be dangerous if you don't know what you're doing!

--nocache, --no-cache

Use this flag to remove cache after package installation.

This option is useful when you want to reduce Docker image size, for example.

Platform-Specific Tips

brew

  • Please note that cask is for macOS only.

  • Be careful when a formula and a cask share the same name, eg. docker.

    pacaptr -Si docker | rg cask
    # => Warning: Treating docker as a formula. For the cask, use homebrew/cask/docker
    
    # Install the formula `docker`
    pacaptr -S docker
    
    # Install the cask `docker`
    pacaptr -S homebrew/cask/docker
    
    # Make homebrew treat all keywords as casks
    pacaptr -S docker -- --cask
    
  • To use -Rss, you need to install rmtree first:

    brew tap beeftornado/rmtree
    

choco

  • Don't forget to run in an elevated shell! You can do this easily with tools like gsudo.

pip

  • Use pacaptr --using pip3 if you want to run the pip3 command.

Postscript

Coming from Arch Linux to macOS, I really like the idea of having an automated version of Pacman Rosetta for making common package managing tasks less of a travail thanks to the concise pacman syntax.

Initially, I found icy/pacapt which does just that, and I made this project to improve pacapt's homebrew (especially cask) support. (See pacapt/#117.)

After some discussions in pacapt/#126, I decided to rewrite the project in Rust to improve readability, testing, etc.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].