pacapt is an Arch's pacman-like wrapper for many package managers
(system package managers, software package managers like npm, gem, conda).
For example, the command pacapt -S htop works any supported Linux or BSD
machines, and that will install htop package.
You only need to work with the same set of command options on any OSs
and/or any software package managers.
Arch's pacman is chosen, because its set of operations
are simple and divided into three memorable major groups:
Synchronize, Query and Remove/Clean up.
The tool supports the following package managers:
pacmanbyArch Linux,ArchBang,Manjaro, etc.dpkg/apt-getbyDebian,Ubuntu, etc.homebrewbyMac OS XmacportsbyMac OS Xyum/rpmbyRedhat,CentOS,Fedora, etc.portagebyGentoozypperbyOpenSUSEpkgngbyFreeBSDcavebyExherbo Linuxpkg_toolsbyOpenBSDsun_toolsbySolaris(SunOS)apkbyAlpine LinuxtazpkgbySliTaz LinuxswupdbyClear Linux
Non-system package manager
tlmgrbyTeX LivecondabyConda
- This script shouldn't be installed on an Arch-based system;
- On
FreeBSDandAlpine Linux, please installbashpackage first.
You can download the stable script and make it executable.
On non-Arch-based system, you may use pacman as script name instead of pacapt.
$ sudo wget -O /usr/local/bin/pacapt \
https://github.com/icy/pacapt/raw/ng/pacapt
$ sudo chmod 755 /usr/local/bin/pacapt
$ sudo ln -sv /usr/local/bin/pacapt /usr/local/bin/pacman || true
For non-system package manager, you need to create symbolic links
$ ln -s /usr/local/bin/pacapt /usr/local/bin/pacapt-tlmgr
$ ln -s /usr/local/bin/pacapt /usr/local/bin/pacapt-conda
You can also use shorter links:
$ ln -s /usr/local/bin/pacapt /usr/local/bin/p-tlmgr
$ ln -s /usr/local/bin/pacapt /usr/local/bin/p-conda
noting the suffix (e.g., -tlmgr, -conda) is mandatory.
For system package manager
- Update package database:
pacapt -Sy - Install a package:
pacapt -S foo - Search a package:
pacapt -Ss foo - Remove a package:
pacapt -R foo - Upgrade system:
pacapt -Su - Remove orphans:
pacapt -Sc - Clean up:
pacapt -Sccorpacapt -Sccc
For non-system package manager: Similar as above, however you need to call correct script name, e.g.,
- Intall a Conda package:
pacapt-conda -S foo - Remove a Conda package:
pacapt-conda -R foo
See also https://github.com/icy/pacapt/blob/ng/lib/help.txt.
Some basic command line options
-h(--help): Print help message;-P: Print list of supported operations;-V: Print script version
Some popular options of the original ArchLinux's pacman program
are supported and listed in the table in the next section.
A long list of options and operations can be found from ArchLinux's wiki.
Q Qc Qe Qi Qk Ql Qm Qo Qp Qs Qu R Rn Rns Rs S Sc Scc Sccc Sg Si Sii Sl Ss Su Suy Sw Sy U
apk ~ * * * * * * * * * * * * * * * * * * * * * *
cave * * * * * * * * * * * * * * x * * * * * x
conda * * * * * * *
dnf ~ * * * * * * * * * * * * * * * * * * * * * * *
dpkg ~ * * * * * * * * * ~ * * * * * * * * * * *
homebrew ~ * * * * * * * * * * * * * * * * *
macports * * * * * ~ * * * * * * * *
pkgng * * * * * * * * * * * * * * * *
pkg_tools ~ * * * * * * * * ~ * * x * * ~ * * x
portage * * * * * * * * * * * * * * * * *
sun_tools * * * * * * *
swupd * * * * * * * * *
tazpkg * * * * * * * * * * * * *
tlmgr * * * * * * * * * *
yum * * * * * * * * * * * * * * * * * * * * * *
zypper * * * * * * * * * * * * * * * * * * * * * * * * * *
Notes:
*: Implemented;~: Implemented. Some options may not supported/implemented;x: Operation is not supported by Operating system;- The table is generated from source. Please don't update it manually.
batch-pacapt: An Arch's pacman-like package manager for Windowsnode-pacapt: A node.js wrapper of pacapt + batch-pacapt
The following message is published on project's Gitter group on Oct 09th 2018.
Hi everyone, long time no see :) I've not been using Gitter IM actively as it's not very convenient on my browser, and Gitter requires a lot of access grants to my Github profile ^.^
I've rewritten pacapt in Dlang (https://github.com/icy/pacapt/tree/nd). There are two issues remained: (1) passthrough option (2) publish artifacts (32bit binary, 64 bit binary, arm support,...) to Github/S3. I'm not sure there is any way to make this latest CI step simple and secure (Dlang hasn't had good Reproducible build yet.) Using S3 is not persistent, Github requires my personal API token...
The primary motivation of rewriting pacapt in Dlang is to support some restricted environment where Bash is not available. I picked Dlang simply it's the language I'm studying. The major parts of the project (lib/*.sh) are still in shell format. To be specific, the (binary) executable file will help to handle users' arguments and the actual steps are delegated to system shell(s).
The current stable branch (ng) still accepts active development, however it would become legacy when
ndis released. Cherry-picks are required to make contributors' works onngavailable onndbranch. (In case the names are confusing you, here is a tip:ngsounds like next generation, whilendemphasizes Dlang use.)Feel free to take a look. Any comments are appreciated.
Thx
Make sure you read some instructions in CONTRIBUTING.md.
A development script can be compiled from the source code.
$ git clone https://github.com/icy/pacapt.git
$ cd pacapt
# switch to development branch
$ git checkout ng
# compile the script
$ ./bin/compile.sh > pacapt.dev
# check if syntax is good
$ bash -n pacapt.dev
$ sudo install -m755 ./pacapt.dev /usr/local/bin/pacapt
Please read the sample Makefile for some details.
This work is released under the terms of Fair license (http://opensource.org/licenses/fair).
Many people have contributed to the project by sending pull requests and/or reporting on the ticket system. Here is an incomplete list of authors and contributors.
- 10sr (10sr)
- Alexander Dupuy (dupuy)
- Anh K. Huynh (icy)
- Antony Lee (anntzer)
- Alex Lyon (Arcterus)
- Carl X. Su (bcbcarl)
- Cuong Manh Le (Gnouc)
- Daniel YC Lin (dlintw)
- Danny George (dangets)
- Darshit Shah (darnir)
- Dmitry Kudriavtsev (dkudriavtsev)
- Eric Crosson (EricCrosson)
- Evan Relf (evanrelf)
- GijsTimmers (GijsTimmers)
- Hà-Dương Nguyễn (cmpitg)
- Huy Ngô (NgoHuy)
- James Pearson (xiongchiamiov)
- Janne Heß (dasJ)
- Jiawei Zhou (4679)
- Karol Blazewicz
- Kevin Brubeck (unhammer)
- Konrad Borowski (xfix)
- Kylie McClain (somasis)
- Valerio Pizzi (Pival81)
- Siôn Le Roux (sinisterstuf)
- Thiago Perrotta (thiagowfx)
- Vojtech Letal (letalvoj)