pkg(8) - a wrapper around package managers
When you have MacOS on your work computer, Arch Linux on your home computer,
and Ubuntu on your home server, you might enjoy using
pkg, a thin wrapper
apt respectively, that will offer you a common
interface and save you some keystrokes.
$ wget https://raw.githubusercontent.com/vinc/pkg/master/pkg.sh $ sudo cp pkg.sh /usr/local/bin/pkg $ sudo chmod a+x /usr/local/bin/pkg
With system package managers
Let say you use Arch Linux on your local computer and Debian on a remote server.
You would type
pacman -Ss foo on the former to search a package named
apt search foo or
apt-cache search foo on the latter.
And you would type
sudo pacman -S foo to install it on Arch and
sudo apt install foo or
sudo apt-get install foo on Debian.
pkg you can search a package on both systems with:
$ pkg search foo
And install it with:
$ sudo pkg install foo
Or you could even type
pkg s foo and
sudo pkg i foo to save a few
With language package managers
You may use some language package managers, like
pip, in addition
to the system one. No worries,
pkg go you covered:
$ pkg --with npm install foo
pkg you won’t have to remember to type
npm uninstall foo with
yarn remove foo with
sudo pacman -R foo on Arch Linux but
sudo apt remove foo on Ubuntu. Just type the most obvious command and it
will get corrected or passed on.
Copyright © 2017-2018 Vincent Ollivier. Released under MIT.