今天装了一个CentOS6.0的系统,安装在虚拟机VM-EXS 下面,安装完成后。我立马想要进行软件安装和升级,当然首选大名鼎鼎的YUM,但可为一波三折啊!
1、首先当然是配置网络了,IP、网管、DNS,我都配置好了;我ping了一下网管正常,我又ping了一下www.baidu.com,结果显示:
ping: Unknow www.baidu.com;
哎,该死,DNS的配置了?立马到/etc/resolv.conf文件查看,我配置了三个DNS,难道都不管用?ping一下第一个DNS,能通啊,怎么戏弄我啊?反复几次还是不行;把第一个干掉不要,再试;百度终于通了,我真的背啊,被我碰到了!
2、现在进行yum的配置了,开始用默认试试;不行!一直报错!看来要用国内的站点了;好了只用改/etc/yum.repos.d/CentOS-Base.repo文件了;在网上找到了几个站点,分别添加进去:
- [base]
- name=CentOS-$releasever - Base
- baseurl=http://mirrors.163.com/centos/6/os/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
- #released updates
- [updates]
- name=CentOS-$releasever - Updates
- baseurl=http://mirrors.163.com/centos/6/updates/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
- #packages used/produced in the build but not released
- #[addons]
- #name=CentOS-$releasever - Addons
- #baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/
- #gpgcheck=1
- #gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
- #additional packages that may be useful
- [extras]
- name=CentOS-$releasever - Extras
- baseurl=http://mirrors.163.com/centos/6/extras/$basearch/
- gpgcheck=1
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
- #additional packages that extend functionality of existing packages
- [centosplus]
- name=CentOS-$releasever - Plus
- baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/
- gpgcheck=1
- enabled=0
- gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6
现在立即来看看:
yum clean all
yum search gcc
显示如下:
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- http://mirrors.163.com/centos/6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - ""
- Trying other mirror.
- Error: Cannot retrieve repository metadata (repomd.xml) for repository: base. Please verify its path and try again
why,这把我困住了!
最后再来:
yum clean all
yum makecache
yum search gcc
显示如下:
- Loaded plugins: fastestmirror
- Determining fastest mirrors
- base | 3.7 kB 00:00
- base/filelists_db | 4.9 MB 00:27
- base/primary_db (55%) 23% [======== ] 117 kB/s | 740 kB 00:24 ETA base/primary_db (55%) 24% [========- base/primary_db (56%) 26% [========= base/primary_db | 3.5 MB 00:24
- base/other_db | 1.9 MB 00:10
- base/group_gz | 209 kB 00:00
- extras | 3.5 kB 00:00
- extras/filelists_db | 3.6 kB 00:00
- extras/prestodelta | 673 B 00:00
- extras/primary_db | 9.1 kB 00:00
- extras/other_db | 4.0 kB 00:00
- updates | 3.5 kB 00:00
- updates/filelists_db | 2.4 MB 00:11
- updates/prestodelta | 318 kB 00:01
- updates/primary_db | 3.3 MB 00:18
- updates/other_db | 266 kB 00:01
- Metadata Cache Created
- [root@CentOS-localhost yum.repos.d]# yum search gcc
- Loaded plugins: fastestmirror
- Loading mirror speeds from cached hostfile
- ======================================================= Matched: gcc ========================================================
- compat-libgcc-296.i686 : Compatibility 2.96-RH libgcc library
- gcc-gnat.i686 : Ada 95 support for GCC
- gcc-objc.i686 : Objective-C support for GCC
- gcc-objc++.i686 : Objective-C++ support for GCC
- libgcc.i686 : GCC version 4.4 shared support library
- compat-gcc-34.i686 : Compatibility GNU Compiler Collection
- compat-gcc-34-c++.i686 : C++ support for compatibility compiler
- compat-gcc-34-g77.i686 : Fortran 77 support for compatibility compiler
- gcc.i686 : Various compilers (C, C++, Objective-C, Java, ...)
- gcc-c++.i686 : C++ support for GCC
- gcc-gfortran.i686 : Fortran support
- gcc-java.i686 : Java support for GCC
- libgcj-devel.i686 : Libraries for Java development using GCC
- libgomp.i686 : GCC OpenMP v3.0 shared support library
- libmudflap.i686 : GCC mudflap shared support library
- libmudflap-devel.i686 : GCC mudflap support
- compat-libgfortran-41.i686 : Compatibility Fortran 95 runtime library version 4.1.2
- compat-libstdc++-33.i686 : Compatibility standard C++ libraries
- libgcj.i686 : Java runtime library for gcc
- libgcj-src.i686 : Java library sources from GCC4 preview
- libgnat.i686 : GNU Ada 95 runtime shared libraries
- libgnat-devel.i686 : GNU Ada 95 libraries
- libstdc++.i686 : GNU Standard C++ Library
- compat-glibc.i686 : Compatibility C library
- compat-libf2c-34.i686 : Fortran 77 compatibility runtime
- compat-libstdc++-296.i686 : Compatibility 2.96-RH standard C++ libraries
- compat-libtermcap.i686 : A basic system library for accessing the termcap database
- cpp.i686 : The C Preprocessor
- lapack.i686 : Numerical linear algebra package libraries
- libgfortran.i686 : Fortran runtime
- libobjc.i686 : Objective-C runtime
- libstdc++-devel.i686 : Header files and libraries for C++ development
- libstdc++-docs.i686 : Documentation for the GNU standard C++ library
- mcpp.i686 : Alternative C/C++ preprocessor
我靠,行了。