使用centos 经常发现官方提供的软件包版本过低,很多时候大家会选择下载源码自行编译,带来了很多麻烦。

centos安装最新版本软件包,例如git,python等,可以通过红帽官方提供的software collection,或者社区提供的ius实现。

IUS

IUS是一个社区维护的软件源,全名是Inline with Upstream Stable,官网为https://ius.io/,通过github组织社区https://github.com/iuscommunity

IUS被git帮助文档推荐作为centos等系统安装新版本git的第三方源:https://git-scm.com/download/linux

安装IUS是直接安装软件包,并不像SCL还带了虚拟环境的概念。所以使用起来相对简单。

安装git命令:

yum install epel-release
rpm -U https://centos7.iuscommunity.org/ius-release.rpm
yum remove git
yum install git2u

IUS为了避免与官方源冲突,所以对软件包名进行了修改, 规则为:{name}{major_version}{minor_version}u 。

IUS支持的软件包,可通过github查询

IUS直接访问速度不是很理想,可以设置国内镜像可编辑 /etc/yum.repos.d/ius.repo,将官方网址修改为镜像地址

IUS 站点根目录为:https://dl.iuscommunity.org/pub/ius/

对应的阿里云镜像为:https://mirrors.aliyun.com/ius/

镜像列表:https://mirrors.iuscommunity.org/mirrors

清华大学镜像:https://mirrors.tuna.tsinghua.edu.cn/ius/

同济大学镜像:https://mirrors.tongji.edu.cn/ius/

[ius]
name = IUS for Enterprise Linux 7 - $basearch
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/$basearch/
enabled = 1
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7 [ius-debuginfo]
name = IUS for Enterprise Linux 7 - $basearch - Debug
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/$basearch/debug/
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7 [ius-source]
name = IUS for Enterprise Linux 7 - Source
baseurl = https://mirrors.tuna.tsinghua.edu.cn/ius/7/src/
enabled = 0
repo_gpgcheck = 0
gpgcheck = 1
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-IUS-7

参考:

https://www.cnblogs.com/f-ck-need-u/p/8494992.html

SCL

scl不是一个简单的包管理工具,而是类似python的venv(virtualenv) 。它可以支持系统同时安装多个版本的软件,然后通过scl enable命令来激活相应软件环境,而不会对原始的软件环境产生影响。

以git安装和启用为例:

yum install centos-release-scl
yum install rh-git29
scl enable rh-git29 bash ##激活git的打开bash
git --version

但是对于我们而言,如果不需要这么复杂的虚拟环境功能,单纯想要使用其提供的最新版本软件,可以通过 source scl_source enable 命令实现。

如果需要系统重启后,能够自动启动最新版本软件环境,可进行以下配置:

#通过bash环境来设定,仅对特定用户启用
vi ~/.bashrc # or ~/.bash_profile source scl_source enable rh-git29

或者

#对全局用户启用
vi /etc/profile.d/enable_scl.sh #!/bin/bash
source scl_source enable rh-git29

或者

scl enable rh-git29 bash
which git
/opt/rh/rh-git29/root/usr/bin/git ln -s /opt/rh/rh-git29/root/usr/bin/git /usr/bin/git

参考:

https://www.softwarecollections.org/en/docs/

http://xmodulo.com/enable-software-collections-centos.html

https://unix.stackexchange.com/questions/175851/how-to-permanently-enable-scl-centos-6-4

https://serverfault.com/questions/751155/permanently-enable-a-scl

https://access.redhat.com/solutions/527703

通过上述两个源,大家在使用centos时,或许可以减少安装软件的工作量。

