AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / unix / 问题 / 728464
Accepted
Henke
Henke
Asked: 2022-12-15 09:37:58 +0800 CST2022-12-15 09:37:58 +0800 CST 2022-12-15 09:37:58 +0800 CST

如何就地升级到最新的 openSUSE Leap 版本

  • 772

与全新安装相比,就地升级的一个主要优势
是所有帐户、配置和安装的程序都保持不变。

使用适用于 Linux 的 Windows 子系统 (WSL),我安装了一个新的 openSUSE 42 实例 。1

如何将 openSUSE 42 就地升级到 15.x?

我的主要兴趣是从 openSUSE 42 升级到最新的 openSUSE 版本。
在撰写本文时, Leap 15.4 是最新的活跃 openSUSE 版本。

动机

从命令行安装时,WSL 仍然只提供 42.2 版的 openSUSE。
考虑到openSUSE 42.2 的生命周期于 2018 年 1 月正式结束
——差不多五年前——升级到更新的版本是有意义的。

警告!

在考虑就地升级之前确保有足够的可用磁盘空间,
在这种情况下,至少大约 5 GiB。

参考

  • 如何使用 WSL 在 Windows 上安装 Linux
  • 活跃的 openSUSE Leap 版本
  • openSUSE Leap 停止发行

1以管理员身份 打开Windows CMD.exe(WinKey+ r,键入cmd,按住 Ctrl+ Shift,按Enter)。
然后运行以下命令安装 openSUSE 42.2:

wsl.exe --install --distribution openSUSE-42

opensuse
  • 1 1 个回答
  • 22 Views

