Linux配置本地软件仓库,Linux软件安装管理:挂载本地iso光盘镜像、配置yum软件仓库...

疑问:如果没有网络,沒有光驅,網絡較慢等,如何使用yum源?

答案:使用本地ISO搭建yum源

本地ftp,http源,epel源,後續補充

1,創建ISO存放目錄、掛載點

~]# mkdir /mnt/iso

~]# mkdir /mnt/iso_mount

2,自動掛載并啟動掛載點

~]# echo "/mnt/iso.iso /mnt/iso_mount iso9660 loop 0 0" >> /etc/fstab

~]# mount -a

~]# mount | grep .iso

/mnt/iso/iso.iso on /mnt/iso_mount type iso9660

(rw,loop=/dev/loop0)

3,創建yum 源

cp /etc/yum.repos.d/CentOS-Media.repo /etc/yum.repos.d/CentOS-Iso.repo

CentOS-Base.repo改名

yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak

備份創建光盤repo配置文件,名稱可自取配置文件,名稱可自取

yum.repos.d]# cp CentOS-Media.repo CentOS-Media.repo.bak

修改repo配置文件,名稱可自取

yum.repos.d]# vim CentOS-Media.repo

# CentOS-Media.repo

#

#  This repo can be used with mounted DVD media, verify the mount

point for

#  CentOS-6.  You can use this repo and yum to install items

directly off the

#  DVD ISO that we release.

#

# To use this repo, put in your DVD and use it with the other

repos too:

#  yum --enablerepo=c6-media [command]

#

# or for ONLY the media repo, do this:

#

#  yum --disablerepo=\* --enablerepo=c6-media [command]

[c6-iso]

name=CentOS-$releasever - ISO

baseurl=file:///mnt/iso_mount/

#        file:///media/cdrom/

#       file:///media/cdrecorder/

gpgcheck=1

enabled=1

gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

加載yum源

~]# yum clean all

~]# yum repolist

Loaded plugins: fastestmirror, refresh-packagekit, security

Loading mirror speeds from cached hostfile

c6-iso                                                        |

4.0 kB     00:00 ...

repo id                             repo name

status

c6-iso                              CentOS-6 - ISO

6,367

repolist: 6,367

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值