Centos 6.3 安装,软件有何大一部分要配置 yum 源,搭建yum 可以省去自己 安装依赖的烦恼。

同时还可以实时更新软件。

实验平台:

     vm9.0

对于虚拟机,要用NAT, 做为网络标识,   

或者你用的是服务器网卡,那就一定要更新软件源时连接外网了。

 

 

ip:dhcp 

 

对于连接外网此步骤可省略

有时你可能找不到,host 或者dns ,可以在 /etc/resolv.conf

 

 

这里要编辑好域名。以及nameserver:

named
DNS
(BIND)服务器守护进程。

网络配置好之后。方可搭建yum

 

编辑 /etc/yum.repos.d/CentOS-Base.repo

 

CentOS6.3 x86_64 yum 源

cat CentOS-Base.repo
# CentOS-Base.repo
#
# 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.
#
#

[base]
name=CentOS-6.3 - Base
#mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/6.3/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#released updates
[updates]
name=CentOS-6.3 - Updates
#mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/6.3/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

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

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-6.3 - Plus
#mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=$basearch&repo=centosplus
baseurl=http://mirrors.163.com/centos/6.3/centosplus/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

#contrib - packages by Centos Users
[contrib]
name=CentOS-6.3 - Contrib
#mirrorlist=http://mirrorlist.centos.org/?release=6.3&arch=$basearch&repo=contrib
baseurl=http://mirrors.163.com/centos/6.3/contrib/$basearch/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6

安装步骤:

 

1. 下载repo文件
    下载地址:http://mirrors.163.com/.help/CentOS6-Base-163.repo
 
2. 备份并替换系统的repo文件
[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost ~]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost ~]# mv /root/CentOS6-Base-163.repo CentOS-Base.repo
 
3. 执行yum源更新
[root@localhost ~]# yum clean all
[root@localhost ~]# yum makecache
[root@localhost ~]# yum update
 
4. 到此已结束,用yum安装一下文件,看是否OK
[root@localhost ~]# yum install vim*
 
5. 安装centos常用的软件包及工具
    常见压缩工具 zip unzip bzip2
[root@localhost ~]# yum -y install unzip zip bzip2 bzip2-devel
  gcc gcc++编译器
[root@localhost ~]# yum install gcc gcc-c++ -y
  cmake编译器
[root@localhost ~]# yum install cmake make -y
  图片资源
[root@localhost ~]# yum -y install gd libjpeg libjpeg-devel libpng libpng-devel freetype-devel
  其它常用资源包工具
[root@localhost ~]# yum -y install autoconf bison automake zlib* fiex* libxml* ncurses-devel libmcrypt* libtool-ltdl-devel*