|
马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。
您需要 登录 才可以下载或查看,没有帐号?立即注册
x
欢迎大家来到仓酷云论坛!利用光盘镜像作为软件yum源:
[1]上传centos7光盘镜像到/usr/local/src目次下;(工具Xftp)
[2]挂载体系文件
mkdir/media/cdrom#习气用这个目次称号了;
cd/usr/local/src
ls
CentOS-7.0-1406-x86_64-DVD.iso
#mount-tiso9660-oloop/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso/media/cdrom/
mount:/dev/loop0iswrite-protected,mountingread-only
#cd/media/cdrom/
[root@mariadbcdrom]#ls
CentOS_BuildTagEULAimagesLiveOSrepodataRPM-GPG-KEY-CentOS-Testing-7
EFIGPLisolinuxPackagesRPM-GPG-KEY-CentOS-7TRANS.TBL
[3]设置开机主动挂载体系镜像文件
vim/etc/fstab
/usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso/media/cdrom/iso9660defaults,ro,loop00
:x#保留并加入
备注:iso9660CD-ROM光盘的尺度文件体系
mount-l
/usr/local/src/CentOS-7.0-1406-x86_64-DVD.isoon/media/cdromtypeiso9660(ro,relatime)[CentOS7x86_64]
[4]设置当地yum源文件;
vim/etc/yum.repos.d/centos7-media.repo
[centos7-media]
name=RedHatCentoslinux7.0#本人界说
baseurl=file:///media/cdrom#当地镜像文件路径
enabled=1#1为启动yum源,0为禁用
gpgcheck=1#1为反省GPG-KEY,0为不反省
gpgkey=file:///media/cdrom/RPM-GPG-KEY-CentOS-7#GPG-KEY文件路径
yumcleanall#扫除缓存
Loadedplugins:fastestmirror
Cleaningrepos:basecentos7-mediaepelextrasupdates
Cleaningupeverything
Cleaninguplistoffastestmirrors
[root@mariadb~]#yummakecache#缓存当地yum源包信息
Loadedplugins:fastestmirror
base|3.6kB00:00:00
centos7-media|3.6kB00:00:00
epel/x86_64/metalink|5.3kB00:00:00
epel|4.4kB00:00:00
extras|3.3kB00:00:00
updates|3.4kB00:00:00
(1/20):centos7-media/group_gz|157kB00:00:00
(2/20):centos7-media/filelists_db|2.8MB00:00:00
(3/20):base/7/x86_64/group_gz|157kB00:00:00
(4/20):centos7-media/primary_db|2.7MB00:00:00
(5/20):centos7-media/other_db|1.1MB00:00:00
[5]利用当地yum源装置软件:
#yum--enablerepo=centos7-mediasearchhttpd#检察是不是有httpd软件包
...
httpd.x86_64:ApacheHTTPServer
httpd-devel.x86_64:Developmentinte***cesfortheApacheHTTPserver
httpd-itk.x86_64:MPMItkforApacheHTTPServer
httpd-manual.noarch:DocumentationfortheApacheHTTPserver
httpd-tools.x86_64:ToolsforusewiththeApacheHTTPServer
...
#yum--enablerepo=centos7-media-yinstallhttpd
Installed:
httpd.x86_640:2.4.6-18.el7.centos
#rpm-qahttpd
httpd-2.4.6-18.el7.centos.x86_64
到此当地yum源已设置终了!
欢迎大家来到仓酷云论坛! |
|