配置rhel 5 使用CentOS的yum站点升级
删除原来的/etc/yum.conf文件和/etc/yum.repo.d目录下rhel-debuginfo.repo文件,命令:
[root@localhost ~]# rm -rf /etc/yum.conf
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# rm -rf rhel-debuginfo.repo
[root@localhost ~]# vi /etc/yum.conf
[main]
cachedir=/var/cache/yum
keepcache=1
debuglevel=2
logfile=/var/log/yum.log
pkgpolicy=newest
distroverpkg=redhat-release
tolerant=1
exactarch=1
obsoletes=1
gpgcheck=1
plugins=1
metadata_expire=1800
# PUT YOUR REPOS HERE OR IN separate files named file.repo
# in /etc/yum.repos.d
[base]
name=centos-5 - Base
baseurl=http://centos.ustc.edu.cn/centos/5/os/i386/
# the other site: http://centos.candishosting.com.cn/centos/5/os/i386/
# you can find more site in: http://www.centos.org/modules/tinycontent/index.php?id=13
enabled=1
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#released updates
[update]
name=CentOS-5 - Updates
baseurl=http://mirror.centos.org/centos/5/updates/i386/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages used/produced in the build but not released
[addons]
name=CentOS-5 - Addons
baseurl=http://mirror.centos.org/centos/5/addons/$basearch/
gpgcheck=1
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#additional packages that may be useful
[extras]
name=CentOS-5 - Extras
baseurl=http://mirror.centos.org/centos/5/extras/$basearch/
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-centos4
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-5 - Plus
baseurl=http://mirror.centos.org/centos/5/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#contrib - packages by Centos Users
[contrib]
name=CentOS-5 - Contrib
baseurl=http://mirror.centos.org/centos/5/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
#packages in testing
[testing]
name=CentOS-5 - Testing
baseurl=http://mirror.centos.org/centos/5/testing/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://centos.ustc.edu.cn/centos/5/os/i386/RPM-GPG-KEY-CentOS-5
安装tftp-server
[root@localhost ~]# yum install tftp-server
安装信息
[root@localhost ~]# rpm -q tftp-server
tftp-server-0.49-2.el5.centos
安装成功
[root@localhost ~]# chkconfig --list tftp 可以查看tftp的状态
tftp 关闭
[root@localhost ~]# chkconfig tftp on 启动tftp
[root@localhost ~]# netstat -au 查看tftp有没有启动
udp 0 0 *:tftp *:* 显示内容有这一行,tftp启动了
[root@localhost xinetd.d]# chkconfig --list tftp
tftp 启用
[root@localhost ~]# chkconfig tftp off 关闭tftp
两种方法netstat -au和chkconfig --list tftp都可以看tftp的状态,chkconfig --list tftp更直观