Linux 图形界面安装(centos7:Cannot find a valid baseurl for repo: base/7/x86_6 或者 summary 错误)

在尝试在CentOS7上安装Gnome图形界面时,可能会遇到'Cannot find a valid baseurl for repo: base/7/x86_64'或'summary'错误。本文将指导如何解决这些问题,确保GNOME包的正确安装。

执行:

$sudo yum groupinstall "GNOME Desktop" "Graphical Administration Tools"

问题:

Cannot find a valid baseurl for repo: base/7/x86_6

解决:

设置网络:

方法一:   

            1、打开 vi /etc/sysconfig/network-scripts/ifcfg-eth0(每个机子都可能不一样,但格式会是“ifcfg-eth数字”),

                把ONBOOT=no,改为ONBOOT=yes   

            2、重启网络:service network restart

  方法二:

             1、打开 vi /etc/resolv.conf,增加 nameserver 8.8.8.8   

             2、重启网络: service network restart

 

gnome包安装:

<
5a105e8b9d40e1329780d62ea2265d8a_venv docker-compose.yml extracted_images logs NotoSansSC-Regular.ttf report2.sock requirements.txt statics uploads uwsgi.ini (venv) [root@iZ7xverg9iufrkfag7y2yzZ report2]# sudo yum -y install centos-release-scl Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile * base: mirrors.cloud.aliyuncs.com * centos-sclo-rh: mirrors.aliyun.com * extras: mirrors.cloud.aliyuncs.com * updates: mirrors.cloud.aliyuncs.com Resolving Dependencies --> Running transaction check ---> Package centos-release-scl.noarch 0:2-3.el7.centos will be installed --> Finished Dependency Resolution Dependencies Resolved ====================================================================================================================================================================================== Package Arch Version Repository Size ====================================================================================================================================================================================== Installing: centos-release-scl noarch 2-3.el7.centos extras 12 k Transaction Summary ====================================================================================================================================================================================== Install 1 Package Total download size: 12 k Installed size: 20 k Downloading packages: centos-release-scl-2-3.el7.centos.noarch.rpm | 12 kB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Installing : centos-release-scl-2-3.el7.centos.noarch 1/1 Verifying : centos-release-scl-2-3.el7.centos.noarch 1/1 Installed: centos-release-scl.noarch 0:2-3.el7.centos Complete! (venv) [root@iZ7xverg9iufrkfag7y2yzZ report2]# sudo yum -y install devtoolset-11-gcc devtoolset-11-gcc-c++ devtoolset-11-binutils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Could not retrieve mirrorlist http://mirrorlist.centos.org?arch=x86_64&release=7&repo=sclo-sclo error was 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Unknown error" One of the configured repositories failed (Unknown), and yum doesn't have enough cached data to continue. At this point the only safe thing yum can do is fail. There are a few ways to work "fix" this: 1. Contact the upstream for the repository and get them to fix the problem. 2. Reconfigure the baseurl/etc. for the repository, to point to a working upstream. This is most often useful if you are using a newer distribution release than is supported by the repository (and the packages for the previous distribution release still work). 3. Run the command with the repository temporarily disabled yum --disablerepo=<repoid> ... 4. Disable the repository permanently, so yum won't use it by default. Yum will then just ignore the repository until you permanently enable it again or use --enablerepo for temporary usage: yum-config-manager --disable <repoid> or subscription-manager repos --disable=<repoid> 5. Configure the failing repository to be skipped, if it is unavailable. Note that yum will try to contact the repo. when it runs most commands, so will have to try and fail each time (and thus. yum will be be much slower). If it is a very temporary problem though, this is often a nice compromise: yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true Cannot find a valid baseurl for repo: centos-sclo-sclo/x86_64 (venv) [root@iZ7xverg9iufrkfag7y2yzZ report2]# scl enable devtoolset-11 bash Unable to open /etc/scl/conf/devtoolset-11! (venv) [root@iZ7xverg9iufrkfag7y2yzZ report2]# g++ --version g++ (GCC) 4.8.5 20150623 (Red Hat 4.8.5-44) Copyright (C) 2015 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. (venv) [root@iZ7xverg9iufrkfag7y2yzZ report2]#
08-11
### CentOS 7 中 YUM 报错 'cannot find a valid baseurl for repo:base/7/x86_64' 的解决方案 当遇到 `cannot find a valid baseurl for repo:base/7/x86_64` 错误时,通常是因为系统的 YUM 配置文件中的基础仓库地址不可访问或者配置错误。以下是具体的解决方法: #### 方法一:更换为阿里云镜像源 可以通过替换默认的 YUM 源为阿里云镜像源来解决问题。具体操作如下: ```bash curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo ``` 执行该命令后,YUM 配置文件会被替换成阿里云的镜像源[^2]。 #### 方法二:手动编辑 YUM 配置文件 如果系统中未安装 `curl` 或其他工具,则可以手动编辑 `/etc/yum.repos.d/CentOS-Base.repo` 文件并将其内容替换为以下内容: ```ini [base] name=CentOS-$releasever - Base - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [updates] name=CentOS-$releasever - Updates - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [extras] name=CentOS-$releasever - Extras - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/ gpgcheck=1 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 [centosplus] name=CentOS-$releasever - Plus - mirrors.aliyun.com baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/ gpgcheck=1 enabled=0 gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-7 ``` 完成上述更改后保存文件[^3]。 #### 方法三:清理并重新生成 YUM 缓存 无论采用哪种方式更新 YUM 源,在完成后都需要清除旧的缓存并生成新的缓存数据: ```bash yum clean all yum makecache ``` 以上步骤能够有效解决因 YUM 基础库 URL 不可用而导致的问题[^1]。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值