Centos yum源

---------------------------------本地源

service rpcbind start
#service portmap start
#mount 192.168.1.216:/mnt /mnt
#mount -l

 

 

# ll /mnt/
total 44
drwxr-xr-x  2 root root 4096 Aug 15 10:41 file
-rwxr-xr-x  1 root root 1280 Apr 29 13:56 install.sh
drwxr-xr-x  2 root root 4096 May 25 12:09 iso
drwx------  2 root root 4096 Aug  9 11:21 lost+found
drwxr-xr-x  4 root root 4096 May 10 14:26 nagios
-rwxr-xr-x  1 root root  259 Jun 24 10:22 proxy.sh
drwxr-xr-x  8 root root 4096 May  3 14:29 rhel54_64
drwxr-xr-x  8 root root 4096 May  3 11:04 rhel54_i386
dr-xr-xr-x  9 root root 4096 May 25 14:54 rhel6_32
dr-xr-xr-x 11 root root 4096 May 25 12:08 rhel6_64
dr-xr-xr-x  5 root root 4096 May 18 09:27 xs-tools



#vim /etc/yum.repos.d/myyum.repo

[Cluster]
name=Cluster Directory
baseurl=file:///mnt/rhel54_64/Cluster
enabled=1
gpgcheck=0

[ClusterStorage]
name=ClusterStorage Directory
baseurl=file:///mnt/rhel54_64/ClusterStorage
enabled=1
gpgcheck=0

[Server]
name=Server Directory
baseurl=file:///mnt/rhel54_64/Server
enabled=1
gpgcheck=0

[VT]
name=VT Directory
baseurl=file:///mnt/rhel54_64/VT
enabled=1
gpgcheck=0

 

 

 

 

 

 

================== 为Redhat5配置网易的yum源

 

 

 

网易开源的镜像站 :http://mirrors.163.com/
根据的你的Redhat的版本,选择相应的Centos的源路径
我的OS是x86_64 Redhat5,对应的rpm路径 http://mirrors.163.com/centos/5/os/x86_64/

导入证书(证书的位置 http://mirrors.163.com/centos/)

rpm -import http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5

使用网易的源(参考 http://mirrors.163.com/.help/centos.html 注意备份旧的文件)

cd /etc/yum.repos.d/

wget http://mirrors.163.com/.help/CentOS5-Base-163.repo

修改文件(把所有$releasever替换成5,保存

vim CentOS5-Base-163.repo

更新yum
yum makecache
yum -y update

 

 

 

 

--------------------如何查看CentOS版本方法
有以下命令可以查看:

# lsb_release -a
LSB Version:    :core-3.1-ia32:core-3.1-noarch:graphics-3.1-ia32:graphics-3.1-noarch
Distributor ID: CentOS
Description:    CentOS release 5.4 (Final)
Release:        5.4
Codename:       Final

这个命令适用于所有的linux,包括Redhat、SuSE、Debian等发行版。


root@MyMail ~ # uname
Linux
root@MyMail ~ # uname -r
2.6.18-164.el5

以下二种方法适用于RedHat,CentOS

root@MyMail ~ # cat /etc/redhat-release
CentOS release 5.4 (Final)

 

登录到linux执行rpm -q redhat-release

#rpm -q redhat-release
或CentOS

root@MyMail ~ # rpm -q centos-release
centos-release-5-4.el5.centos.1

 

cat /proc/version

uname -r
uname -a
yum -v

 

其中CentOS-Base.repo记录着网络上的yum源的地址和路径信息等

CentOS-Media.repo记录着可以从本地作为yum源的介质和路径


#yum list installed |  grep yum

yum.noarch                               3.2.22-20.el5.centos          installed
yum-fastestmirror.noarch                 1.1.16-13.el5.centos          installed
yum-metadata-parser.i386                 1.1.2-3.el5.centos            installed
yum-updatesd.noarch                      1:0.9-2.el5                   installed


#yum update --skip-broken


You can try  it like this:

yum update --skip-broken

 

这个是我刚碰到的问题!
yum remove xorg-x11-drv-joystick 这样不行的话在
yum remove  xorg-x11-drivers-7.1-4.1.el5.i386


http://centos.ustc.edu.cn/ 推荐
http://linux.vbird.org/linux_server/0210network-secure.php#update_how


-------------------------------------安装后请按照以下步骤修改CenOS-Base.repo,以后就可以方便的用yum安装软件了.


cd /etc/yum.repos.d

mv CentOS-Base.repo  CentOS-Base.repo.save
wget http://centos.ustc.edu.cn/CentOS-Base.repo


修改以上文件后, 如需要安装gcc, 直接yum install gcc就可以了


为Centos5添加网易163、搜狐的yum源

cd /etc/yum.repos.d/
wget http://mirrors.163.com/.help/CentOS-Base-163.repo

wget http://mirrors.sohu.com/help/CentOS-Base-sohu.repo

yum makecache
yum update


更新现有的包命令是:
yum update


http://www.linuxdiyf.com/viewarticle.php?id=182663
http://forums.fedoraforum.org/showthread.php?t=195001


---------------------------???????????
http://centos.ustc.edu.cn/centos/5/addons/i386/repodata/repomd.xml : [Errno 4] IOError: <urlopen error (101, 'Network is unreachable')>
Trying other mirror.
Error: Cannot retrieve repository metadata (repomd.xml) for repository: addons. Please verify its path and try again

 


------------------------????Another app is currently holding the yum lock; waiting for it to exi


yum命令用ctrl+z命令中断后,再运行yum时,出现:
Existing lock /var/run/yum.pid: another copy is running as pid 3046.
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
Another app is currently holding the yum lock; waiting for it to exit...
NND,说我正在使用yum。输入
rm -f /var/run/yum.pid
/sbin/service yum-updatesd restart

Stopping yum-updatesd:                                     [ OK ]
Starting yum-updatesd:                                     [ OK ]

好了,一切正常了

 

-----------------------------------------???
Loaded plugins: fastestmirror
Repository base is listed more than once in the configuration
Repository updates is listed more than once in the configuration
Repository addons is listed more than once in the configuration
Repository extras is listed more than once in the configuration
Repository centosplus is listed more than once in the configuration
Loading mirror speeds from cached hostfile

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值