How to patch update Suse Enterprise Linux server command

ADVERTISEMENTS



Use the zypper to patch update Suse Enterprise Linux

How do I patch and update Suse Enterprise Linux server from the command line option over ssh based session?You need to use the zypper command to keep your system secure and upgrade installed packages including security updates. This page shows how to patch update Suse Enterprise Linux server version 12 SP 3.

zypper is a command line for software management. Both SUSE Enterprise Linux and OpenSUSE use the zypper command. We can use zypper for the following purpose:

Install new software Update software Remove or delete unwanted software Manage repositories Perform various queries, and more.

Syntax

The syntax is as follows:

zypper command

zypper [options] command

zypper help command

Let us see common examples of zypper command.

How to refresh all repositories

$ sudo zypper refresh



How to list available updates on SUSE Enterprise Linux server

We need to see all applicable patches, run:

zypper lp

zypper list-updates



How to update installed packages with newer versions

Let us patch update Suse Enterprise Linux server, execute:

$ sudo zypper update



$ zypper ps -s

$ sudo systemctl restart sshd

Reboot the box

Please note that there are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run the following command to list these programs:You can restart those services using the systemctl command:

First note down the current running Linux kernel version:

$ uname -mrs

Sample outputs:

Linux 4.4.114-94.14-default x86_64

You must reboot the box for the SUSE Enterprise Linux kernel update:

$ sudo reboot

OR

$ sudo shutdown -r now

Verify new Linux kernel version after the system reboot:

$ uname -mrs

Sample outputs:

Linux 4.4.126-94.22-default x86_64

Summary

And there you have it, SUSE Enterprise Linux Server version 12 SP3 patched and updated. We got a new kernel running too. Here is a summary of all of the options used so far in this tutorial:

zypper command Description Example(s) refresh, ref Refresh all repositories. zypper ref refresh-services, refs Refresh all services. zypper refs list-updates, lu List available updates. zypper lu list-patches, lp List needed patches. zypper lp update, up Update installed packages with newer versions. zypper up ps List running processes which might still use files and libraries deleted by recent upgrades. zypper ps -s

For more info see zypper command help page here or type the following two commands at the shell:

$ zypper help up

$ man zypper