Using CheatSheets To Apply Best Practices

Cheatsheet: Ubuntu Apt

Cheatsheet: Ubuntu Apt


linkedin
github
slack

PRs Welcome

File me Issues or star this repo.

See more CheatSheets from Denny: #denny-cheatsheets

1.1 Basic

Name Command
Start a ubuntu test container docker run --rm -t -i --privileged --name test --entrypoint=/bin/sh ubuntu:14.04
Start a ubuntu kubernetes pod kubectl run --rm -i -t --image=ubuntu:14.04 test -- sh
Parse log for install/remove operations grep 'install ' /var/log/dpkg.log, grep 'remove ' /var/log/dpkg.log
dpkg/aptitude/apt/apt-get  

1.2 dpkg

Name Command
List all installed packages dpkg -l
Install deb package dpkg -i some.deb
Remove a package including conf files dpkg -P some.deb
Check whether a package file has been installed before dpkg -s some.deb

1.3 Apt

Name Command
Update packages apt update
Upgrade all existing packages apt upgrade
Install/remove package apt install curl, which curl, apt remove curl
Search package apt search curl

1.4 apt-get

Name Command
Install/remove package apt-get install curl, which curl, apt-get remove curl
Download without install apt-get download curl, ls -lth curl*.deb
Update package list apt-get update

1.5 apt-cache

Name Command
Search package apt-cache search curl
Show package records apt-cache show curl
Show package reverse dependencies apt-cache rdepends curl

1.6 More Resources

License: Code is licenapt under MIT License.

https://github.com/trimstray/apt-essentials




Leave a Reply

Your email address will not be published. Required fields are marked *