步骤一:显示当前 SSL 全局加密 SSL 的状况
# update-crypto-policies --show
DEFAULT
(补充:这里的 DEFAULT 表示可以使用 2048 位及以上位数的 SSL)
步骤二:切换当前 SSL 全局加密 SSL
# update-crypto-policies --set FUTURE
(
补充:
1) 这里以将全局加密 SSL 切换到 FUTURE 状态为例
2) 此时只能使用 4096 位及以上位数的 SSL
)
# update-crypto-policies --show
DEFAULT
(补充:这里的 DEFAULT 表示可以使用 2048 位及以上位数的 SSL)
# update-crypto-policies --set FUTURE
(
补充:
1) 这里以将全局加密 SSL 切换到 FUTURE 状态为例
2) 此时只能使用 4096 位及以上位数的 SSL
)
http://mirror.centos.org/centos/7/os/x86_64/
http://mirror.centos.org/centos/7/updates/x86_64/
http://mirror.centos.org/centos/7/extras/x86_64/
http://mirror.centos.org/centos/7/centosplus/x86_64/
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=$infra
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=updates&infra=$infra
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=extras&infra=$infra
http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=centosplus&infra=$infra
http://mirror.centos.org/centos/8/BaseOS/x86_64/os/
http://mirror.centos.org/centos/8/AppStream/x86_64/os/
http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=BaseOS&infra=$infra
http://mirrorlist.centos.org/?release=8&arch=x86_64&repo=AppStream&infra=$infra
作者:朱明宇
名称:批量设置官方软件源(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
(步骤略)
# 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 为例)
# dnf help
# dnf help <option>
或者:
# dnf <option> help
# dnf install <software>
# dnf -y install <software>
或者:
# dnf install <software> -y
# dnf remove <software>
# dnf -y remove <software>
或者:
# dnf remove <software> -y
# dnf update <software>
# dnf -y update <software>
或者:
# dnf update <software> -y
# dnf update
# dnf -y update
或者:
# dnf update -y
# yum update --best --allowerasing
# yum -y update --best --allowerasing
或者:
# yum update --best --allowerasing -y
# dnf update --exclude=<software>
# dnf -y update --exclude=<software>
或者:
# dnf update --exclude=<software> -y
# dnf ./yum.conf update
(补充:这里以使用 ./yum.conf 配置文件升级所有软件包为例)
# dnf -y -c ./yum.conf update
(补充:这里以使用 ./yum.conf 配置文件升级所有软件包为例)
# dnf check-update
# dnf needs-restarting --reboothint
# dnf list <software>
或者:
# dnf list all | grep <software>
# dnf info <software>
# dnf list <software> --showduplicate | sort -r
# yum module provides <software>
# yum module provides ipa-client
Updating Subscription Management repositories.
Last metadata expiration check: 1:38:12 ago on Fri 26 Jul 2024 08:00:39 AM CST.
ipa-client-4.7.1-11.module+el8+2842+7481110c.x86_64
Module : idm:DL1:820190227212412:5986f621:x86_64
Profiles : client common
Repo : rhel-8-for-x86_64-appstream-rpms
Summary : The Red Hat Enterprise Linux Identity Management system module
......
(补充:从这里的输出结果可以看出 ipa-client 软件包来自 idm 模块,版本是 DL1)
# dnf list all
# dnf groupinstall <group>
# dnf -y groupinstall <group>
或者:
# dnf groupinstall <group> -y
# dnf groupremove <group>
# dnf -y groupremove <group>
或者:
# dnf groupremove <group> -y
# dnf group list
# dnf update --advisory=<errata>
# dnf -y update --advisory=<errata>
或者:
# dnf update --advisory=<errata> -y
# dnf updateinfo <errata>
# dnf update-minimal --security
# dnf -y update-minimal --security
或者:
# dnf update-minimal --security -y
# dnf updateinfo list
# dnf updateinfo info security
# dnf update --cve <CVE>
# dnf -y update --cve <CVE>
或者:
# dnf update --cve <CVE> -y
# dnf updateinfo list cves
# dnf updateinfo info security
# dnf update <security patch>
# dnf -y update <security patch>
或者:
# dnf update <security patch> -y
# dnf update --security
# dnf -y update --security
或者:
# dnf update --security -y
# dnf check-update --security
# dnf repolist
# dnf repolist
# dnf clean all
# dnf makecache
# yum module provides <software>
# dnf module list
# dnf module list | grep <software>
# dnf module info <module>
# dnf module info <module> | grep <submodule>
# dnf module info <module>:<stream>
# dnf module reset <module>
# dnf module enable <module>:<version>
# dnf distro-sync
(注意:需要确保这条命令执行有以后没有报错)
# yum module provides podman
(补充:这里以显示 podman 软件包属于哪个软件模块为例)
# dnf module list | grep podman
container-tools rhel8 [d] common [d] Most recent (rolling) versions of podman, buildah, skopeo, runc, conmon, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and updated as frequently as every 12 weeks.
container-tools 1.0 common [d] Stable versions of podman 1.0, buildah 1.5, skopeo 0.1, runc, conmon, CRIU, Udica, etc as well as dependencies such as container-selinux built and tested together, and supported for 24 months.
container-tools 2.0 common [d] Stable versions of podman 1.6, buildah 1.11, skopeo 0.1, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page.
container-tools 3.0 common [d] Stable versions of podman 3.0, buildah 1.19, skopeo 1.2, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page.
container-tools 4.0 common [d] Stable versions of podman 4.0, buildah 1.24, skopeo 1.6, runc, conmon, etc as well as dependencies such as container-selinux built and tested together, and supported as documented on the Application Stream lifecycle page.
(补充:这里以显示所有和 podman 软件相关的软件模块为例)
# dnf module reset container-tools
(补充:这里以重置 container-tools 软件模块为例)
# dnf module enable container-tools:3.0
(补充:这里以设置 container-tools 软件模块版本号为 3.0 为例)
或者:
# dnf module enable container-tools:rhel8
(
补充:
1) 这里以设置最新的 container-tools 软件模块版本号为例
2) 当站主在测试这条命令时,最新的 container-tools 软件模块版本号刚好是 3.0
)
(注意:有些时候只能设置成最新的软件模块版本号后才能升级到最新的软件)
# dnf list all | egrep ^podman\.x
podman.x86_64 3.0.1-9.module+el8.6.0+14874+64436299 rhel-8-for-x86_64-appstream-rpms
(补充:可以看到此时 podman 软件的可用版本是 3.0.1-9)
# dnf module reset container-tools
(补充:这里以重置 container-tools 软件模块为例)
# dnf list all | egrep ^podman\.x
podman.x86_64 2:4.0.2-6.module+el8.6.0+14877+f643d2d6 rhel-8-for-x86_64-appstream-rpms
(补充:可以看到此时 podman 软件的可用版本是 2:4.0.2-6)
# dnf history
# dnf history info
# dnf history
# dnf history undo <ID>
(补充:上面第 1 条命令会实现操作的 ID 号,在第 2 条命令中写入那个 ID 号就可以取消那次操作)