Skip to content

OS patching (VMs): SUSE

SUSE commands from the OS patching (VMs) folder.

Index
13 items

SUSE: List pending updates

Safe

What would be upgraded, without installing anything.

sudo zypper refresh && zypper list-updates
What each part does
  1. zypper refreshrefresh repository metadata
  2. zypper list-updatespackages with a newer version
  • #suse
  • #packages

Also known as: check-update · pending updates · zypper lu

SUSE: List pending security updates

Safe

SUSE-SU security patches that apply to this VM.

zypper list-patches --category security
What each part does
  1. zypper list-patchespatches not installed yet
  2. --category securitysecurity only
  • #suse
  • #security-updates

Also known as: SUSE-SU · security patches

SUSE: Apply all updates

Caution

Installs every pending update including a new kernel.

Dry run first
sudo zypper refresh && sudo zypper update --dry-run
sudo zypper refresh && sudo zypper update -y
What each part does
  1. zypper updateupgrade all packages
  2. -yanswer yes
  • #suse
  • #packages
  • #kernel

Also known as: update everything · patch vm · zypper up

SUSE: Apply security updates only

Caution

Installs only security patches.

Dry run first
sudo zypper refresh && sudo zypper patch --category security --dry-run
sudo zypper refresh && sudo zypper patch --category security -y
What each part does
  1. zypper patchapply patches
  2. --category securitysecurity only
  • #suse
  • #security-updates

Also known as: security only · zypper patch

SUSE: Fix one CVE

Caution

Install only the patch that fixes one CVE.

Dry run first
sudo zypper patch --cve=<CVE-ID> --dry-run
sudo zypper patch --cve=<CVE-ID>
What each part does
  1. --cve=<CVE-ID>patches that list this CVE
  • #suse
  • #cve

Also known as: fix cve · patch cve

SUSE: Update the kernel

Caution

Installs the newest kernel. Used after a reboot.

Dry run first
sudo zypper refresh && sudo zypper update --dry-run kernel-default
sudo zypper refresh && sudo zypper update -y kernel-default
What each part does
  1. zypper update kernel-defaultnewest default kernel
  • #suse
  • #kernel

Also known as: kernel update · kernel-default

SUSE: Upgrade one package

Caution

Upgrade a single package.

Dry run first
sudo zypper refresh && sudo zypper update --dry-run <package>
sudo zypper refresh && sudo zypper update -y <package>
What each part does
  1. zypper update <package>e.g. python3-base
  • #suse
  • #packages

Also known as: single package · update one package

SUSE: Install an exact package version

Caution

Install a specific version (needed with --oldpackage when it is older than the installed one).

Dry run first
sudo zypper install --dry-run --oldpackage <package>-<version>
sudo zypper install --oldpackage <package>-<version>
What each part does
  1. --oldpackageallow installing an older version
  2. <package>-<version>list versions with zypper search -s <package>
  • #suse
  • #packages

Also known as: specific version · fixed in version · downgrade

SUSE: Lock a package version

Safe

Keep zypper from changing a package.

sudo zypper addlock <package>
What each part does
  1. zypper addlocklock the package

My note List: zypper locks. Remove: sudo zypper removelock <package>

  • #suse
  • #packages

Also known as: freeze package · zypper lock

SUSE: Check if a reboot is needed

Safe

Exit code 102 when a reboot is needed (new kernel, glibc ...).

sudo zypper needs-rebooting
What each part does
  1. zypper needs-rebootingis a reboot needed?

My note Then: sudo reboot

  • #suse
  • #reboot

Also known as: reboot required · needs-rebooting

SUSE: Confirm the new kernel after reboot

Safe

The running kernel should be the newest installed one.

uname -r && rpm -q kernel-default
What each part does
  1. uname -rrunning kernel
  2. rpm -q kernel-defaultinstalled kernels
  • #suse
  • #kernel

Also known as: verify kernel · installed kernels

SUSE: Remove old kernels

Caution

Removes old kernels, keeping what /etc/zypp/zypp.conf multiversion.kernels allows.

Dry run first
sudo zypper purge-kernels --dry-run
sudo zypper purge-kernels
What each part does
  1. zypper purge-kernelsremove kernels not kept by the multiversion setting
  • #suse
  • #kernel

Also known as: old kernels · /boot full

SUSE: Check a package changelog for a CVE fix

Safe

A match means the installed package contains the fix.

rpm -q --changelog <package> | grep -i <CVE-ID>
What each part does
  1. rpm -q --changelog <package>changelog of the installed package
  2. grep -i <CVE-ID>any match = fixed
  • #suse
  • #cve

Also known as: verify cve fixed · backport

My DevOps Playbook by Angelo John Calleja

New runbook

GitHub not connected

Saving is handled by the site: the GitHub token is stored in Cloudflare, not in your browser. Enter the editor password (the EDITOR_PASSWORD secret) to unlock saving in this browser.

Saving commits to gelogrammer/My_DevOps_Playbook. Create a fine-grained token with access to only this repo andContents: Read and write, then paste it here. It is stored only in this browser.

src/content/docs/…