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

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

答案:使用本地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

文章知识点与官方知识档案匹配,可进一步学习相关知识CS入门技能树Linux入门在线安装软件24756 人正在系统学习中 相关资源:糖烟茶酒行业管理软件 烟酒进销存店铺销售收银管理系统

来源:南笙有酒

声明:本站部分文章及图片转载于互联网,内容版权归原作者所有,如本站任何资料有侵权请您尽早请联系jinwei@zod.com.cn进行处理,非常感谢!

上一篇 2021年4月3日
下一篇 2021年4月3日

相关推荐