Yum group install 错误
$ sudo yum groupinstall "Server with GUI"
Last metadata expiration check: 0:00:04 ago on Mon 30 Nov 2020 10:23:37 AM CST.
Warning: Group 'Server' does not exist.
Warning: Group 'with' does not exist.
Warning: Group 'GUI' does not exist.
Error: Nothing to do.
原因是目前比较新的Linux 发行版yum已经被dnf替代。
vim /usr/bin/yum
查看
#!/usr/bin/bash
args="$@"
append='Package(s) download url:'
for i in "$@"
do
case $i in
"--listurl-only")
args=`echo "$@" | sed 's/install/download/; s/--listurl-only/--urls/; s/--enableplugin=listdownloadpkgurl//'`
result=`dnf $args`
if [[ $result = *"http"* ]];then
echo "$result" | awk '{if(!match($0, "http")){print $0}}'
echo $append
echo "$result" | awk '{if(match($0, "http")){n=split($0,a,"/");sub(/.rpm/,"",a[n]);printf " %s %s\n", a[n],$0}}'
exit 0
else
exit 1
fi
;;
"makecache")
args=`echo "$@" | sed 's/fast//'`
;;
"--downloadonly")
args="$args -y"
;;
esac
done
dnf $args
确实是dnf的包装, 在对带空格的group安装字符串处理有误,导致无法安装。
正确的的做法, 直接用dnf安装
$ sudo dnf groupinstall "Server with GUI"
安装成功。