packages

Using pacapt universal package manager (pacman for all)

pacapt is a shell script that wraps native package managers in a pacman@arch syntax. Intended for Arch users having to temporarily deal with another distribution.

It supports pacman by arch, dpkg/apt-get by debian/ubuntu, homebrew by OSX, yum/rpm by redhat/centos/fedora, portage by gentoo, zypper by opensuse, pkgng by freebsd, pkg_tools by openbsd. See pacman_rosetta@arch

## install
$ wget -O /usr/local/bin/pacapt https://github.com/icy/pacapt/raw/ng/pacapt
$ chmod 755 /usr/local/bin/pacapt

'-Q' list packages installed
'-Qq FILE' query which package provides file
'-Ql PACKAGE' list package files
'-S PACKAGE' install package
'-Ss PACKAGE' search package
'-Suy' upgrade system and package db
'-R PACKAGE' remove package
'-Scc' delete all downloaded packages
Advertisements

Using homebrew and cask package managers in OSX

Homebrew is a package management system for OSX. It installs packages in its own cellar directory and symblinkes to /usr/local.

Homebrew terminology: Formula is the package definition, keg is formula installation prefix, cellar is where all kegs are installed, tap is optional formula repositories, bottle is pre-built binary keg that can be unpacked.

## install
$ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
$ brew --version

## using
# update formulas
$ brew update
# install/uninstall/upgrade/info/search packages
$ brew install|uninstall|upgrade|info|search "package"
# list installed
$ brew list

## contributing
# forked https://github.com/Homebrew/homebrew and clone
$ git clone https://github.com/<username>/homebrew.git
# create new formula
$ brew create https://foo.com/bar-1.0.tgz
$ vi $HOMEBREW_REPOSITORY/Library/Formula/foo.rb
$ git checkout -b foo
$ git commit Library/Formula/foo.rb && git push
# open pull request

## using tap, optional repository git formulas
$ brew tap homebrew/science
$ brew install "formula"

from homebrew, formula cookbook, brew tap and interesting taps and branches

Homebrew cask extends homebrew and brings its elegance, simplicity, and speed to OS X applications and large binaries alike. Applications are kept in their Caskroom under /opt and symblinked to $HOME/Applications.

## install
$ brew install caskroom/cask/brew-cask

## using
$ brew cask install google-chrome
$ open ~/Applications/"Google Chrome.app"

## contributing
# forked https://github.com/caskroom/homebrew-cask/fork and clone
$ git clone https://github.com//homebrew-cask.git
# add official repo as remote
$ git remote add upstream https://github.com/caskroom/homebrew-cask.git
# symb link to use brew cask in your private repo
$ $HOME/homebrew-cask/developer/bin/develop_brew_cask
# switch back to official repo to run 'brew update'
$ $HOME/homebrew-cask/developer/bin/production_brew_cask

from homebrew cask and hacking on homebrew-cask

How to cleanup rhel/centos/ubuntu/debian old kernels

# remove all unused linux kernel headers, kimages and modules
$ sudo yum install yum-utils && sudo package-cleanup --oldkernels --count=2

see yum@commandlinefu

# query linux kernels, in ubuntu/debian
$ dpkg -l 'linux-*'

# remove all unused linux kernel headers, images and modules
$ dpkg -l 'linux-*' | sed '/^ii/!d;/'"$(uname -r | sed "s/(.*)-([^0-9]+)/1/")"'/d;s/^[^ ]* [^ ]* ([^ ]*).*/1/;/[0-9]/!d' | xargs sudo apt-get -y purge

# remove vs purge; purge is identical to remove except that packages are removed and purged, any configuration files are deleted too
$ sudo apt-get|aptitude remove vs sudo apt-get|aptitude purge

# removes all previously downloaded .deb files from the package cache directory '/var/cache/apt/archives,{,/partial}'
$ sudo apt-get|aptitude clean

# same as clean but only removes package files that can no longer be downloaded, and are largely useless
$ sudo apt-get|aptitude autoclean

# remove packages that were automatically installed to satisfy dependencies for other packages and are now no longer needed; automatically done in aptitude
$ sudo apt-get remove --autoremove | sudo apt-get autoremove

# after installing anything with apt-get install, localepurge will remove all translation files and translated man pages in languages you cannot read
$ sudo apt-get install localepurge

# remove orphaned packages
$ sudo apt-get install deborphan
$ sudo deborphan | xargs sudo apt-get -y remove --purge

from cleaning up a Ubuntu GNU/Linux system
see also apt@commandlinefu and dpkg@commandlinefu