LinuxBSDPackageManagementTips

From ConShell
Jump to navigation Jump to search

Linux, BSD and Solaris Package Management Tips

This page is my cheatsheet for management packages. The commands to accomplish the same function (more or less) are provided for each of rpm (Red Hat), dpkg or apt-* (Debian), pkg_* (FreeBSD) and pkg* (Solaris). This page is a sort of rosetta stone for sysadmins who need to cross over to other Unix/Linux operating systems.

Function Red Hat et al. Debian et al. FreeBSD Solaris/SunOS
List installed rpm -qa dpkg -l pkg_info ?
Install pkg rpm -i _pkgfile_ dpkg -i _pkgfile_ pkg_add _pkgfile_ pkgadd -d _pkgfile_
Remove pkg rpm -e _pkgname_ apt-get remove _pkgname_ pkg_delete _pkgname-version_ pkgrm _pkgname_
Show pkg info rpm -qi _pkgname_ dpkg -I _pkgname_ pkg_info -I _pkgname-version_ pkginfo -l _pkgname_
Show pkg file info rpm -qpi _pkgfile_ dpkg -I _pkgfile_ pkg_info -I _pkgfile_ ?
Show files contained in pkg rpm -ql _pkgname_ dpkg -X _pkgfile_ pkg_info -L _pkgname-version_ ?
Show pkg deps rpm -qR _pkgname_ apt-cache showpkg _pkgname_ pkg_info -rR _pkgname-version_ ?
Show pkg providing file rpm --whatprovides -q _/path/to/file_ "apt-file search _pkgfile_" to search all pkgs (installed or not) "dlocate _pkgfile_" or "dpkg -S _pkgfile_" to search only installed pkgs pkg_info -W _/path/to/file_ ?
Set _something_ to start at boot chkconfig --add _something_; chkconfig _something_ on update-rc.d _something_ default /usr/local/etc/rc.d/_something.sh_; add _something_enable="YES" in /etc/rc.conf ?
Upgrade all installed packages yum update -or- up2date -u apt-get update; apt-get upgrade portupgrade -aRr -or- portmaster -ia ?


See Also