[笔记]CentOS如何启用单一的yum源
2016-05-28 22:29
549 查看
用法:
yum --disablerepo=reponame # 禁用源
yum --enablerepo=reponame # 启用源
# 以使用本地yum源安装php为例
# 查看可用的源
[test@localhost ~]$ yum repolist
Loaded plugins: fastestmirror, security
Determining fastest mirrors
.....省略....
repo id repo name status
base CentOS-6 - Base 6,696
c6-media CentOS-6 - Media 6,575
extras CentOS-6 - Extras 60
updates CentOS-6 - Updates 94
repolist: 13,425
# 只是用本地yum源来安装
[test@localhost etc]$ sudo yum --disablerepo='*' --enablerepo=c6-media install php
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* c6-media: <--------注意
Resolving Dependencies
--> Running transaction check
# 以上还可写作
[test@localhost etc]$ sudo yum --disablerepo=* --enablerepo=c6-media install php
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* c6-media: <--------注意与之前输出的区别
Resolving Dependencies
--> Running transaction check
# 除了指定的源,其他存在的源也会启用
[test@localhost etc]$ sudo yum --enablerepo=c6-media install php
[sudo] password for test:
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com <------注意与之前输出的区别
* c6-media:
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Resolving Dependencies
--> Running transaction check
# 所有的源都被禁用
[test@localhost etc]$ sudo yum --disablerepo='*' install php
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
No package php available. <------注意与之前输出的区别
Error: Nothing to do
yum --disablerepo=reponame # 禁用源
yum --enablerepo=reponame # 启用源
# 以使用本地yum源安装php为例
# 查看可用的源
[test@localhost ~]$ yum repolist
Loaded plugins: fastestmirror, security
Determining fastest mirrors
.....省略....
repo id repo name status
base CentOS-6 - Base 6,696
c6-media CentOS-6 - Media 6,575
extras CentOS-6 - Extras 60
updates CentOS-6 - Updates 94
repolist: 13,425
# 只是用本地yum源来安装
[test@localhost etc]$ sudo yum --disablerepo='*' --enablerepo=c6-media install php
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* c6-media: <--------注意
Resolving Dependencies
--> Running transaction check
# 以上还可写作
[test@localhost etc]$ sudo yum --disablerepo=* --enablerepo=c6-media install php
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* c6-media: <--------注意与之前输出的区别
Resolving Dependencies
--> Running transaction check
# 除了指定的源,其他存在的源也会启用
[test@localhost etc]$ sudo yum --enablerepo=c6-media install php
[sudo] password for test:
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: mirrors.yun-idc.com <------注意与之前输出的区别
* c6-media:
* extras: mirrors.yun-idc.com
* updates: mirrors.yun-idc.com
Resolving Dependencies
--> Running transaction check
# 所有的源都被禁用
[test@localhost etc]$ sudo yum --disablerepo='*' install php
Loaded plugins: fastestmirror, security
Setting up Install Process
Loading mirror speeds from cached hostfile
No package php available. <------注意与之前输出的区别
Error: Nothing to do
相关文章推荐
- Centos6 编译安装Python
- centos下删除用yum安装的软件
- 利用yum安装Redis的方法详解
- CentOS 5.5使用yum来安装LAMP(php运行环境)
- centos6利用yum安装php mysql gd的步骤
- CentOS系统下编译安装MySQL以及设置相关yum源的教程
- 详解Centos 使用YUM安装MariaDB
- Linux下yum常用命令汇总
- CentOS 6.5下yum安装 MySQL-5.5全过程图文教程
- CentOS 5 上安装yum的方法
- CentOS 6.5系统中使用yum安装MongoDB 2.6 教程
- centos yum 安装 mongodb 以及php扩展
- 使用光盘配置本地yum源的方法 yum源配置
- 阿里云云服务器Linux系统更新yum源Shell脚本
- CentOS7系统下用YUM安装Nginx详解
- 从Oracle Public Yum为Oracle Linux建立本地的Yum源
- vmware下安装rhel6.7
- 【笔记】CentOS
- [Linux学习笔记] Linux软件包管理
- CentOS如何将DVD设置为默认yum源以便DVD中软件的下载安装