首页 > 系统相关 >配置yum源时出现格式问题: file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1 '<!DOCTYPE html>\

配置yum源时出现格式问题: file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1 '<!DOCTYPE html>\

时间:2022-11-22 16:45:27浏览次数:64  
标签:file mirrors repos repo etc yum aliyun

一般或者yum源的配置文件“http://mirrors.aliyun.com/repo/Centos-7.repo” 很多人直接喜欢用wget,这样下载下来会出现跟源文件MD5不一致,原因可能是里面的文件格式发生了变化,建议用浏览器下载了之后再上传到服务器,就好了。.

网上百度的修改yum源的方法:
[root@localhost user]# mv /etc/yum.repos.d /etc/yum.repos.d.bak
[root@localhost user]# mkdir /etc/yum.repos.d
[root@localhost user]# wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
--2022-11-23 00:24:18--  http://mirrors.aliyun.com/repo/Centos-7.repo
正在解析主机 mirrors.aliyun.com (mirrors.aliyun.com)... 119.96.90.240, 119.96.90.241, 119.96.90.237, ...
正在连接 mirrors.aliyun.com (mirrors.aliyun.com)|119.96.90.240|:80... 已连接。
已发出 HTTP 请求,正在等待回应... 302 Moved Temporarily
位置:http://10.168.200.1/ac_portal/proxy.html?template=default&tabs=pwd&vlanid=0&url=http://mirrors.aliyun.com%2frepo%2fCentos-7.repo [跟随至新的 URL]
--2022-11-23 00:24:18--  http://10.168.200.1/ac_portal/proxy.html?template=default&tabs=pwd&vlanid=0&url=http://mirrors.aliyun.com%2frepo%2fCentos-7.repo
正在连接 10.168.200.1:80... 已连接。
已发出 HTTP 请求,正在等待回应... 200 OK
长度:2250 (2.2K) [text/html]
正在保存至: “/etc/yum.repos.d/CentOS-Base.repo”

100%[=================================================================================================================================================>] 2,250       --.-K/s 用时 0s      

2022-11-23 00:24:18 (207 MB/s) - 已保存 “/etc/yum.repos.d/CentOS-Base.repo” [2250/2250])

[root@localhost user]# yum clean all
已加载插件:fastestmirror, langpacks


File contains no section headers.
file: file:///etc/yum.repos.d/CentOS-Base.repo, line: 1
'<!DOCTYPE html>\n'

可以看到, 报错源的格式不对.
自己从浏览器上下载, 再放到对应目录就对了

标签:file,mirrors,repos,repo,etc,yum,aliyun
From: https://www.cnblogs.com/qds1401744017/p/16915585.html

相关文章

  • FileReader之获取文本文件内容为字符串
    FileReader之获取文本文件内容为字符串FileReader官网描述:FileReader对象允许Web应用程序异步读取存储在用户计算机上的文件(或原始数据缓冲区)的内容,使用File或Blob......
  • CentOS 7 yum 无法下载解决方案
    通过yum安装程序时无法下载的解决方法,有需要的小伙伴可以参考一下。环境:CentOS7.6.1810现象:通过yum安装程序时,每个镜像都无法下载文件,提示404错误,排除网络故障。具体现......
  • FastReport 设置多行多列
    1、打开frx页面  2、打开页面设置,选择纸张或者填写纸张宽度和高度  3、数据区的Colums属性下的Count可以根据需要设置 ......
  • Go之filepath标准库
    1.ToSlash函数:funcToSlash(pathstring)string释义:将path中平台相关的路径​​分隔符​​转换为'/'s:="F:\\golang_workspace\\leetcode\\aa.js"fmt.Println(......
  • 【DevEco Studio】MacOS系统 DevEco报错NoSuchFileException: /Applications/DevEco-S
    ​【问题描述】MacOS系统中DevEcoStudio从3.0.800版本更新至3.0.993版本,编译项目报错:NoSuchFileException:/Applications/DevEco-Studio.app/Contents/tools/gradle/......
  • 【DevEco Studio】MacOS系统 DevEco报错NoSuchFileException: /Applications/DevEco-S
    【问题描述】MacOS系统中DevEcoStudio从3.0.800版本更新至3.0.993版本,编译项目报错:NoSuchFileException:/Applications/DevEco-Studio.app/Contents/tools/gradle/lib/pl......
  • 问题解决:Unlink of file '.git/objects/pack/****' failed. Should I try again?
    gitpull拉取代码的时候遇到上面的错误,选择是或者否都不行,貌似说文件被占用了,也尝试用过找到.git里面对应的文件删除掉,也可以解决,不过文件占用多了,不可能一个个手动清......
  • create-react-app build without source map file All In One
    create-react-appbuildwithoutsourcemapfileAllInOnecrasourcemapsolutions.envGENERATE_SOURCEMAP=false#https://create-react-app.dev/docs/addi......
  • yum安装ansible
    1、在hosts文件中为主机做解析2、安装epel源3、安装ansible4、配置公钥认证【非必须】ssh-keygen如未做公钥认证可使用-u-k选项指定账号和密码,且最好保证连接时不需要yes......
  • failed to get exclusive lock on the configuration file
    上面报的错说,一个正在运行的进程在使用“configuration”文件,因此获不能获取配置文件的锁,而导致失败。知道了错误,就可以解决问题了,有进程在使用这个文件,那我们就到进程中......