首页 > 系统相关 >RedHat5.8更改yum源

RedHat5.8更改yum源

时间:2022-10-12 12:36:14浏览次数:88  
标签:RedHat5.8 http CentOS centos 更改 repo yum root 163

RedHat5.8更改yum源







[root@localhost ~]# ipvsadm
-bash: ipvsadm: command not found
[root@localhost ~]# yum install ipvsadm
Loaded plugins: katello, product-id, security,subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
No package ipvsadm available.
Nothing to do



[root@localhost ~]# cat /proc/version
Linux version 2.6.18-308.el5([email protected]) (gcc version 4.1.2 20080704 (Red Hat4.1.2-50)) #1 SMP Fri Jan 27 17:21:15 EST 2012
[root@localhost~]# wget http://mirrors.163.com/.help/CentOS5-Base-163.repo
--2015-07-23 05:41:26-- http://mirrors.163.com/.help/CentOS5-Base-163.repo
Resolving mirrors.163.com... 123.58.173.186,123.58.173.185
Connecting to mirrors.163.com|123.58.173.186|:80...connected.
HTTP request sent, awaiting response... 200 OK
Length: 2341 (2.3K) [application/octet-stream]
Saving to: `CentOS5-Base-163.repo'

100%[=============================================================>]2,341 --.-K/s in 0s

2015-07-23 05:41:26 (141 MB/s) -`CentOS5-Base-163.repo' saved [2341/2341]

[root@localhost ~]# ll
total 92
-rw------- 1 root root 3522 Jan 26 10:09 anaconda-ks.cfg
-rw-r--r-- 1 root root 2341 Sep 18 2014 CentOS5-Base-163.repo
drwxr-xr-x 2 root root 4096 Jan 26 02:52 Desktop
-rw-r--r-- 1 root root 54276 Jan 26 10:09install.log
-rw-r--r-- 1 root root 5860 Jan 26 10:08 install.log.syslog

[root@localhost ~]# ll /etc/yum.repos.d/
total 12
-rw-r--r-- 1 root root 190 Jul 23 05:26 redhat.repo
-rw-r--r-- 1 root root 254 Jan 24 2012 rhel-debuginfo.repo
[root@localhost~]# mv CentOS5-Base-163.repo /etc/yum.repos.d/
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ll
[root@localhost yum.repos.d]# cpCentOS5-Base-163.repo CentOS5-Base-163.repo.bak01
[root@localhost yum.repos.d]# viCentOS5-Base-163.repo



[root@localhost yum.repos.d]#

把$releasever替换成5
[[email protected]]# cat CentOS5-Base-163.repo
# CentOS-Base.repo
#
# The mirror system uses the connecting IP addressof the client and the
# update status of each mirror to pick mirrors thatare 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 afall back you can try the
# remarked out baseurl= line instead.
#
#

[base]
name=CentOS-5
baseurl=http://mirrors.163.com/centos/5/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#released updates
[updates]
name=CentOS-5 - Updates - 163.com
baseurl=http://mirrors.163.com/centos/5/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#packages used/produced in the build but notreleased
[addons]
name=CentOS-5 - Addons - 163.com
baseurl=http://mirrors.163.com/centos/5/addons/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=addons
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that may be useful
[extras]
name=CentOS-5 - Extras - 163.com
baseurl=http://mirrors.163.com/centos/5/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#additional packages that extend functionality ofexisting packages
[centosplus]
name=CentOS-5 - Plus - 163.com
baseurl=http://mirrors.163.com/centos/5/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5

#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/5/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=5&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5
[root@localhost yum.repos.d]#




#清除原有缓存
[[email protected]]# yum clean all
#获取yum列表
[[email protected]]# yum makecache


到此也就OK了;

 

参考文章:

​http://www.linuxidc.com/Linux/2013-07/87383.htm​

​http://www.lmyw.net.cn/?p=416​

 

 

 

 

 

 

标签:RedHat5.8,http,CentOS,centos,更改,repo,yum,root,163
From: https://blog.51cto.com/u_15739274/5749382

相关文章

  • 更改注册表之后迅速使改动生效的方法
    主要就是一个cmd命令,重启资源管理器rem@echoofftaskkill/f/imexplorer.exeexplorer.exeahk代码: RunWaitMany("(rem@echoofftaskkill/f/imexplorer.exe......
  • centos7出现yum之类的问题的时候可能是加入的一些源导致的问题最佳的解决方案就是-loo
    //傻逼的我胡搞出现不知道添加什么软件源到/etc/yum.repo中结果出现了一堆错-搜了很长时间没解决-算了-返璞归真(回到初始的状态)吧,看了一下别人的阿里云的服务器中初始的时候......
  • centos6 yum源
     1、备份系统旧配置文件mv/etc/yum.repos.d/CentOS-Base.repo/etc/yum.repos.d/CentOS-Base.repo.backup2、下载源配置CentOS6wget-O/etc/yum.repos.d/CentOS-Bas......
  • 【教程】更改系统自带的桌面文件夹默认位置为非系统盘,不怕重装后数据丢失
    电脑上的许多问题都可以通过重装系统解决,不过对许多人来说麻烦的不是装系统,而是重装前后的数据备份还原。特别是不少朋友习惯把所有东西都放在桌面上,如果平时不注意备份的话......
  • 使用yum管理软件包
    概述:   yum(YellowdogUpdaterModified),(二进制包)已经编译、直接安装、无法修改、简单快捷,自动检查依赖性并一次安装所有依赖性的软件包,无需繁琐的一次次安装。使用yu......
  • 安装 LAMP 环境(yum 版本) shell脚本
    #!/bin/bash#安装LAMP环境(yum版本)#本脚本适用于RHEL7(RHEL6中数据库为mysql)yummakecache&>/dev/nullnum=$(yumrepolist|awk'/repolist/{print$2......
  • CentOS配置本地yum源
    title:CentOS配置本地yum源categories:[CentOS]tags:CentOStop:20CentOS配置本地yum源为了方便测试与开发,常常需要在虚拟机上安装各种开发环境,如果没有yum源......
  • 97、配置yum源仓库服务器
    (服务端(双(外,内)网卡)——客户端(内网))YUM主要用于自动安装、升级rpm软件包,它能自动查找并解决rpm包之间的依赖关系。要成功的使用YUM工具安装更新软件或系统,就需要有......
  • SAP GUI 更改登录界面显示信息
    0x01简单说明在SAPGUI的登录界面,左部输入登录信息如客户端、用户名、密码等,右部空余部分可维护一些登录信息文本,如登录的产品、客户端说明及注意事项等,此项操作详见SAP......
  • centos yum安装docker 步骤
    1、如果之前安装过docker需要进行卸载yumremovedocker2、安装必要的软件包,yum-util提供yum-config-manager功能yuminstall3、安装docker的devicemapper驱动依赖的软件包......