How to update OpenSUSE Linux software and kernel using CLI

I am a new OpenSUSE Linux server user. How do I upgrade and update OpenSUSE Linux software and kernel from the CLI? How do I use the command line tool to upgrade your system to the latest version of openSUSE software and kernel?

Introduction : You can use zypper or yast2 command for managing and updating installed software including Linux kernel on OpenSUSE Linux. This page demonstrates how to run a zypper command to upgrade OpenSUSE Linux system.

How do I update OpenSUSE Linux software and kernel from command line?

  1. Open the terminal application.
  2. Log in to the server using ssh command as follows
    ssh user@server-ip
  3. Refersh OpenSUSE repository from the Internet, execute:
    sudo zypper refersh
  4. Upgrade OpenSUSE Linux, type:
    sudo zypper update

Let us see all commands in details.

What is a zypper command in OpenSUSE?

zypper is nothing but a command line package manager. It is equivalent to apt command/apt-get command on Debian/Ubuntu or yum command on a CentOS/RHEL. One can use the zypper command for:

  • Install new packages
  • Delete or remove software
  • Update Linux kernel on OpenSUSE
  • Update all installed packages with newer available version and more

How to update OpenSUSE system to the latest packages

First, Verify that repos are enabled, run:
$ zypper repos --uri

Repository priorities are without effect. All enabled repositories share the same priority.
 
# | Alias                             | Name                              | Enabled | GPG Check | Refresh | URI                                                          
--+-----------------------------------+-----------------------------------+---------+-----------+---------+--------------------------------------------------------------
1 | openSUSE-Leap-15.0-1              | openSUSE-Leap-15.0-1              | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/distribution/leap/15.0/repo/oss/
2 | openSUSE-Leap-15.0-Update         | openSUSE-Leap-15.0-Update         | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.0/oss/           
3 | openSUSE-Leap-15.0-Update-Non-Oss | openSUSE-Leap-15.0-Update-Non-Oss | Yes     | (r ) Yes  | Yes     | http://download.opensuse.org/update/leap/15.0/non-oss/

How to refresh OpenSUSE Linux repositories

sudo zypper refresh
OR
sudo zypper ref

How to list all applicable patches for OpenSUSE

sudo zypper list-patches
OR
sudo zypper lp

OpenSUSE Linux show or list all applicable patches (click to enlarge)

Howo to list all available updates on OpenSUSE Linux

sudo zypper list-updates
OR
sudo zypper lu

OpenSUSE Linux show or list all available updates (click to enlarge)

How to upgrade OpenSUSE system to the latest packages and kernel

Execute the following command:
sudo zypper update
OR
sudo zypper up

At the end you will see message as follows:

There are some running programs that might use files deleted by recent upgrade. You may wish to check and restart some of them. Run ‘zypper ps -s’ to list these programs.

You can view outdated process by running the following command:
$ zypper ps -s
Restart outdated process one by one using the systemctl command:
$ sudo systemctl restart sshd
Or simply reboot the Linux system by running:
$ sudo reboot
OR
$ sudo shutdown -r now

Restart outdated OpenSUSE Linux process

A note about YaST/YaST2 online update command line tool

YaST is universal configuration utility and comes with both GUI and TUI. Just run the following command to apply severe security updates:
$ sudo yast2 online_update

YaST online update via TUI (Text User Interface) tool in action

Conclusion

This page explained how to install updates on openSUSE Linux to keep your system secure. For more info see this page or type the following man command to read more about zypper tool:
man zypper

🐧 If you liked this page, please support my work on Patreon or with a donation.
🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
FirewallAlpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilitiesdig host ip nmap
OpenVPNCentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Managerapk apt
Processes Managementbg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPNAlpine CentOS 8 Debian 10 Firewall Ubuntu 20.04

Comments on this entry are closed.

  • Emilia Jan 2, 2019 @ 6:22

    Nice. I just updated my VM as root user:
    zypper ref && zypper up
    This is the best site for Linux developers.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.