Centos6.6 本地 yum 配置
来源:互联网 发布:shell脚本执行php文件 编辑:程序博客网 时间:2024/04/29 20:17
Centos6.6 本地yum源配置
1.首先将需要rpm库添加到系统中:
1).虚拟机中安装的linux操作系统:则只需将安装包ISO文件挂载到media下面(如无法挂载请参考http://www.cnblogs.com/shenliang123/p/3203278.html)
2).单独的服务器系统,则先在/media下新建centos(名字可以自定义,但与下面4中添加的目录相关),然后将ISO包里面的内容全部复制到该文件夹中
2. 进入到 /etc/yum.repos.d/ ,该目录下包含了四个文件:
[root@sl media]# ls -l /etc/yum.repos.d/total 16-rw-r--r--. 1 root root 1926 Feb 25 2013 CentOS-Base.repo-rw-r--r--. 1 root root 638 Feb 25 2013 CentOS-Debuginfo.repo-rw-r--r--. 1 root root 630 Feb 25 2013 CentOS-Media.repo-rw-r--r--. 1 root root 3664 Feb 25 2013 CentOS-Vault.repo
3. 将 CentOS-Base.repo和CentOS-Debuginfo.repo两个文件改名,绕过网络安装:
[root@sl yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repose_bak[root@sl yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo_bak
4. 编辑文件CentOS-Media.repo:(也可以自己新增一个repo文件,more用于查看,使用vi进行编辑)
[root@sl yum.repos.d]# more CentOS-Media.repo #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-media] #库名称name=CentOS-$releasever - Media #名称描述baseurl=file:///media/centos/ #yum源目录,源地址gpgcheck=1 #检查GPG-KEY,0为不检查,1为检查enabled=1 #是否用该yum源,0为禁用,1为使用gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6 #gpgcheck=0时无需配置
5. 测试yum是否配置成功:
[root@sl yum.repos.d]# yum listLoaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfileInstalled PackagesConsoleKit.x86_64 0.4.1-3.el6 @anaconda-CentOS-201303020151.x86_64/6.4ConsoleKit-libs.x86_64 0.4.1-3.el6 @anaconda-CentOS-201303020151.x86_64/6.4MAKEDEV.x86_64 3.24-6.el6 @anaconda-CentOS-201303020151.x86_64/6.4MySQL-python.x86_64 1.2.3-0.3.c1.1.el6 @anaconda-CentOS-201303020151.x86_64/6.4PyGreSQL.x86_64 3.8.1-2.el6 @anaconda-CentOS-201303020151.x86_64/6.4SDL.x86_64 1.2.14-3.el6 @anaconda-CentOS-201303020151.x86_64/6.4TurboGears2.noarch 2.0.3-4.el6 @anaconda-CentOS-201303020151.x86_64/6.4abrt.x86_64 2.0.8-15.el6.centos @anaconda-CentOS-201303020151.x86_more.........
6. 清除yum缓存:
[root@sl yum.repos.d]# yum clean allLoaded plugins: fastestmirror, securityCleaning repos:Cleaning up EverythingCleaning up list of fastest mirrors
7. 重新建立缓存
[root@sl yum.repos.d]# yum makecache Loaded plugins: fastestmirror, securityLoading mirror speeds from cached hostfilelocal | 2.9 kB 00:00 ...local/filelists_db | 3.9 MB 00:00 ...local/other_db | 1.7 MB 00:00 ...Metadata Cache Created
附:yum指令详解
1. 更新所有的RPM包
yum update
2. 更新指定的RPM包,如更新kernel包
yum update kernel
3. 安装RPM包,如lrzsz包
yum install lrzsz
yum install gcc*
注:可以在RPM包中使用匹配符,如安装所有以gcc开头的RPM包
4. 删除RPM包,包括与该包有依赖性的包
yum remove licq
同时会提示删除 licq-gnome,licq-qt,licq-text
5. 列出资源库中所有可以安装或更新的包
yum list
yum list gcc*
附:挂载CentOS_6.6 光驱
mkdir /media/"CentOS_6.6_Final"
mount -t iso9660 /dev/sr0 /media/"CentOS_6.6_Final"
0 0
- Centos6.6 本地 yum 配置
- CentOS6.6配置本地YUM源
- centos6.4配置本地源yum
- Centos6.4 本地yum源配置
- Centos6.4 本地yum源配置
- centos6下配置本地yum源
- CentOS6.5本地yum源配置
- yum 本地仓库配置(CentOS6.4系统)
- CentOS6.5下的yum本地源配置
- centos6配置本地YUM源(http方式)
- centos6.4 本地yum源
- 配置CentOS6 yum源
- Centos6.6使用本地yum源安装软件
- 为CentOS 6 配置本地YUM源
- linux4.6搭建本地yum配置文档
- 为CentOS 6 配置本地YUM源
- Redhat 6配置本地Yum源
- 为CentOS 6 配置本地YUM源
- 网站安全狗V3.2版 增加URL地址全检测功能 保护网站安全
- PHP获取客户端IP函数
- 预编译#if #endif #if #elif #endif
- 1048. Find Coins (25)
- LeetCode(201) Bitwise AND of Numbers Range
- Centos6.6 本地 yum 配置
- BeautifulSoup应用笔记(2)- 遍历文档树
- linux学习教程(一)(安装篇)centos7没有安装ifconfig命令的解决方法
- JUNIT -- springMVC的action进行单元测试
- 打造微信圆形头像更换
- 存储器总结一
- 关于CollectionView的九宫格排布,多选,全选实现及删除
- 【FastDev4Android框架开发】RecyclerView完全解析之打造新版类Gallery效果(二十九)
- Two Sum(Medium)