Linux Package Notes
This is real quick and ugly (even for this place).
- Debian/Ubuntu Package Creation Notes
- Debian/Ubuntu PM Package Notes (dh-make-perl)
- Debian control directory files
- LSB Init Script Notes
Debian/Ubunutu
| Install/Upgrade a package: | apt-get install <package name> dpkg -i <package name> |
| Remove a package: | apt-get remove --purge <package name> dpkg -r <package name> dpkg -P <package name> |
| List installed packages: | dpkg -l | grep <package name> aptitude search <package name> |
| List contents of package: | dpkg -L <package name> |
| List package that owns a file: | dpkg -S <path to file> |
| Edit package sources: | Edit /etc/apt/sources.list then run apt-get update Also see Ubuntu Repositories Command Line |
| Get a list of installed packages and install them on another system* | Get a list: server1# dpkg --get-selections \* > all_from _server1.txt Install it on the 2nd system server2# cat all_from_server1.txt | dpkg --set-selections server2# dselect install remove |
Ubuntu software repositories are stored in /etc/apt/sources.list. Also see Ubuntu Repositories CommandLine or the InstallingSoftware tutorials. See Aptitude Survival Guide, Automatic updates and and Automatic Security Updates for details on keeping your system up to date.
Gentoo
| Install a package: | emerge -av <package name> |
| Upgrade a package: | emerge -u <package name> |
| Remove a package: | emerge -aC <package name> emerge --unmerge <package name> |
| List installed packages: | equery list |
| List contents of a package: | equery files <package name> |
| List package that owns a file: | equery -b <file name> qpkg -f <file name> |
| Edit package sources: | List: layman -ll Add: layman -a <repository> Remove: layman -d <repository> |
LinuxReviews: emerge user guide
Red Hat/Fedora, CentOS
| Install a package: | rpm -ivh <package name> yum install <package name> |
| Upgrade a package: | rpm -Uvh <package name> yum update <package name> |
| Remove a package: | rpm -ev <package name> yum remove <package name> yum erase <package name> |
| Search for a package: | yum <package name> yum remove <package name> |
| List installed packages: | rpm -qa yum list |
| List contents of a package: | rpm -ql <package name> |
| List package that owns a file: | rpm -qf <file name> yum whatprovides <file name> |
| Edit package sources: | edit /etc/yum/repos.d yum repolist |
Links
- distrowatch.com - Package Management Cheatsheet
- bhami.com/rosetta.html