LINUX离线安装阿里镜像

由于客户环境网络有限制,不能直接在线yum镜像来下载相关的依赖,所以只能配置离线Yum源并进行离线安装。

一、准备离线Yum源

获取CentOS 7的官方或第三方镜像,如DVD ISO或网络安装源的完整副本。这些通常包含大量的软件包供离线环境使用。可以从以下来源获取:

第三方镜像站点:阿里云地址: link
根据服务器的32/64位,下载ios结尾的

二、挂载ISO镜像或解压本地镜像

下载好后,上传到服务器某个目录,不用解压
如我自己的

 mkdir -p /mnt/cdrom
 挂载
 sudo mount -o loop /mnt/CentOS-7-x86_64-DVD-1708.iso /mnt/cdrom

备份之前的镜像配置

sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
修改
sudo vi /etc/yum.repos.d/CentOS-Base.repo

# CentOS-+1-4.5/6183<4=4=4=Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
 
[base]
name=CentOS-$releasever - Base - Local Repository
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1
 
#released updates 
[updates]
[updates]
name=CentOS-$releasever - Updates - Local Repository
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1
 
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - Local Repository
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1
 
#additional packages that extend functionality of existing packages
[centosplus]
[centosplus]
name=CentOS-$releasever - Plus - Local Repository
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1

 
#contrib - packages by Centos Users
[contrib]
[contrib]
name=CentOS-$releasever - Contrib - Local Repository
baseurl=file:///mnt/cdrom/
gpgcheck=0
enabled=1

然后执行 清理缓存并重新生成YUM缓存

1、yum clean all
2、yum makecache

至此离线镜像源安装配置完成

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值