Red Hat配置本地yum源
创建本地源文件夹
mkdir -p /mnt/cdrom
挂载镜像文件至指定的目录
mount /dev/cdrom /mnt/cdrom
备份本地源
cp -rf /etc/yum.repos.d /etc/yum.repos.d_$(date '+%Y%m%d_%H%M%S')
删除默认原本地源
rm -rf /etc/yum.repos.d/*
配置本地源,创建Media.repo文件
vi /etc/yum.repos.d/local.repo
配置以下内容
[local]
name=local
baseurl=file:///mnt/cdrom
gpgcheck=1
enabled=1
gpgkey=file:///mnt/cdrom/RPM-GPG-KEY-redhat-release
关闭订阅插件提示
将plugins参数设置为0
vi /etc/yum.conf
vim /etc/yum/pluginconf.d/subscription-manager.conf
加载本地yum源&测试
清除yum缓存
yum clean all
缓存本地yum源
yum makecache
# 测试yum本地源
yum list
安装依赖包
yum groupinstall -y "Server with GUI"
yum install -y bc \
binutils \
compat-libcap1 \
compat-libstdc++-33 \
gcc \
gcc-c++ \
elfutils-libelf \
elfutils-libelf-devel \
glibc \
glibc-devel \
ksh \
libaio \
libaio-devel \
libgcc \
libstdc++ \
libstdc++-devel \
libxcb \
libX11 \
libXau \
libXi \
libXtst \
libXrender \
libXrender-devel \
make \
net-tools \
nfs-utils \
smartmontools \
sysstat \
e2fsprogs \
e2fsprogs-libs \
fontconfig-devel \
expect \
unzip \
openssh-clients \
readline* \
tigervnc* \
psmisc --skip-broken