如何更新 openSUSE Linux 系统
openSUSE
![](/data/attachment/album/202103/13/110932nsq33tjit9933h2k.jpg)


就我记忆所及，我一直是 Ubuntu 的用户。我曾经转向过其他发行版，但最终还是一次次回到 Ubuntu。但最近，我开始使用 openSUSE 来尝试一些非 Debian 的东西。


随着我对 [openSUSE](https://www.opensuse.org/) 的不断探索，我不断发现 SUSE 中略有不同的东西，并打算在教程中介绍它们。


第一篇我写的是更新 openSUSE 系统。有两种方法可以做到：


* 使用终端（适用于 openSUSE 桌面和服务器）
* 使用图形工具（适用于 openSUSE 桌面）


### 通过命令行更新 openSUSE


更新 openSUSE 的最简单方法是使用 `zypper` 命令。它提供了补丁和更新管理的全部功能。它可以解决文件冲突和依赖性问题。更新也包括 Linux 内核。


如果你正在使用 openSUSE Leap，请使用这个命令：



```
sudo zypper update

```

你也可以用 `up` 代替 `update`，但我觉得 `update` 更容易记住。


如果你正在使用 openSUSE Tumbleweed，请使用 `dist-upgrade` 或者 `dup`（简称）。Tumbleweed 是[滚动发行版](https://itsfoss.com/rolling-release/)，因此建议使用 `dist-upgrade` 选项。



```
sudo zypper dist-upgrade

```

它将显示要升级、删除或安装的软件包列表。


![](/data/attachment/album/202103/13/110946o6thg99wpnhcw323.png)


如果你的系统需要重启，你会得到通知。


如果你只是想刷新仓库（像 `sudo apt update` 一样），你可以使用这个命令：



```
sudo zypper refresh

```

如果你想列出可用的更新，也可以这样做：



```
sudo zypper list-updates

```

### 以图形方式更新 openSUSE


如果你使用 openSUSE 作为桌面，你可以选择使用 GUI 工具来安装更新。这个工具可能会根据 [你使用的桌面环境](https://itsfoss.com/find-desktop-environment/) 而改变。


例如，KDE 有自己的软件中心，叫做 “Discover”。你可以用它来搜索和安装新的应用。你也可以用它来安装系统更新。


![](/data/attachment/album/202103/13/110947yv44bj3amll42lba.png)


事实上，KDE 会在通知区通知你可用的系统更新。你必须打开 Discover，因为点击通知不会自动进入 Discover。


![](/data/attachment/album/202103/13/110948fj09z424bh46m6qr.png)


如果你觉得这很烦人，你可以使用这些命令禁用它：



```
sudo zypper remove plasma5-pk-updates
sudo zypper addlock plasma5-pk-updates

```

不过我不推荐。最好是获取可用的更新通知。


还有一个 YAST 软件管理 [GUI 工具](https://itsfoss.com/gui-cli-tui/)，你可以用它来对软件包管理进行更精细的控制。


![](/data/attachment/album/202103/13/110948sz66hzbb1ob446l4.png)


就是这些了。这是一篇简短的文章。在下一篇 SUSE 教程中，我将通过实例向大家展示一些常用的 `zypper` 命令。敬请期待。




---


via: <https://itsfoss.com/update-opensuse/>


作者：[Abhishek Prakash](https://itsfoss.com/author/abhishek/) 选题：[lujun9972](https://github.com/lujun9972) 译者：[geekpi](https://github.com/geekpi) 校对：[wxy](https://github.com/wxy)


本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译，[Linux中国](https://linux.cn/) 荣誉推出


OK
I have been an Ubuntu user for as long as I remember. I distrohopped a little but keep on coming back to Ubuntu. But recently, I have started using openSUSE to try something non-Debian.

As I keep exploring [openSUSE](https://www.opensuse.org/), I keep on stumbling upon things that are slightly different in SUSE-worse and I plan to cover them in tutorials on It’s FOSS.

As a first, I am writing about updating openSUSE system. There are two ways you can do that:

- Using terminal (valid for openSUSE desktops and servers)
- Using a graphical tool (valid for openSUSE desktops)

## Update openSUSE via command line

The simplest way to update openSUSE is by using the zypper command. It provides full functionality of patches and updates management. It takes care of the file conflicts and dependency problems. These system updates also include Linux kernel.

There is a slight [difference between openSUSE Leap and Tumbleweed](https://itsfoss.com/opensuse-leap-vs-tumbleweed/) update command.

If you are using openSUSE Leap, use this command:

`sudo zypper update`


You may also use `up`

instead of `update`

but I find it easier to remember.

If you are using openSUSE Tumbleweed, use the `dist-upgrade`

or `dup`

(in short). Tumbleweed is [rolling release distribution](https://itsfoss.com/rolling-release/) and hence it is advised to use dist-upgrade option.

`sudo zypper dist-upgrade`


It will show you the list of the packages to be upgraded, removed or installed.

![Update openSUSE with Zypper Command](https://itsfoss.com/content/images/wordpress/2021/03/update-opensuse-with-zypper-800x406.png)

You’ll be notified if your system requires reboots.

If you just want to refresh the repositories (like sudo apt update), you may use this command:

`sudo zypper refresh`


If you want to list the available updates, you can also do that:

`sudo zypper list-updates`


## Graphical way to update openSUSE

If you are using openSUSE as a desktop, you’ll have the additional option of using the GUI tools for installing the updates. This tool may change depending on [which desktop environment you are using](https://itsfoss.com/find-desktop-environment/).

For example, KDE has its own Software center called Discover. You can use it to search and install new applications. You can also use it to install system updates.

![opensuse update gui](https://itsfoss.com/content/images/wordpress/2021/03/opensuse-update-gui-800x500.png)

In fact, KDE notifies you of available system updates in the notification area. You’ll have to open Discover explicitly because clicking on the notification doesn’t automatically take you to Discover.

![update notification opensuse](https://itsfoss.com/content/images/wordpress/2021/03/update-notification-opensuse-800x259.png)

If you find that annoying, you may disable it using these commands:

```
sudo zypper remove plasma5-pk-updates
sudo zypper addlock plasma5-pk-updates
```


I wouldn’t recommend it though. It’s better to get notified of available updates.

There is also the YAST Software Management [GUI tool](https://itsfoss.com/gui-cli-tui/) which you can use for more granular control on package managements.

![yast software management suse](https://itsfoss.com/content/images/wordpress/2021/03/yast-software-management-suse-800x448.png)

That’s it. It was a short one. In the next SUSE tutorial, I’ll show you some common zypper commands with examples. Stay tuned.