centos 安装或更新最新版本软件包(git python etc)的方法 SCL IUS
使用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的更多相关文章
- Ubuntu18.04 LTS 安装部署golang最新版本1.10
1 步骤 //1 直接安装golang-go 目前最新版本是1.10 sudo apt-get install golang-go //2 向/etc/profile追加以下代码 sudo vim / ...
- 在 CentOS 6.x 上安装最新版本的 git
在 CentOS 的默认仓库中有git,所以最简单的方法是: $ sudo yum install git 这种方法虽然简单,但是一般仓库里的版本更新不及时,比如 CentOS 仓库中的 git 最新 ...
- centos7 安装docker-ce ,最新版本docker,docker阿里云加速
直接用yum install docker -y安装的docker版本为1.12,但是docker发展很快,现在都17.06.2了.docker-ce是指docker的社区版 卸载老版本的 docke ...
- Centos安装JIRA 7.13版本(自己在官方下载最新版)以及破解
后半部分流程来自:https://www.cnblogs.com/kaola8023/p/6950481.html 安装准备(切记将许可证号备份) 1.准备mysql需要5.6以及以上的版本(注意:建 ...
- CentOS安装JAVA后JAVA版本不对的问题
今天用CentOS安装JDK,发觉在安装完成后,输入java命令来验证是否安装成功时,出现 Usage: gij [OPTION] ... CLASS [ARGS] ... to i ...
- 安装node的最新版本
前段时间小试了一下node 这段时间就差不多忘了 恩 然后现在自己想去回顾一下,然后流程想再好好弄一遍 争取掌握node 因为我现在已经安装了 一个node版本 那我想安装最新版本吧 首先,看看你的n ...
- CentOS 安装 git2.x.x 版本
方法一 源码方式安装 第一步:卸载旧的git版本. $ yum remove git 第二步:下载git $ wget --no-check-certificate https://www.kerne ...
- CENTOS 升级Nodejs 到最新版本
1.去官网下载和自己系统匹配的文件: 英文网址:https://nodejs.org/en/download/ 中文网址:http://nodejs.cn/download/ 通过 uname -a ...
- Centos安装(更新)git(亲测有效)
Centos 6.5默认安装的是git 1.7.X 版本,使用过程中会有一些奇怪的问题,对于用户名.密码支持不是很友好.将Centos6.5上的git更新到2.0.5,方法如下: 1.安装编译git时 ...
随机推荐
- python第一个爬虫的例子抓取数据到mysql,实测有数据
python3.5 先安装库或者扩展 1 requests第三方扩展库 pip3 install requests 2 pymysql pip3 install pymysql 3 lxml pip3 ...
- leetcode500
public class Solution { public string[] FindWords(string[] words) { var list1 = new List<char> ...
- Activity服务类-2 EngineService服务类
一共提供了9个接口 //获取RepositoryServiceRepositoryService getRepositoryService();//获取RuntimeServiceRuntimeSer ...
- DOM0和D0M2级事件
1.DOM0级事件:on+事件类型 1.1.在html行内直接绑定, 1.2.在js中绑定 A.DOM0级事件和DOM0级事件相互之间会覆盖,比如以下代码执行后弹出jsDOM0级,js中绑定的事件 覆 ...
- caffe openpose/Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields配置(转)
Realtime Multi-Person 2D Pose Estimation using Part Affinity Fields 是CVPR2017的一篇论文,作者称是世界上第一个基于深度学习的 ...
- YAML描述与Python的对应关系
YAML是"YAML Ain't a Markup Language"的首字母缩写,其语法简单,结构通过空格来展示,(列表)项目使用"-"来代表,(字典)键值对 ...
- seleniumIDE的实践
浏览器:1.Firefox setup35.0.12.安装完成后设置菜单栏---安装完浏览器,鼠标定位在浏览器的状态栏,然后点击鼠标右键,点击勾选菜单栏,这时候就有菜单栏出现了 3.关闭浏览器自动更新 ...
- go语言中make和new的区别
make用于内建类型(map.slice 和channel)的内存分配.new用于各种类型的内存分配. 内建函数new本质上说跟其他语言中的同名函数功能一样:new(T)分配了零值填充的T类型的内存空 ...
- php去除bom
<?php /*检测并清除BOM*/ if(isset($_GET['dir'])){ $basedir=$_GET['dir']; }else{ $basedir = '.'; } $auto ...
- hdoj1010 奇偶剪枝+DFS
Tempter of the Bone Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Othe ...