修改 PowerTools 仓库配置文件
在 CentOS Stream 9 中,PowerTools 仓库已被重命名为”crb”(CodeReady Builder)。要启用它,请执行以下命令:
# 编辑仓库文件
sudo nano /etc/yum.repos.d/centos-stream-PowerTools.repo
# 文件原来的内容为
# CentOS-Stream-PowerTools.repo
#
# The mirrorlist system uses the connecting IP address of the client and the
# update status of each mirror to pick current mirrors that are geographically
# close to the client. You should use this for CentOS updates unless you are
# manually picking other mirrors.
#
# If the mirrorlist does not work for you, you can try the commented out
# baseurl line instead.
[powertools]
name=CentOS Stream $releasever - PowerTools
mirrorlist=http://mirrorlist.centos.org/?release=$stream&arch=$basearch&repo=PowerTools&infra=$infra
#baseurl=http://mirror.centos.org/$contentdir/$stream/PowerTools/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
# 修改文件内容
[crb]
name=CentOS Stream $releasever - CRB
baseurl=https://mirror.stream.centos.org/9-stream/CRB/$basearch/os/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-centosofficial
#将仓库名从 [powertools] 改为 [crb],并修改 baseurl 路径为 CRB 的地址
# 保存并退出
yum groupinstall "Server with GUI" -y
默认情况下,CentOS Stream 9 可能以命令行模式启动。需要手动设置默认启动模式为图形界面:
# 设置默认启动模式为图形界面
sudo systemctl set-default graphical.target
# 验证默认启动模式是否设置为图形界面
sudo systemctl get-default
# 如果输出为 graphical.target,则设置成功
# 重启系统
sudo reboot