使用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. Laravel之Eloquent ORM

    一.ORM编程思想 1.1 Active Record 设计模式 Active Record 是一种数据访问设计模式,它可以帮助你实现数据对象Object到关系数据库的映射.应用Active Reco ...

  2. FindWindow 查找窗口

    Declare Function SendMessage Lib "user32" Alias "SendMessageA" _ (ByVal hwnd As ...

  3. Find 和 Findstr

    FIND 在文件中搜索文字字符串. FINDSTR 在文件中搜索字符串.   findstr能用正则表达式,而find不能   dir c:|find /N /I /C "windows&q ...

  4. Error 2503 and 2502 when installing/uninstalling on Windows 10

    1. Hold Ctrl+Shift and press Esc. 2. Locate “Windows Explorer” under “Windows processes”, now right ...

  5. tnsping 命令解析

    C:\Users\nowhill>tnsping jljcz Oracle Net 工具(命令)tnsping,是一个OSI会话层的工具,它用来: 1)验证名字解析(name resolutio ...

  6. C++ 11 中的 Lambda 表达式的使用

    Lambda在C#中使用得非常频繁,并且可以使代码变得简洁,优雅. 在C++11 中也加入了 Lambda. 它是这个样子的 [] () {}...  是的三种括号开会的节奏~ [] 的作用是表示La ...

  7. tensorflow学习资料

    tensorflow学习资料 http://www.soku.com/search_video/q_tensorflow?f=1&kb=04112020yv41000__&_rp=1a ...

  8. ubuntu搭建ftp服务器

    (1).首先用命令检查是否安装了vsftpd vsftpd -version  如果未安装用一下命令安装 sudo apt-get install vsftpd 安装完成后,再次输入vsftpd -v ...

  9. linux下字符串的比较方式

    A="$1" B="$2"    #判断字符串是否相等 if [ "$A" = "$B" ];then echo &qu ...

  10. bug-ajax

    ajax 的get 方法参数及url的长度有限制 问题:url的参数只有一个url?id=101001000000000000000001 参数过长,ajax会报错. 解决方法:1,把get换成pos ...