Show Menu
Cheatography

LPIC 1 Packages Cheat Sheet by

Linux Package Management

Debian

dpkg -i PACKAG­E_NAME
Install PACKAG­E_NAME
dpkg -r PACKAG­E_NAME
Remove PACKAG­E_NAME
dpkg -P PACKAG­E_NAME
Remove PACKAG­E_NAME and config
dpkg -l PATTERN
List packages containing PATTERN
dpkg -s PACKAG­E_NAME
View PACKAG­E_NAME inform­ation
dpkg -i PACKAG­E_FILE
View PACKAG­E_FILE inform­ation
dpkg -c PACKAG­E_FILE
List PACKAG­E_FILE files
dpkg -L PACKAG­E_NAME
List PACKAG­E_NAME files
dpkg -S *FILE_NAME
Find package owning FILE_NAME
apt-get install PACKAG­E_NAME
Install PACKAG­E_NAME
apt-get update PACKAG­E_NAME
Update package list or PACKAG­E_NAME
apt-get upgrade
Update all packages
apt-get remove PACKAG­E_NAME
Remove PACKAG­­E_NAME
apt autoremove
Autoremove unnecc­esary packages
apt list
List installed and available packages
apt search PATTERN
Search for PATTERN
apt-get clean
Deletes downloaded .deb archive folder
Downloaded .deb archives in /var/c­ach­e/a­pt/­arc­hives
apt-find list
List files in packages
apt-find search
Search files in packages
apt-get purge PACKAG­E_NAME
Remove PACKAG­E_NAME and config
apt show PACKAG­E_NAME
Shows more info about package
apt-cache depends PACKAG­E_NAME
Shows depend­encies of a PACKAG­E_NAME
apt-cache rdepends PACKAG­E_NAME
Shows reverse depend­encies of a PACKAG­E_NAME
apt-cache PACKAG­E_NAME
Check PACKAG­E_NAME versions
apt-mark hold PACKAG­E_NAME
Prevent PACKAG­E_NAME from updating
Other commands are: unhold, showhold
Reposi­tories are set in /etc/a­pt/­sou­rce­s.list

Zypper

zypper install PACKAG­E_NAME
Install PACKAG­­E_NAME
zypper list-u­pdates
Update package list
zypper update PACKAG­E_NAME
Update package list or PACKAG­E_NAME
zypper remove PACKAG­E_NAME
Remove PACKAG­­E_NAME
zypper info PACKAG­E_NAME
View PACKAG­­E_NAME inform­­ation
zypper se -i
Search installed packages
zypper se PACKAG­E_NAME
Search for PACKAG­E_NAME
zypper se --provides
Shows depend­encies
zypper refresh
Refresh reposi­tories
zypper repos
List reposi­tories
zypper {add,m­odi­fy,­rem­ove­}repo
{Add,m­odi­fy,­remove} Repository
 

RedHat, Fedora, CentOS, SUSE

rpm -i PACKAG­­E_NAME
Install PACKAG­­E_NAME
rpm -u PACKAG­­E_NAME
Update PACKAG­­E_NAME
rpm -e PACKAG­­E_NAME
Remove PACKAG­­E_NAME
rpm -qa
List installed packages
rpm -qi PACKAG­­E_NAME
View PACKAG­­E_NAME inform­­ation
rpm -qR PACKAG­­E_NAME
View PACKAG­­E_NAME depend­­encies
rpm -q --what­­re­q­uires PACKAG­­E_NAME
View PACKAG­­E_NAME requir­­ements
rpm -qf FILE_NAME
Find package owning a FILE_NAME
rpm -ql PACKAG­­E_NAME
List PACKAG­­E_NAME files
Any of above query commands could run on .rpm file with switch -p
rpm2cpio
Converts rpm to cpio
yum install PACKAG­­E_NAME
Install PACKAG­­E_NAME
yum check-­update PACKAG­E_NAME
Update PACKAG­E_NAME
yum update PACKAG­E_NAME
Update package list or PACKAG­E_NAME
yum upgrade
Update all packages
yum remove PACKAG­E_NAME
Remove PACKAG­­E_NAME
yum autoremove
Autore­­move unnecc­­esary packages
yum list {all,a­vai­lab­le,­ins­talled}
Lists {all,n­ot-­ins­tal­led­,in­sta­lled} packages
yum info PACKAG­E_NAME
Shows more info about
yum whatpr­ovides PATTERN
See PATTERN depend­encies
yum search PATTERN
Search for PATTERN
yum repolist all
List all reposi­tories
yum-co­­nf­i­g­-m­­anager --add-repo URL
Add URL as repository
Yum repos are in /etc/y­um.r­ep­o.d­/*.repo
yum clean packages
Clean cached packages
by default is in /var/c­ach­e/yum
Yum config file in /etc/y­um.conf
dnf install PACKAG­E_NAME
Install PACKAG­­E_NAME
dnf upgrade PACKAG­E_NAME
Update PACKAG­E_NAME
dnf remove PACKAG­E_NAME
Remove PACKAG­­E_NAME
dnf list --inst­alled
List installed packages
dnf repoquery
List available packages
dnf info PACKAG­E_NAME
Shows more info about package
dnf search PATTERN
Search for PATTERN
dnf provides FILE_NAME
Find package owning a FILE_NAME
dnf repolist
List reposi­tories
dnf-co­nfi­g-m­anager --add_repo URL
Add URL as repository
 

Comments

No comments yet. Add yours below!

Add a Comment

Your Comment

Please enter your name.

    Please enter your email address

      Please enter your Comment.

          Related Cheat Sheets

          Linux Command Line Cheat Sheet
          mod_rewrite Cheat Sheet
          Vim NERDTree Cheat Sheet