centos7配置本地yum源(ISO镜像版)
短信预约 -IT技能 免费直播动态提醒
centos7配置本地yum源(ISO镜像版)
centos7配置本地yum源(ISO镜像版)
背景:
由于本地的centos选择的是最小化安装,很多的包是没有的,比如常用的wget,gcc等等,所以需要使用iso镜像配置下本地yum源。
1、下载centos镜像
注意下镜像不能是mini版的,要用dvd或者everything版的,mini版很多包是缺失的
镜像地址:https://mirrors.aliyun.com/centos/7/isos/x86_64/?spm=a2c6h.25603864.0.0.200e4511qh3X7S
2、虚拟机加载ISO镜像
3、挂载IOS镜像
mkdir /mnt/isomount -o loop /dev/cdrom /mnt/isodf -lh
4、修改yum源
# 备份cd /etc/yum.repos.d/lscp CentOS-Base.repo CentOS-Base.repo.default
vi CentOS-Base.repo
修改后的文件如下:
[base]name=CentOS-$releasever - Base#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os&infra=$infrabaseurl=file:///mnt/iso#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#released updates[updates]name=CentOS-$releasever - Updates#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates&infra=$infrabaseurl=file:///mnt/iso#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that may be useful[extras]name=CentOS-$releasever - Extras#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras&infra=$infrabaseurl=file:///mnt/iso#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/gpgcheck=1gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7#additional packages that extend functionality of existing packages[centosplus]name=CentOS-$releasever - Plus#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus&infra=$infrabaseurl=file:///mnt/iso#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/gpgcheck=1enabled=0gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
5、更新yum源配置
yum clean allyum makecache
6、测试本地yum源
# 安装wgetyum install -y wget
来源地址:https://blog.csdn.net/2301_78148444/article/details/130669923
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341