Blogger Information
Blog 75
fans 0
comment 0
visits 55340
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
小猿圈之Linux服务器---详解本地yum
聆听的博客
Original
551 people have browsed it

linux服务器很多种,小猿圈针对于本地yum进行详解,yum相信很多人再用吧,教大家一些使用的技巧,希望对大家有所帮助。

本地yum可以实现各种包的快速安装,避免漫长的下载过程    

1、找一个centos的安装包,将其挂载的系统中

[root@localhost ~]# mount –t iso9660 –loop centos-i386.iso /mnt

2、拷贝所有的内容到某个指定的文件夹,例如“/wj/centos-img/”

[root@localhost ~]# mkdir /wj/centos-img

[root@localhost ~]# cp /mnt /wj/centos-img

3、跳转的yum的配置目录“/etc/yum.repos.d”

[root@localhost ~]# cd /etc/yum.repos.d/

[root@localhost yum.repos.d]# ls

CentOS-Base.repo        CentOS-Media.repo

CentOS-Debuginfo.repo  CentOS-Vault.repo

4、将配置目录下的所有配置文件做备份

[root@localhost yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak

[root@localhost yum.repos.d]# mv CentOS-Media.repo CentOS-Media.repo.bak

[root@localhost yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak

[root@localhost yum.repos.d]# mv CentOS-Vault.repo CentOS-Vault.repo.bak

5、编辑其中一个配置文件,这里用的是CentOS-Base.repo

[root@localhost yum.repos.d]# vi CentOS-Base.repo

[base]

name=CentOS-Base

#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os     这句话前面加#,相当于注释掉

baseurl=file:///wj/centos-img/   这里是centos包的路径,上面已经拷贝到/wj/centos-img

gpgcheck=1  

gpgkey=file:///wj/centos-img/RPM-GPG-KEY-CentOS-6     注意这里的路径也有改变

enable=1   这里是1,代表使能当前的配置

6、清除yum的缓存

[root@localhost ~]# yum clean metadata

[root@localhost ~]# yum clean all

7、测试,查看当前yum配置是否成功

[root@localhost ~]# yum list

。。。

seahorse-plugins.i686             2.28.1-2.el6          base                                 

seekwatcher.noarch                0.12-5.el6            base                                 

selinux-policy-doc.noarch         3.7.19-231.el6        base                                 

selinux-policy-minimum.noarch     3.7.19-231.el6        base                                 

。。。              

感觉很不错吧,小编感觉这篇文章很不错推荐给大家,小编学到了,不知道大家学到了没,如果想深层次了解,可以在小猿圈学习一下,免费的学习资料,值得推荐给大家。         

Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post