软件包安装方式

0.默认从官网下载包(国内,雅虎,网易,阿里云)
        cat /etc/yum.repos.d/rhel-source.repo  【yum文件目录--redhat6版】

【搜狐】http://mirrors.sohu.com/help/CentOS-Base-sohu.repo
【网易】http://mirrors.163.com/.help/CentOS6-Base-163.repo
【阿里】https://mirrors.aliyun.com/help/centos

   1.yum :  Linux包管理器 ,解决依赖问题,方便快捷

        yum install XXX -y
yum groupinstall XXX 包组的列表 -y
yum grouplist 里面选择包组,然后yum groupinstall "包组" -y
yum search 包名
yum search all 查询所有
yum remove tree -y 删除命令(不建议用,因为yum可以解决依赖问题,删除会删除所有包的依赖)
yum update; 安装所有软件到最新版本

   2. rpm安装:

        rpm -ivh 包名  i==install h==human 人可读
rpm -ivh 包名 安装软件
rpm -qa 包名 查询包名
最大的问题:就是安装包的依赖问题(a->b->c->d)

     3.源码安装:

 /configure; make; make install  源代码安装方式

在线安装配置yum源

# 查看操作系统版本
cat /etc/redhat-release
# 查看操作系统32/64位
uname -m
# 进入yum文件目录
cd /etc/yum.repos.d
# 备份源文件
cp CentOS-Base.repo CentOS-Base.repo.bak
# 下载网易yum源
wget http://mirrors.163.com/.help/CentOS6-Base-163.repo 【网易】
#【可选】下载阿里yum源
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-6.repo  【阿里】
# 更改权限和属组
chmod 644 CentOS6-Base-163.repo
chown root.root CentOS6-Base-163.repo
附[可选]:如果还是用不了yum,可以替换文件内的版本信息为你当前操作系统的版本,一般没问题的
# 替换文件的版本信息
sed -i 's/$releasever/6/g' CentOS6-Base-163.repo

配置yum安装保存安装包

# 更改配置文件
sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf
# 进入路径下查看安装包
cd /var/cache/yum/*/6/base/packages/
# 查看更改后的文件信息 grep 'keep' /etc/yum.conf

附网易yum源:

 # CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$releasever - Base - .com
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS-$releasever - Updates - .com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - .com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - .com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - .com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=
enabled=
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6

附阿里配置文件

 # CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client. You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the
# remarked out baseurl= line instead.
#
# [base]
name=CentOS-$releasever - Base - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #released updates
[updates]
name=CentOS-$releasever - Updates - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/updates/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/extras/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/centosplus/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=
enabled=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6 #contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - mirrors.aliyun.com
failovermethod=priority
baseurl=http://mirrors.aliyun.com/centos/$releasever/contrib/$basearch/
http://mirrors.aliyuncs.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=
enabled=
gpgkey=http://mirrors.aliyun.com/centos/RPM-GPG-KEY-CentOS-6

Linux yum源详解的更多相关文章

  1. 【转发】linux yum命令详解

    linux yum命令详解 yum(全 称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理, ...

  2. linux yum 命令 详解

    linux yum命令详解 yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能 ...

  3. linux yum+wget详解

    在做自动化测试的时候,有个test需要执行命令:wget http://www.aliyun.com,但是返回的结果是未找到命令wget,于是百度了相关资料,发现没有安装wget,于是利用yum in ...

  4. linux yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  5. Linux yum配置文件详解

    说明:经过网上抄袭和自己的总结加实验,非常详细,可留作参考. yum的配置一般有两种方式:   一种是直接配置/etc目录下的yum.conf文件, 另外一种是在/etc/yum.repos.d目录下 ...

  6. linux yum命令详解-转

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  7. 【转】linux yum命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  8. Linux -Yum 命令详解

    yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE中的Shell前端软件包管理器.基於RPM包管理,能够从指定的服务器自动下载RP ...

  9. <ZZ>linux yum命令详解

    http://www.cnblogs.com/chuncn/archive/2010/10/17/1853915.html yum(全称为 Yellow dog Updater, Modified)是 ...

随机推荐

  1. 面试题----C语言中exit和return的区别

    C语言中return和exit的区别 exit用于结束进程,返回的状态码是给操作系统使用或父进程使用的.return是堆栈返回,返回的值是给主调函数用的.主线程结束前会默认调用exit结束进程. ex ...

  2. 代码部署工具walle(一)

    一.概述 代码部署上线.权限控制.一键版本回滚,github地址:https://github.com/meolu/walle-web walle是基于php语言做的,所以需要一个php的安装环境. ...

  3. java8 Stream使用案例

    1. 原理 Stream 不是集合元素,它不是数据结构并不保存数据,它是有关算法和计算的,它更像一个高级版本的 Iterator. 原始版本的 Iterator,用户只能显式地一个一个遍历元素并对其执 ...

  4. OAuth 2.0授权之授权码授权

    OAuth 2.0 是一个开放的标准协议,允许应用程序访问其它应用的用户授权的数据(如用户名.头像.昵称等).比如使用微信.QQ.支付宝登录等第三方网站,只需要用户点击授权按钮,第三方网站就会获取到用 ...

  5. Silverlight 查询DataGrid 中匹配项 ,后台改变选中行颜色

    需求:根据关键字(参会人号码或名称)查找参会人,在datagird 中高亮显示 界面:我在界面上增加了一个文本框和按钮,进行查找操作 操作说明: 根据关键字进行搜索:输入关键字 点击查找,如果找到 以 ...

  6. .netcore入门

    开发环境:windows    编辑器: Visual Studio Code 环境安装: .Net Core 1.1 SDK     https://www.microsoft.com/net/co ...

  7. [基础篇] 玄机网C#培训课程-初级.

    课程目录 0x01第一课课前准备vs的选择与安装常用工具/网址      http://msdn.itellyou.cn/vs常用设置 0x02第二课C#的语法样式  编程风格VS的常用功能 俩个注意 ...

  8. JavaScript 日期多加一天 方法

    今天查看项目发现有出bug,由于未了符合sql语句的要求,前台网页显示的时候传到后台的时候要+1天, 网上查看了别人写的,发现多多少少有点漏洞,经过我自己总结,写出了达到了我要求的 var str = ...

  9. 学习Spring.Net:1.简单的应用之控制台

    1.开始. 2.新建一个控制台,我们新建一个SpringNetTest类. using System; using System.Collections.Generic; using System.L ...

  10. java的锁机制——synchronized

    一段synchronized的代码被一个线程执行之前,他要先拿到执行这段代码的权限,在java里边就是拿到某个同步对象的锁(一个对象只有一把锁): 如果这个时候同步对象的锁被其他线程拿走了,他(这个线 ...