在网站 Linux_Downloads – Oracle VM VirtualBox 下载RHEL的repo文件
做一下修改
[virtualbox] name=RHEL / CentOS-$releasever / $basearch - VirtualBox baseurl=http://download.virtualbox.org/virtualbox/rpm/el/$releasever/$basearch enabled=1 gpgcheck=1 repo_gpgcheck=1 gpgkey=https://www.virtualbox.org/download/oracle_vbox.asc
把virtualbox.repo文件放到/etc/yum.repos.d下面。
执行命令
yum clean all
yum makecache
rpm –import https://www.virtualbox.org/download/oracle_vbox.asc
yum install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
yum update
yum install binutils kernel-devel kernel-headers libgomp make patch gcc glibc-headers glibc-devel dkms -y
yum install VirtualBox-6.1