关于统信免费版YUM软件源问题
关于统信免费版YUM软件源问题
最近想了解一下 UOS v20 ,因此通过官网下载了免费的 UFU 版,然后安装虚拟机进行测试。但执行 dnf/yum 更新时返回 401 错误无法完成。
其中,龙蜥版(uniontechos-server-20-1050a-amd64-UFU.iso)可以看到如下错误信息:
# dnf update
UniontechOS 20 AppStream 173 B/s | 172 B 00:00
Errors during downloading metadata for repository 'UniontechOS-20-AppStream':
- Status code: 401 for https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/AppStream/x86_64/repodata/repomd.xml (IP: 61.54.25.98)
Error: Failed to download metadata for repo 'UniontechOS-20-AppStream': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
UniontechOS 20 BaseOS 186 B/s | 172 B 00:00
Errors during downloading metadata for repository 'UniontechOS-20-BaseOS':
- Status code: 401 for https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/BaseOS/x86_64/repodata/repomd.xml (IP: 61.54.25.98)
Error: Failed to download metadata for repo 'UniontechOS-20-BaseOS': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
UniontechOS 20 UFU 190 B/s | 172 B 00:00
Errors during downloading metadata for repository 'UniontechOS-20-UFU':
- Status code: 401 for https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/UFU/x86_64/repodata/repomd.xml (IP: 61.54.25.98)
Error: Failed to download metadata for repo 'UniontechOS-20-UFU': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
Ignoring repositories: UniontechOS-20-AppStream, UniontechOS-20-BaseOS, UniontechOS-20-UFU
Dependencies resolved.
Nothing to do.
Complete!
而 欧拉版(uniontechos-server-20-1050e-amd64-UFU.iso)的错误信息则是:
# dnf update
UnionTechOS-Server-20-1050-UFU 184 B/s | 172 B 00:00
Errors during downloading metadata for repository 'UnionTechOS-Server-20-UFU':
- Status code: 401 for https://euler-packages.chinauos.com/server-euler/fuyu/1050/UFU/x86_64/repodata/repomd.xml (IP: 61.54.25.98)
Error: Failed to download metadata for repo 'UnionTechOS-Server-20-UFU': Cannot download repomd.xml: Cannot download repodata/repomd.xml: All mirrors were tried
根据上述信息,明显的均为相应的 baseurl 错误导致。但在执行测试前并未对文件做任何修改。因此检查相应的repo 文件,具体信息是:
龙蜥版:
# ls /etc/yum.repos.d/
UniontechOS.repo
# cat /etc/yum.repos.d/UniontechOS.repo
[UniontechOS-$releasever-AppStream]
name = UniontechOS $releasever AppStream
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/AppStream/$basearch
enabled = 1
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-BaseOS]
name = UniontechOS $releasever BaseOS
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/BaseOS/$basearch
enabled = 1
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-UFU]
name = UniontechOS $releasever UFU
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/UFU/$basearch
enabled = 1
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-PowerTools]
name = UniontechOS $releasever PowerTools
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/PowerTools/$basearch
enabled = 0
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-Plus]
name = UniontechOS $releasever Plus
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/Plus/$basearch
enabled = 0
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-Extras]
name = UniontechOS $releasever Extras
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/Extras/$basearch
enabled = 0
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-Update]
name = UniontechOS $releasever Update
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/Update/$basearch
enabled = 0
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-HA]
name = UniontechOS $releasever HighAvailability
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/HighAvailability/$basearch
enabled = 0
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
[UniontechOS-$releasever-OpenStack-U]
name = UniontechOS $releasever OpenStack-Ussuri
baseurl = https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/1050/OpenStack-U/$basearch
enabled = 0
username=$auth_u
password=$auth_p
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-uos-release
gpgcheck = 0
skip_if_unavailable = 1
欧拉版:
# ls /etc/yum.repos.d/
UnionTechOS-everything-x86_64.repo UnionTechOS-modular-x86_64.repo UnionTechOS-UFU-x86_64.repo UnionTechOS-update-x86_64.repo UnionTechOS-x86_64.repo
# cat /etc/yum.repos.d/UnionTechOS-UFU-x86_64.repo
#Copyright (c) [2019] Huawei Technologies Co., Ltd.
#generic-repos is licensed under the Mulan PSL v1.
#You can use this software according to the terms and conditions of the Mulan PSL v1.
#You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v1 for more details.
[UnionTechOS-Server-20-UFU]
name=UnionTechOS-Server-20-$releasever-UFU
baseurl=https://euler-packages.chinauos.com/server-euler/fuyu/$releasever/UFU/$basearch
enabled=1
gpgcheck=1
gpgkey=https://euler-packages.chinauos.com/server-euler/fuyu/$releasever/UFU/$basearch/RPM-GPG-KEY-UnionTech
username=$auth_u
password=$auth_p
# cat /etc/yum.repos.d/UnionTechOS-x86_64.repo
#Copyright (c) [2019] Huawei Technologies Co., Ltd.
#generic-repos is licensed under the Mulan PSL v1.
#You can use this software according to the terms and conditions of the Mulan PSL v1.
#You may obtain a copy of Mulan PSL v1 at:
# http://license.coscl.org.cn/MulanPSL
#THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
#IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
#PURPOSE.
#See the Mulan PSL v1 for more details.
[UnionTechOS-Server-20]
name=UnionTechOS-Server-20-$releasever
baseurl=https://euler-packages.chinauos.com/server-euler/fuyu/$releasever/OS/$basearch
enabled=1
gpgcheck=1
gpgkey=https://euler-packages.chinauos.com/server-euler/fuyu/$releasever/OS/$basearch/RPM-GPG-KEY-UnionTech
username=$auth_u
password=$auth_p
。。。。
直接尝试通过浏览器访问上述地址发现无法同样是 401 Authorization Required 。而且 龙蜥的相关地址均为 https://enterprise-c-packages.chinauos.com/server-enterprise-c/kongzi/*** ;欧拉的则为 https://euler-packages.chinauos.com/server-euler/fuyu/*** 。
简单搜索一下,发现官方论坛其实就是一个已知问题 https://bbs.chinauos.com/en/post/14401 。 在龙蜥版中测试提及的办法,确实需要安装 yum-utils :
# rpm -ivh https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/x86_64/Packages/UnionTech-repos-ufu-1-2.uelc20.x86_64.rpm
Retrieving https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/x86_64/Packages/UnionTech-repos-ufu-1-2.uelc20.x86_64.rpm
warning: /var/tmp/rpm-tmp.0DMq1e: Header V4 RSA/SHA256 Signature, key ID 8df595ed: NOKEY
error: Failed dependencies:
yum-utils is needed by UnionTech-repos-ufu-1-2.uelc20.x86_64
通过上述地址可以找到当前最新的 yum-utils 为 https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/BaseOS/x86_64/Packages/yum-utils-4.0.21-11.uelc20.02.noarch.rpm ,发布时间为 07-Apr-2023 10:07;repo配置文件仍为 https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/x86_64/Packages/UnionTech-repos-ufu-1-2.uelc20.x86_64.rpm ,发布时间为 07-Apr-2023 18:30 。此时,直接安装上述最新版(截至 2023年5月28日)时ISO中相应的依赖软件包版本无法满足需求:
# rpm -ivh https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/x86_64/Packages/UnionTech-repos-ufu-1-2.uelc20.x86_64.rpm https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/BaseOS/x86_64/Packages/yum-utils-4.0.21-11.uelc20.02.noarch.rpm
Retrieving https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/Extras/x86_64/Packages/UnionTech-repos-ufu-1-2.uelc20.x86_64.rpm
Retrieving https://enterprise-c-packages.chinauos.com/server-enterprise-c/ufu/kongzi/1050/BaseOS/x86_64/Packages/yum-utils-4.0.21-11.uelc20.02.noarch.rpm
warning: /var/tmp/rpm-tmp.DYnYHL: Header V4 RSA/SHA256 Signature, key ID 8df595ed: NOKEY
error: Failed dependencies:
dnf >= 4.7.0-6 is needed by yum-utils-4.0.21-11.uelc20.02.noarch
dnf-plugins-core = 4.0.21-11.uelc20.02 is needed by yum-utils-4.0.21-11.uelc20.02.noarch
python3-dnf >= 4.7.0-6 is needed by yum-utils-4.0.21-11.uelc20.02.noarch
而在欧拉版本中,经过尝试发现可以使用 rpm 进行更新 UnionTech-repos-1.0-3.6.UFU.02.x86_64.rpm 为 https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/everything/x86_64/Packages/UnionTech-repos-ufu-1-2.uel20.x86_64.rpm 后可以正常执行 dnf 命令。
# rpm -ivh https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/UFU/x86_64/Packages/UnionTech-repos-1.0-3.6.UFU.02.x86_64.rpm
Retrieving https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/UFU/x86_64/Packages/UnionTech-repos-1.0-3.6.UFU.02.x86_64.rpm
warning: /var/tmp/rpm-tmp.afssOG: Header V4 RSA/SHA256 Signature, key ID 8df595ed: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
package UnionTech-repos-1:1.0-3.6.UFU.02.x86_64 is already installed
# rpm -Uvh https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/everything/x86_64/Packages/UnionTech-repos-ufu-1-2.uel20.x86_64.rpm
Retrieving https://euler-packages.chinauos.com/server-euler/ufu/fuyu/1050/everything/x86_64/Packages/UnionTech-repos-ufu-1-2.uel20.x86_64.rpm
warning: /var/tmp/rpm-tmp.3yJpS8: Header V4 RSA/SHA256 Signature, key ID 8df595ed: NOKEY
Verifying... ################################# [100%]
Preparing... ################################# [100%]
Updating / installing...
1:UnionTech-repos-ufu-1-2.uel20 ################################# [ 50%]
Cleaning up / removing...
2:UnionTech-repos-1:1.0-3.6.UFU.02 ################################# [100%]
# dnf update
UnionTechOS 1050 OS 1.8 MB/s | 5.3 MB 00:02
UnionTechOS 1050 everything 1.7 MB/s | 26 MB 00:15
UnionTechOS 1050 UFU 119 kB/s | 30 kB 00:00
Dependencies resolved.
========================================================================================================================================================================================================================================
Package Architecture Version Repository Size
========================================================================================================================================================================================================================================
Installing:
kernel x86_64 4.19.90-2211.5.0.0178.22.uel20 UnionTechOS-1050-OS 47 M
Upgrading:
NetworkManager x86_64 1:1.26.2-13.uel20 UnionTechOS-1050-OS 2.0 M
NetworkManager-config-server noarch 1:1.26.2-13.uel20 UnionTechOS-1050-OS 8.9 k
NetworkManager-help noarch 1:1.26.2-13.uel20 UnionTechOS-1050-OS 835 k
NetworkManager-libnm x86_64 1:1.26.2-13.uel20 UnionTechOS-1050-OS 1.6 M
PackageKit x86_64 1.1.12-10.up3.uel20 UnionTechOS-1050-OS 566 k
。。。。。。。。。。。。。。。。。。。。
rpm-plugin-systemd-inhibit x86_64 4.15.1-43.uel20 UnionTechOS-1050-OS 14 k
Transaction Summary
========================================================================================================================================================================================================================================
Install 20 Packages
Upgrade 564 Packages
Total download size: 702 M
Is this ok [y/N]:
因此,对于龙蜥版可以直接备份后修改 repo文件。即将现有文件中的 **/server-enterprise-c/kongzi/** 替换为 **/server-enterprise-c/ufu/kongzi/** ,然后即可直接执行 dnf/yum 进行更新或安装额外软件包。而欧拉版则是 **/server-euler/fuyu/** 替换为 **/server-euler/ufu/fuyu/**。