Java在linux系统的部署(2): 系统环境的安装——更换免费的Yum源(转载)
2016-08-26 15:00
711 查看
更换redhat免费源的方式从网上找了一个,效果还不错,原网址:http://blog.chinaunix.net/uid-24727220-id-176948.html
由于,redhat企业版yum为收费项目,所以更换免费的源,这样在架设服务器的时候缺少某些组件可以用yum来进行添加,方便快捷,其实yum的速度没有太慢的,下面我将为大家介绍如何快速的修改yum源。
一、删除原yum所有组件
rpm -qa | grep yum | xargs rpm -e --nodeps #这条代码将删除redhat自带的yum
二、下载yum组件 yum.rar
rpm包已经有了,自己下载解压
[root@localhost yum]# ll
total 1108
-rw-r--r-- 1 root root 34394 Feb 2509:46 python-iniparse-0.2.3-4.el5.noarch.rpm
-rw-r--r-- 1 root root 1026405 Feb 2509:45 yum-3.2.22-26.el5.centos.noarch.rpm
-rw-r--r-- 1 root root 19145 Feb 2509:46 yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
-rw-r--r-- 1 root root 26053 Feb 2509:41 yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
三、下面将要安装着四个软件包,切记按照我的安装顺序来,否则会出现报错,切记~
cd /tools/yum
rpm -ivhpython-iniparse-0.2.3-4.el5.noarch.rpm
rpm -ivhyum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
rpm -ivhyum-3.2.22-26.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
四、下面下载yum的配置文件CentOS-Base.rar
上面的包是为redhat5.4准备的,如果你用不了的话,就把下面的代码写到CentOS-Base.repo中保存在/etc/yum.repos.d/
#CentOS-Base.repo
# # Thisfile uses a new mirrorlist system developed by Lance Davis for CentOS.
# Themirror system uses the connecting IP address of the client and the
# updatestatus of each mirror to pick mirrors that are updated to and
#geographically close to the client. You should use this for CentOS updates
# unlessyou are manually picking other mirrors.
#
# If themirrorlist= does not work for you, as a fall back you can try the
# remarkedout baseurl= line instead.
#
# [base]
name=CentOS-$releasever- Base
baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#releasedupdates
[updates]
name=CentOS-$releasever- Updates
baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#packagesused/produced in the build but not released
[addons]
name=CentOS-$releasever- Addons
baseurl=http://centos.ustc.edu.cn/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#additionalpackages that may be useful
[extras]
name=CentOS-$releasever- Extras
baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#additionalpackages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever- Plus
baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
把这个文件放在 /etc/yum.repos.d/
大功告成,yum已经更新为不用花钱的啦
注:如何觉着下载这么多不方便,可以下下载 yum.rar 这个包,放在/tools/下面
然后执行“sh/tools/yum/yum_stat.sh" 即可
由于,redhat企业版yum为收费项目,所以更换免费的源,这样在架设服务器的时候缺少某些组件可以用yum来进行添加,方便快捷,其实yum的速度没有太慢的,下面我将为大家介绍如何快速的修改yum源。
一、删除原yum所有组件
rpm -qa | grep yum | xargs rpm -e --nodeps #这条代码将删除redhat自带的yum
二、下载yum组件 yum.rar
rpm包已经有了,自己下载解压
[root@localhost yum]# ll
total 1108
-rw-r--r-- 1 root root 34394 Feb 2509:46 python-iniparse-0.2.3-4.el5.noarch.rpm
-rw-r--r-- 1 root root 1026405 Feb 2509:45 yum-3.2.22-26.el5.centos.noarch.rpm
-rw-r--r-- 1 root root 19145 Feb 2509:46 yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
-rw-r--r-- 1 root root 26053 Feb 2509:41 yum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
三、下面将要安装着四个软件包,切记按照我的安装顺序来,否则会出现报错,切记~
cd /tools/yum
rpm -ivhpython-iniparse-0.2.3-4.el5.noarch.rpm
rpm -ivhyum-metadata-parser-1.1.2-3.el5.centos.i386.rpm
rpm -ivhyum-3.2.22-26.el5.centos.noarch.rpm yum-fastestmirror-1.1.16-14.el5.centos.1.noarch.rpm
四、下面下载yum的配置文件CentOS-Base.rar
上面的包是为redhat5.4准备的,如果你用不了的话,就把下面的代码写到CentOS-Base.repo中保存在/etc/yum.repos.d/
#CentOS-Base.repo
# # Thisfile uses a new mirrorlist system developed by Lance Davis for CentOS.
# Themirror system uses the connecting IP address of the client and the
# updatestatus of each mirror to pick mirrors that are updated to and
#geographically close to the client. You should use this for CentOS updates
# unlessyou are manually picking other mirrors.
#
# If themirrorlist= does not work for you, as a fall back you can try the
# remarkedout baseurl= line instead.
#
# [base]
name=CentOS-$releasever- Base
baseurl=http://centos.ustc.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#releasedupdates
[updates]
name=CentOS-$releasever- Updates
baseurl=http://centos.ustc.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#packagesused/produced in the build but not released
[addons]
name=CentOS-$releasever- Addons
baseurl=http://centos.ustc.edu.cn/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#additionalpackages that may be useful
[extras]
name=CentOS-$releasever- Extras
baseurl=http://centos.ustc.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
#additionalpackages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever- Plus
baseurl=http://centos.ustc.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=1enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/RPM-GPG-KEY-CentOS-5
把这个文件放在 /etc/yum.repos.d/
大功告成,yum已经更新为不用花钱的啦
注:如何觉着下载这么多不方便,可以下下载 yum.rar 这个包,放在/tools/下面
然后执行“sh/tools/yum/yum_stat.sh" 即可
相关文章推荐
- Linux 项目部署、系统常用命令、java环境安装、tomcat安装部署。
- Java在linux系统的部署(3): 系统环境的安装——安装VirtualBox安装增强功能
- 针对中科院汉语分词系统nlpir中的中文分词部分在java环境的部署(Linux和windows)(获取关键词)
- [Linux]在Linux上部署Java开发环境笔记(五):Linux中安装MySQL
- Linux 环境下部署Hadoop 2.x,建议尝试64位系统下进行本地编译的安装方式
- 更换默认启动系统的方法,适合于安装了windows 和 linux双系统的用户(转载)
- [Linux]在Linux上部署Java开发环境笔记(二):Linux中安装JDK6.0
- [Linux]在Linux上部署Java开发环境笔记(三):Linux中安装Tomcat6.0
- [Linux]在Linux上部署Java开发环境笔记(一):虚拟机安装Linux,配置Linux和主机XP能互Ping成功
- 【转载】Linux系统下源代码包方式安装PHP开发环境
- OpenStack环境部署学习笔记——安装linux系统
- Linux环境java项目安装部署
- Linux环境下安装部署MySQL数据库系统实例
- Linux环境下安装部署AWStats日志分析系统
- Linux 环境下部署Hadoop 2.x,建议尝试64位系统下进行本地编译的安装方式
- Linux(CentOS)系统安装配置Java环境
- Windows、Linux系统安装JDK配置Java环境变量
- Windows、Linux系统安装JDK配置Java环境变量
- Windows、Linux系统安装JDK配置Java环境变量
- Linux环境下安装部署AWStats日志分析系统实例