[步骤] 系统升级 (从 openSUSE Leap 15.2 升级到 openSUSE Leap 15.3)

步骤一:显示现在的系统版本

# cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.2"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.2"
PRETTY_NAME="openSUSE Leap 15.2"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.2"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

(注意:确保显示的系统版本是 openSUSE Leap 15.2)

步骤二:准备升级

2.1 确认已使用的软件库

# zypper ls -d
#  | Alias                     | Name                               | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.2/repo/non-oss/
2  | repo-oss                  | Main Repository                    | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.2/repo/oss/
3  | repo-update               | Main Update Repository             | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.2/oss/
4  | repo-update-non-oss       | Update Repository (Non-Oss)        | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.2/non-oss/

(补充:确保以上软件库已处于 Enabled 状态)

2.2 刷新已使用的软件库

# zypper ref

(注意:确保刷新成功,否则请检查网络)

2.3 将所有 openSUSE Leap 15.2 软件包更新到最新版本

# zypper -n update

2.4 用 releasever 变量替换所有版本号

# sed -i 's/15.2/${releasever}/g' /etc/zypp/repos.d/*.repo

步骤三:升级系统

3.1 将版本号设置为 15.3 并刷新

# zypper --releasever=15.3 refresh

3.2 提前下载并安装 openSUSE Leap 15.3 所需的软件包

# zypper --releasever=15.3 dup --download-in-advance

3.3 升级系统

# zypper --releasever=15.3 dup

3.4 重启系统

# reboot

步骤四:后续检查

4.1 显示升级后的系统版本

# cat /etc/*release*
NAME="openSUSE Leap"
VERSION="15.3"
ID="opensuse-leap"
ID_LIKE="suse opensuse"
VERSION_ID="15.3"
PRETTY_NAME="openSUSE Leap 15.3"
ANSI_COLOR="0;32"
CPE_NAME="cpe:/o:opensuse:leap:15.3"
BUG_REPORT_URL="https://bugs.opensuse.org"
HOME_URL="https://www.opensuse.org/"

4.2 显示升级后已使用的软件库

# zypper ls -d
#  | Alias                     | Name                                                         | Enabled | GPG Check | Refresh | Priority | Type   | URI
---+---------------------------+------------------------------------+---------+-----------+---------+----------+--------+---------------------------------------------------------------------------------------------
1  | repo-non-oss              | Non-OSS Repository                                           | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/non-oss/
2  | repo-oss                  | Main Repository                                              | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.3/repo/oss/
3 | repo-update                | Main Update Repository                                       | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/oss/
4 | repo-update-non-oss        | Update Repository (Non-Oss)                                  | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/non-oss/
4  | repo-backports-update     | Update repository of openSUSE Backports                      | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/backports/
5  | repo-sle-update           | Update repository with updates from SUSE Linux Enterprise 15 | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.3/sle/

(注意:升级到 openSUSE Leap 15.3 系统后,自动新增加了 repo-backports-update 软件库和 repo-sle-update 软件库)

[步骤] Linux 全局加密 SSL 的设置 (CentOS Linux 8 & RHEL 8 版)

步骤一:显示当前 SSL 全局加密 SSL 的状况

# update-crypto-policies --show
DEFAULT

(补充:这里的 DEFAULT 表示可以使用 2048 位及以上位数的 SSL)

步骤二:切换当前 SSL 全局加密 SSL

# update-crypto-policies --set FUTURE


补充:
1) 这里以将全局加密 SSL 切换到 FUTURE 状态为例
2) 此时只能使用 4096 位及以上位数的 SSL

[内容] Linux 官方软件源链接列表 (CentOS Linux 版)

内容一:CentOS 7 基础软件源列表

1.1 CentOS 7 基础软件源官方推荐链接列表

1.1.1 CentOS-7 – Base

http://mirror.centos.org/centos/7/os/x86_64/

1.1.2 CentOS-7 – Updates

http://mirror.centos.org/centos/7/updates/x86_64/

1.1.3 CentOS-7 – Extras

http://mirror.centos.org/centos/7/extras/x86_64/

1.1.4 CentOS-7 – Plus

http://mirror.centos.org/centos/7/centosplus/x86_64/

1.2 CentOS 7 基础软件源官方推荐链接列表

1.2.1 CentOS-7 – Base

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=$infra

1.2.2 CentOS-7 – Updates

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=$infra

1.2.3 CentOS-7 – Extras

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=$infra

1.2.4 CentOS-7 – Plus

http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=centosplus&infra=$infra

内容二:CentOS 8 基础软件源列表

2.1 CentOS 8 基础软件源官方链接列表

2.1.1 CentOS Linux 8 – BaseOS

http://mirror.centos.org/centos/8/BaseOS/x86_64/os/

2.1.2 CentOS-8 – Updates

http://mirror.centos.org/centos/8/AppStream/x86_64/os/

2.2 CentOS 8 基础软件源官方推荐链接列表

2.2.1 CentOS Linux 8 – BaseOS

http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=$infra

2.2.2 CentOS Linux 8 – AppStream

http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=$infra

[工具] Shell 批量设置官方软件源 (openSUSE Leap 15.2 版)

介绍

基本信息

作者:朱明宇
名称:批量设置官方软件源(openSUSE 版)
作用:批量设置官方软件源(openSUSE 版)

使用方法

1. 服务器清单 $add_repo_servers_list.txt 每个服务器名占用 1 行,并和此脚本放在同一目录下
2. 在此脚本的分割线内写入相应的内容
3. 给此脚本添加执行权限
4. 执行此脚本

脚本分割线里的变量

add_repo_servers_list.txt #指定存放要设置官方软件源的文件

注意

1. 此脚本执行前必须要先保证执行此脚本的用户能无密码 ssh 远程这些远程服务器
2. 服务器的系统需要是 openSUSE 15.2 版本
3. 服务器系统要配置好可用的软件源(最好是软件数量最多的官方版本)
4. 这些远程服务器要能够连接外网

脚本

#!/bin/bash

####################### Separator ########################

add_repo_servers_list.txt

####################### Separator ########################

cat add_repo_servers_list.txt
read -p "will add opensuse_leap_15.2 repo please input y " a
echo $a

if [ "$a" != "y" ];then
        echo "you don't agree so exit now"
        exit
fi

for i in `awk '{print $1}' add_repo_servers_list.txt`
do
        ssh $i '
        sudo -u root su - root -c "zypper mr -da"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/distribution/leap/15.2/repo/oss/ OpenSUSE_Leap_152_x64_update-oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/distribution/leap/15.2/repo/non-oss/ OpenSUSE_Leap_152_x64_update-non-oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/update/leap/15.2/oss/ OpenSUSE_Leap_152_x64_oss"
        sudo -u root su - root -c "zypper ar -fcg http://download.opensuse.org/update/leap/15.2/non-oss/ OpenSUSE_Leap_152_x64_non-oss"
        sudo -u root su - root -c "zypper ref"
done

[步骤] 软件源的设置 (openSUSE 版) (本地镜像版)

步骤一:加载本地镜像到系统光驱

(步骤略)

步骤二:挂载本地镜像

# mount /dev/cdrom /mnt

(补充:这里以挂载 /dev/sr1 到 /mnt 目录为例)

步骤三:添加本地镜像里的软件源

# zypper ar file:///mnt/Module-Basesystem openSUSE15-Base

或者:

# zypper ar -f /mnt/Module-Basesystem openSUSE15-Base

(补充:这里以将 /mnt/Module-Basesystem 添加到软件源并命名为 openSUSE15-Base 为例)