Centos YUM组安装报错解决 yum grouplist 提示: There is no installed groups file (已解决)

问题被景:
由于需要,需安装Centos7.4 Infrastructure Server环境,但是在安装OS时,选择了Minmal安装
注:yum server 为自行搭建的内网yum服务器
解决思路
1、重新安装Centos7.4(不推荐)
2、使用yum grouplist /yum groupinstall 命令安装 Infrastructure Server相关包即可

问题
Yum grouplist 提示: There is no installed groups file

[root]# yum grouplist
Loaded plugins: fastestmirror
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
Loading mirror speeds from cached hostfile

原因与解决方法
yum server 缺少groups 的定义文件,yum server端需使用createrepo生成

Yum Server端操作:
查找Groups file位置,前往yum相关目录创建goup file,**注:${Groups_File}为查找到的文件**
#find / -name *comps.xml*
#cd /var/ftp/Centos7.4
#createrepo -g ${Groups_File} .

注:如果已创建过,需更新的话使用命令 createrepo -g ${GROUPS_FILE} --update .



Client Server端操作:
#yum clean all ; yum makecache
#yum groupinstall -y Infrastructure Server

参考链接:
https://unix.stackexchange.com/questions/246953/how-do-i-get-yum-groupinstall-to-work-without-a-groups-install-file

Groups in yum are defined by the repositories themselves.

If yum group list does not list any groups, it means none of the enabled yum repositories have groups defined.

Groups in yum are generally defined in a /…-comps.xml file (or similar, where … is a random string) within the repodata directory of the repo.

If the repo was created manually, they may have forgotten to include a group file (or at least, forgot to use the one that comes with CentOS).

createrepo -g ${GROUPS_FILE} .
Will create a repo in the current directory, using the file defined by ${GROUPS_FILE}.

If the repo already exists and you simply want to add the groups file to it, you can use --update.

createrepo -g ${GROUPS_FILE} --update .
createrepo will copy the groups file into the repodata directory, so you don’t have to worry about the original copy.

你可能感兴趣的:(Linux)