centos 安装或更新最新版本软件包(git python etc)的方法 SCL IUS的更多相关文章

  1. Ubuntu18.04 LTS 安装部署golang最新版本1.10

    1 步骤 //1 直接安装golang-go 目前最新版本是1.10 sudo apt-get install golang-go //2 向/etc/profile追加以下代码 sudo vim / ...

  2. 在 CentOS 6.x 上安装最新版本的 git

    在 CentOS 的默认仓库中有git,所以最简单的方法是: $ sudo yum install git 这种方法虽然简单,但是一般仓库里的版本更新不及时,比如 CentOS 仓库中的 git 最新 ...

  3. centos7 安装docker-ce ,最新版本docker,docker阿里云加速

    直接用yum install docker -y安装的docker版本为1.12,但是docker发展很快,现在都17.06.2了.docker-ce是指docker的社区版 卸载老版本的 docke ...

  4. Centos安装JIRA 7.13版本(自己在官方下载最新版)以及破解

    后半部分流程来自:https://www.cnblogs.com/kaola8023/p/6950481.html 安装准备(切记将许可证号备份) 1.准备mysql需要5.6以及以上的版本(注意:建 ...

  5. CentOS安装JAVA后JAVA版本不对的问题

    今天用CentOS安装JDK,发觉在安装完成后,输入java命令来验证是否安装成功时,出现 Usage: gij [OPTION] ... CLASS [ARGS] ...          to i ...

  6. 安装node的最新版本

    前段时间小试了一下node 这段时间就差不多忘了 恩 然后现在自己想去回顾一下,然后流程想再好好弄一遍 争取掌握node 因为我现在已经安装了 一个node版本 那我想安装最新版本吧 首先,看看你的n ...

  7. CentOS 安装 git2.x.x 版本

    方法一 源码方式安装 第一步:卸载旧的git版本. $ yum remove git 第二步:下载git $ wget --no-check-certificate https://www.kerne ...

  8. CENTOS 升级Nodejs 到最新版本

    1.去官网下载和自己系统匹配的文件: 英文网址:https://nodejs.org/en/download/ 中文网址:http://nodejs.cn/download/ 通过  uname -a ...

  9. Centos安装(更新)git(亲测有效)

    Centos 6.5默认安装的是git 1.7.X 版本,使用过程中会有一些奇怪的问题,对于用户名.密码支持不是很友好.将Centos6.5上的git更新到2.0.5,方法如下: 1.安装编译git时 ...

随机推荐

  1. MVC,MVP 和 MVVM 模式如何选择?

    转摘:http://www.linuxidc.com/Linux/2015-10/124622.htm 前言 做客户端开发.前端开发对MVC.MVP.MVVM这些名词不了解也应该大致听过,都是为了解决 ...

  2. leetcode504

    public class Solution { public string ConvertToBase7(int num) { ? "" : "-"; var ...

  3. Spring MVC 自定义视图

    实现View import org.springframework.stereotype.Component; import org.springframework.web.servlet.View; ...

  4. SOA和微服务到底是什么关系

    本文原创,原文地址为:http://www.cnblogs.com/fengzheng/p/5847441.html SOA和微服务到底是什么关系? 说实话,我确实不明白SOA和微服务到底有什么本质上 ...

  5. GBDT 将子树结果当成lr输出

    http://scikit-learn.org/stable/auto_examples/ensemble/plot_feature_transformation.html#example-ensem ...

  6. 奶牛易物小组 Alpha冲刺

    项目地址:https://gitee.com/rrycbar/NenuChange 1 第一天 日期:2018/6/14 1.1 今日完成任务情况以及遇到的问题. 吴建瑜: 完成任务: 1.继续完善购 ...

  7. 大型运输行业实战_day04_3_高级查询+分页

    1.高级查询+分页最终结果 2.分页的本质分析 前端传入:当前页  和  每页显示条数 数据库必须查询出:数据列表 和 总共条数 页面显示包括的数据有: 列表 +  每页显示条数 + 当前页 + 总共 ...

  8. Eclipse编辑jsp不显示预览效果页面

    转载链接:https://blog.csdn.net/fishsr/article/details/22662787 转载 2014年03月31日 13:35:35 1.Eclipse打开jsp后,在 ...

  9. 在c#下用 WCF编写restful

    1.添加WCF服务库 2.在global里面注册路由 RouteTable.Routes.Add(new ServiceRoute("api", new WebServiceHos ...

  10. java线程状态及转换

    java线程有6种状态: 新建线程new,启动线程runnable,阻塞block,限时等待timed_waiting,等待线程waiting,终止线程terminated 1.限时等待timed w ...