无网络环境怎么yum安装/配置yum源

一、有网络环境开启缓存

1、修改/etc/yum.conf
把keepcache=0改成keepcache=1
2、yum安装软件就可以缓存rpm包了
3、包路径保存在/var/cache/yum/x86_64/7/base/packages

二、上传缓存包至无网络环境服务器目录/yum/

三、无网络环境配置yum源

cd /yum/ 到rpm包所在目录
createrepo ./
vim /etc/yum.repos.d/local.repo
[local]
name=local
baseurl=file:///yum #repodata目录存在的路径
gpgcheck=0
enabled=1

四、无网络环境下载

验证是否配置完成

yum repolist
删除之前的包,重新安装,如果走缓存,清缓存
Yum clean all
Yum makecache

yum install mariadb-5.5.68-1.el7.x86_64.rpm --skip-broken
rpm -ivh --force --nodeps mariadb-5.5.68-1.el7.x86_64.rpm
以上两种安装方式都可以尝试

你可能感兴趣的:(网络,服务器,linux)