CentOS5安装后常见问题解决方案

教育网用户怎么设置更新源?

用163的更新源吧:

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

用了163更新源,yum install时出现“GPG key retrieval failed: [Errno 4] IOError: <urlopen error (111, 'Connection refused')>”咋办?

那是你的教育网不能连国外网站,获取不了官网镜像上的GPG公钥。解决方法:

编辑/etc/yum.repos.d/CentOS5-Base-163.repo

把其中的“gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-5”

改为“gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-5”

SSH在机子里可以连接,在机子外不能?

确认是不是防火墙iptables挡住了吧!解决办法:

iptables -I INPUT 1 -p tcp --dport 22 -j ACCEPT
iptables-save
service iptables save

好啦,差不多就这么多,最后附一个dev环境的给力批量安装脚本。保存为xxoo.sh使用。

#! /bin/bash
for packages in patch make gcc gcc-c++ gcc-g77 flex bison file libtool libtool-libs autoconf kernel-devel libjpeg libjpeg-devel libpng libpng-devel libpng10 libpng10-devel gd gd-devel freetype freetype-devel libxml2 libxml2-devel zlib zlib-devel glib2 glib2-devel bzip2 bzip2-devel libevent libevent-devel ncurses ncurses-devel curl curl-devel e2fsprogs e2fsprogs-devel krb5 krb5-devel libidn libidn-devel openssl openssl-devel fonts-chinese gettext gettext-devel ncurses-devel gmp-devel pspell-devel unzip screen;
do yum -y install $packages; done

2 comments

  1. Xiaoxia says:

    按照我目前在教育网的做法,是使用代理,
    export http_proxy=scut.tk:1998
    yum update

    1. creke says:

      感谢提供!
      PS:哪里的服务器,打通内外了?

Leave a comment