在Linux系统中系统的升级靠的是源地址的文件更新,与Windows不同的是Linux的系统更新源是可以随自己意愿更该的,这点值得 Windows学习.不过我的默认安装完了之后更新很慢,后来狂google,按照其方法在/etc/yum.conf里替换了一个国内的 ftp.sjtu.edu.cn,但是很慢很慢.例如http://centos.alt.ru/repository/ 这些都是.当然并不是仅仅CentOS或者RH之类有更新源,像Ubuntu系列也会有.不过在此我仅仅以CentOS列举.毕竟他是比较出色的服务器系统,而更重要的是我现在正在应用.
最 后发现这只是添加源的一种方法,而且现在网上基本上就说的这种的,其实centos5.1还支持另外一种,在 /etc/yum.repos.d里建上n个.repo的yum源文件,我从centos的官方镜像列表里发现了中国科大。下面给出我的文件,格式参照默 认的yum源,把他们拷贝到/etc/yum.repos.d里起个.repo的名就能用了,不用改/etc/yum.conf。忘了还有一步,记得先导 入key,我的文件开头有。我用这个update,400M,虚拟机运行的,25分钟就完了。
源都添加完了之后,再装个插件,yum install yum-fastestmirror -y,这个会自动选择快的那个源。
如果我在那个目录里放了很多源,怎么知道当前用的是那个呢?如果你没有改yum.conf,那么看/var/cache/yum/文件夹里的一个time开头的文件,就知道了。
#mirrors-shlug-org.repo
#
# rpm –import http://mirrors.shlug.org/centos/RPM-GPG-KEY-CentOS-5
#
# This file uses a new mirrorlist system developed by Lance Davis for CentOS.
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are 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 a fall back you can try the
# remarked out baseurl= line instead.
#
#
继续阅读 →