安装7z工具。使用命令
yum install p7zip -y
运行之后报错了
File contains no section headers
先配置yum源,直接将配置文件删了,重新下载一个
rm -f /etc/yum.repos.d/CentOS-Base.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
所有的都搞完了之后 ,在运行
yum install p7zip -y
出现了下面的问题
没有可用软件包 xxxx。
错误:无须任何处理
这个就是没有软件包,二话不说直接更新epel第三方软件库
yum install -y epel-release
但是尴尬的是,第三方的软件库说是最新的
使用下面命令
yum update
再次执行 yum install p7zip -y
还是不行,还是同样的错,直接卸载epel再把目录清空
卸载:yum remove epel-release
清空目录:rm -rf /var/cache/yum/x86_64/6/epel/
安装:yum install epel-release
然后再安装7z:yum install p7zip -y
以上OK