CO & US Flags

Common Linux commands and utilities for administrators

Examples for each system type Ubuntu(Debian), openSUSE(SUSE), and CentOS(Red Hat)

Host / OS Information

Ubuntu/openSUSE/CentOS

hostnamectl

Static hostname: yourHostname
Icon name: computer-laptop
Chassis: laptop
Machine ID: c2d6e8470dcb4cbea78699ddb3c23e77
Boot ID: dab55a97c436417f8927181dab6f2841
Operating System: Ubuntu Focal Fossa (development branch)
Kernel: Linux 5.4.0-21-generic
Architecture: x86-64

Package Managers

Ubuntu

apt --- Help file

apt help

Install a package

sudo apt install {package_name}

Remove a package (Adding the --purge option will remove the package configuration files as well.)

sudo apt remove {package_name}

openSUSE

zypper --- Help file

zypper help

Install a package

sudo zypper install {package_name}

Remove a package (Adding the --purge option will remove the package configuration files as well.)

sudo zypper remove {package_name}

CentOS

yum

yum help

Install a package

sudo yum install {package_name}

Remove a package (Adding the --purge option will remove the package configuration files as well.)

sudo yum remove {package_name}

System/Package Updates

Ubuntu

Download package information from all configured sources

sudo apt-get update

List available updates

sudo apt list --upgradable

Install available updates of all packages currently installed

sudo apt-get upgrade

sudo apt-get dist-upgrade

openSUSE

Install available upgrades of all packages currently installed

sudo zypper update

sudo zypper dist-upgrade

CentOS

List available updates

sudo yum check-update

Install available upgrades of all packages currently installed

sudo yum update

sudo yum dist-update