1 个回答

  • Voted
  1. Best Answer
    Henke
    2022-12-15T09:37:58+08:002022-12-15T09:37:58+08:00

    如何将 openSUSE 42 就地升级到 15.x?

    在开始实验之前,最好进行预防性备份以防出现问题。要备份现有的.repo配置文件,请执行: 1

    cd /etc/zypp/repos.d/ && sudo zip oss-42.2_orig.zip *.repo
    

    我如何将 openSUSE 从 42.2 升级到 15.4 2

    1.刷新更新现有的openSUSE 42.2

    在升级之前,一个关键的步骤是运行sudo zypper refresh并 sudo zypper update刷新和更新系统的当前版本。

    :~> sudo zypper refresh
    Retrieving repository 'oss' metadata ...........................[done]
    Building repository 'oss' cache ................................[done]
    Retrieving repository 'oss_update' metadata ....................[done]
    Building repository 'oss_update' cache .........................[done]
    All repositories have been refreshed.
    
    :~> sudo zypper update
    Loading repository data...
    Warning: Repository 'oss_update' appears to be outdated.
     Consider using a different mirror or server.
    Reading installed packages...
    
    The following 3 NEW packages are going to be installed:
      kbd kmod pkg-config
    
    The following 88 packages are going to be upgraded:
      binutils command-not-found coreutils cpp48 curl dbus-1 …
    …
      yast2-xml zip zypper
    
    88 packages to upgrade, 3 new.
    Overall download size: 96.8 MiB. Already cached: 0 B. After the operation,
    additional 7.8 MiB will be used.
    Continue? [y/n/...? shows all options] (y): y
    

    如上面的输出转储所示,我选择y开始更新。
    这开始下载和安装 openSUSE 42.2 的最新软件包版本。

    Retrieving package emacs-info-24.3-24.6.1.noarch (1/91),              4.2 MiB
    Retrieving: emacs-info-24.3-24.6.1.noarch.rpm .............[done (1.7 MiB/s)]
    Retrieving package file-magic-5.22-7.6.1.x86_64 (2/91),             334.5 KiB
    Retrieving: file-magic-5.22-7.6.1.x86_64.rpm ..........................[done]
    …
    Retrieving package wicked-service-0.6.40-6.6.1.x86_64 (91/91),       58.6 KiB
    Retrieving: wicked-service-0.6.40-6.6.1.x86_64.rpm ....................[done]
    Checking for file conflicts: ..........................................[done]
    ( 1/91) Installing: emacs-info-24.3-24.6.1.noarch .....................[done]
    ( 2/91) Installing: file-magic-5.22-7.6.1.x86_64 ......................[done]
    …
    (91/91) Installing: wicked-service-0.6.40-6.6.1.x86_64 ................[done]
    Additional rpm output:
    Failed to connect to bus: No such file or directory
    …
    Output of coreutils-8.25-2.3.1.x86_64.rpm %posttrans script:
        Please run mkinitrd as soon as your system is complete.
    

    现在 openSUSE Leap 42.2 已经成功刷新更新,
    是时候开始升级到 openSUSE Leap 15.4 了。

    .repo2.更改配置文件中的版本号

    A. 在/etc/zypp/repos.d/oss.repo中,替换42.2/repo/oss/suse 为15.4/repo/oss:

    sudo sed -i 's|42.2/repo/oss/suse|15.4/repo/oss|g' /etc/zypp/repos.d/oss.repo
    :~> cat /etc/zypp/repos.d/oss.repo
    [oss]
    enabled=1
    autorefresh=0
    baseurl=http://download.opensuse.org/distribution/leap/15.4/repo/oss/
    type=rpm-md
    

    B. 在/etc/zypp/repos.d/oss_update.repo中,替换42.2 为15.4:

    sudo sed -i 's|42.2|15.4|g' /etc/zypp/repos.d/oss_update.repo
    :~> cat /etc/zypp/repos.d/oss_update.repo
    [oss_update]
    enabled=1
    autorefresh=0
    baseurl=http://download.opensuse.org/update/leap/15.4/oss/
    type=rpm-md
    

    3.同步可用的包和版本列表

    :~> sudo zypper refresh
    Retrieving repository 'oss' metadata ...........................[done]
    Building repository 'oss' cache ................................[done]
    Retrieving repository 'oss_update' metadata ....................[done]
    Building repository 'oss_update' cache .........................[done]
    All repositories have been refreshed.
    

    4.执行分发升级

    :~> sudo zypper dist-upgrade
    Warning: You are about to do a distribution upgrade with all enabled
     repositories. Make sure these repositories are compatible before you
     continue. See 'man zypper' for more information about this command.
    Loading repository data...
    Reading installed packages...
    Computing distribution upgrade...
    14 Problems:
    …
    Problem: nothing provides (kmod(sg.ko) if kernel)
    needed by suse-module-tools-15.4.12-150400.1.4.x86_64
     Solution 1: deinstallation of suse-module-tools-12.4-3.2.x86_64
     Solution 2: keep obsolete suse-module-tools-12.4-3.2.x86_64
     Solution 3: break suse-module-tools-15.4.12-150400.1.4.x86_64
      by ignoring some of its dependencies
    Choose from above solutions by number or skip, retry, cancel [1/2/3/s/r/c]: 1
    

    好的?我现在应该怎么办?
    如上面的输出转储所示,我选择 卸载 suse-module-tools-12.4-...

    显示了一个新问题。

    Problem: nothing provides (/usr/sbin/useradd or busybox)
    needed by sysuser-shadow-3.1-150400.1.35.noarch
     Solution 1: deinstallation of rpcbind-0.2.3-3.3.1.x86_64
     Solution 2: keep obsolete rpcbind-0.2.3-3.3.1.x86_64
     Solution 3: break sysuser-shadow-3.1-150400.1.35.noarch
      by ignoring some of its dependencies
    Choose from above solutions by number or skip, retry, cancel [1/2/3/s/r/c]: 1
    

    同样,我选择了卸载... (rpcbind-0.2.3-3.3.1.x86_64)。

    这种情况一直持续下去。有时,卸载显示为解决方案2。我
    继续选择 卸载以下包:
    patterns-openSUSE-base-20150918-27.1.x86_64,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, 。 _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _man-2.6.6-6.3.1.x86_64
    emacs-24.3-24.6.1.x86_64udev-228-25.18.1.x86_64
    util-linux-2.28-12.9.1.x86_64systemd-228-25.18.1.x86_64
    libutempter0-1.1.6-7.55.x86_64openssh-7.2p2-11.6.1.x86_64
    emacs-nox-24.3-24.6.1.x86_64gpm-1.20.7-9.53.x86_64
    systemd-sysvinit-228-25.18.1.x86_64util-linux-systemd-2.28-12.9.1.x86_64
    sysconfig-netconfig-0.84.0-1.2.x86_64
    aaa_base-13.2+git20140911.61c1681-24.3.1.x86_64kmod-17-10.3.1.x86_64
    screen-4.0.4-7.21.x86_64sysconfig-0.84.0-1.2.x86_64
    wicked-0.6.40-6.6.1.x86_64kmod-compat-17-10.3.1.x86_64
    libwicked-0-6-0.6.40-6.6.1.x86_64ruby-common-2.1-6.3.1.noarch
    wicked-service-0.6.40-6.6.1.x86_64yast2-packager-3.1.123-5.6.1.x86_64
    aaa_base-extras-13.2+git20140911.61c1681-24.3.1.x86_64
    yast2-ruby-bindings-3.1.51.2-3.1.x86_64yast2-3.1.217-5.6.1.x86_64
    yast2-country-data-3.1.32-1.2.x86_64ruby-2.1-4.2.x86_64
    yast2-hardware-detection-3.1.7-9.5.x86_64yast2-transfer-3.1.3-1.3.x86_64

    在回答了最后一个包的卸载之后,随之而来的是很多输出。

    Resolving dependencies...
    Computing distribution upgrade...
    The following 96 NEW packages are going to be installed:
      bash-sh blog boost-license1_66_0 branding-openSUSE … vim-data-common
    
    The following NEW product is going to be installed:
      "openSUSE Leap 15.4"
    
    The following 45 packages are going to be REMOVED:
      aaa_base aaa_base-extras emacs emacs-nox gpm kmod … yast2-transfer
    
    The following pattern is going to be REMOVED:  base
    
    The following product is going to be REMOVED:  openSUSE
    
    The following 198 packages are going to be upgraded:
      augeas bash bc bind-utils binutils bzip2 ca-certificates … zypper
    
    The following pattern is going to be upgraded:  minimal_base
    
    The following 26 packages are going to be downgraded:
      acl fillup insserv-compat klogd libacl1 libaio1 libattr1 … unzip zip
    
    The following 4 packages are going to change architecture:
      file-magic                 x86_64 -> noarch
      linux-glibc-devel          noarch -> x86_64
      openssl                    x86_64 -> noarch
      perl-XML-NamespaceSupport  x86_64 -> noarch
    
    The following 217 packages are going to change vendor:
      acl                        openSUSE -> SUSE LLC <https://www.suse.com/>
    …
      zypper                     openSUSE -> SUSE LLC <https://www.suse.com/>
    
    198 packages to upgrade, 26 to downgrade, 96 new, 45 to remove, 217 to
    change vendor, 4 to change arch.
    Overall download size: 189.6 MiB. Already cached: 0 B. After the operation,
    additional 293.0 MiB will be used.
    Continue? [y/n/...? shows all options] (y): y
    

    我选择了y,开始下载安装。

    Retrieving package boost-license1_66_0-1.66.0-12.3.1.noarch (1/320), 20.8 KiB
    Retrieving: boost-license1_66_0-1.66.0-12.3.1.noarch.rpm ..............[done]
    Retrieving package branding-openSUSE-15.4.20220322-lp154.2. (2/320), 11.6 KiB
    …
    Retrieving package device-mapper-1.02.163-150400.15.95.x (320/320), 143.7 KiB
    Retrieving: device-mapper-1.02.163-150400.15.95.x86_64.rpm ............[done]
    
    Checking for file conflicts: ..........................................[done]
    (  1/363) Installing: boost-license1_66_0-1.66.0-12.3.1.noarch ........[done]
    Additional rpm output:
    warning: /var/cache/zypp/packages/oss/noarch/boost-license1_66_0-1.66.0-12.3.
    1.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID 39db7c82: NOKEY
    (  2/363) Installing: …
    …
    (362/363) Removing kmod-17-10.3.1.x86_64 ..............................[done]
    (363/363) Removing suse-module-tools-12.4-3.2.x86_64 ..................[done]
    …
    Output of rpm-4.14.3-150300.46.1.x86_64.rpm %posttrans script:
        migrating rpmdb from /var/lib/rpm to /usr/lib/sysimage/rpm...
    

    我看到了很多警告,其中最常见的是 No such file or directory.
    下载和安装大约需要 7 分钟。

    5.查看openSUSE当前新版本

    :~> sudo zypper repos
    Repository priorities are without effect.
    All enabled repositories share the same priority.
    
    # | Alias                       | Name        | Enabled | GPG Check | Refresh
    --+-----------------------------+-------------+---------+-----------+--------
    1 | oss                         | oss         | Yes     | (r ) Yes  | No
    2 | oss_update                  | oss_update  | Yes     | (r ) Yes  | No
    3 | repo-backports-debug-update | Update re-> | No      | ----      | ----
    4 | repo-backports-update       | Update re-> | Yes     | (r ) Yes  | Yes
    5 | repo-sle-debug-update       | Update re-> | No      | ----      | ----
    6 | repo-sle-update             | Update re-> | Yes     | (r ) Yes  | Yes
    …
    

    检查版本:

    :~> cat /etc/os-release
    NAME="openSUSE Leap"
    VERSION="15.4"
    …
    

    6.重建系统存储库的缓存

    :~> sudo zypper refresh
    Repository 'oss' is up to date.
    Building repository 'oss' cache ................................[done]
    Repository 'oss_update' is up to date.
    Building repository 'oss_update' cache .........................[done]
    
    New repository or package signing key received:
      Repository:       Update repository of openSUSE Backports
      Key Fingerprint:  …
    …
    Do you want to reject the key, trust temporarily, trust always? [r/t/a/?]: t
    Retrieving repository 'Update repository of openSUSE Backports'metadata[done]
    Building repository 'Update repository of openSUSE Backports' cache ...[done]
    
    New repository or package signing key received:
    Repository:      Update repository with updates from SUSE Linux Enterprise 15
    Key Fingerprint: …
    …
    Do you want to reject the key, trust temporarily, trust always? [r/t/a/?]: t
    Retrieving repository 'Update repository with updates from SUSE Linux E[done]
    Building repository 'Update repository with updates from SUSE Linux Ent[done]
    All repositories have been refreshed.
    

    7. 将已安装的软件包升级到最新的可用版本3

    然后我跑了sudo zypper update。

    -bash-4.4$ sudo zypper update
    Loading repository data...
    Reading installed packages...
    
    The following 125 packages are going to be upgraded:
      augeas bind-utils binutils ca-certificates-mozilla curl … zypper
    
    The following 7 NEW packages are going to be installed:
      libisc1606 libjitterentropy3 libutempter0 libzck1 … util-linux
    
    The following 2 packages are going to be REMOVED:
      bind-libs hardlink
    
    125 packages to upgrade, 7 new, 2 to remove.
    Overall download size: 102.2 MiB. Already cached: 0 B. After the operation,
    additional 1.7 MiB will be used.
    Continue? [y/n/v/...? shows all options] (y): y
    

    当然,我选择了y。接下来是更新的下载和安装。

    Retrieving package sysuser-shadow-3.1-150400.1.35.noarch (1/132),  12.9 KiB
    Retrieving: sysuser-shadow-3.1-150400.1.35.noarch.rpm .................[done]
    Retrieving package system-group-hardware-20170617-150400.… (2/132),  12.4 KiB
    Retrieving: …
    …
    Retrieving package util-linux-2.37.2-150400.8.8.1.x86_64 (132/132),   1.3 MiB
    Retrieving: util-linux-2.37.2-150400.8.8.1.x86_64.rpm .................[done]
    
    Checking for file conflicts: ..........................................[done]
    (  1/132) Installing: sysuser-shadow-3.1-150400.1.35.noarch ...........[done]
    /usr/sbin/groupadd -r render
    /usr/sbin/groupadd -r sgx
    (  2/132) Installing: …
    …
    (132/132) Installing: util-linux-2.37.2-150400.8.8.1.x86_64 ...........[done]
    Executing %posttrans scripts ..........................................[done]
    

    http:8.和之间的战斗https:

    根据我的经验,在 文件中替换http:为 可能会导致错误。 当我这样做——然后运行——我经常(但不总是)得到: 4https:/etc/zypp/repos.d/*.repo

    sudo zypper refresh

    :~> sudo zypper refresh
    Download (curl) error for 'https://download.opensuse.org/distribution/…':
    Error code: Curl error 60
    Error message: SSL certificate problem: certificate has expired
    

    显然,这是过期证书的问题。
    一旦成功完成升级(包括刷新和更新系统) ,获得此类风险的风险Curl error可能会小得多。

    概括

    重复初始预防性备份是明智的:

    cd /etc/zypp/repos.d/ && sudo zip oss-15.4_orig.zip *.repo
    

    在这样的升级过程中做出哪些选择远非显而易见。
    但似乎升级在大多数情况下都有效。
    并cat /etc/os-release说现在的版本是 openSUSE Leap 15.4。

    Access is denied. Press Enter or Esc to exit...当我尝试通过 ConEmu 启动 openSUSE-15 时,我仍然时不时地遇到问题。我不知道这个问题是否与ConEmu有关,但我直接从CMD.exe启动openSUSE-15时从未见过它, wsl ~ -d openSUSE-15. 5个

    参考

    • 支持数据库:系统升级
    • Downloads for Leap 15.4 | main page
    • Downloads for Leap 15.4 | updates
    • The zypper man page
    • Enable snaps on openSUSE (and install GNU nano)
    • Prompt changed to "-Bash-4.2" and colors lost

    1 To see the contents of the oss-42.2_orig.zip file, run unzip -l oss-42.2_orig.zip.
    To restore the .repo files :
    cd /etc/zypp/repos.d/ && sudo rm *.repo && sudo unzip oss-42.2_orig.zip

    2 Support Data Base: System upgrade is the single most important reference I used to perform the upgrade.

    3 At this point, the openSUSE distro hang and didn't respond to any input from the keyboard.
    When I restarted, it looked as follows.
    -bash: /etc/profile: No such file or directory
    -bash-4.4$

    After installing Snap as described here, and restarting again, that behavior went away.
    The prompt resumed to looking normal again, like so :
    henke@hp:~>
    I don't know exactly what fixed the system. And I don't know how to replicate the problem.

    4 To replace http: with https: in all .repo files, run :
    sudo sed -i 's/http:/https:/' /etc/zypp/repos.d/*.repo

    5 If you haven't changed the name of the distro, you should start it as wsl ~ -d openSUSE-42, even though the distro contained is openSUSE 15.

    • 1

相关问题

  • 如何在 opensuse 42.3 tumbleweed 上安装 libXScrnSaver

  • 无法在 Opensuse 42.3 上安装 Discord 应用程序?

  • 挂在 Gnome 电源按钮上按下 [关闭]

  • 运行“setxkbmap il”并注销后无法重新登录桌面环境

  • Linux 安装与硬件的关系如何?[复制]

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve