CentOS 6.0 下yum的配置

 

CentOS 6.0 下yum的配置

今天装了一个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文件了;在网上找到了几个站点,分别添加进去:

  
  
  
  
  1. [base]  
  2. name=CentOS-$releasever - Base  
  3. baseurl=http://mirrors.163.com/centos/6/os/$basearch/  
  4. gpgcheck=1  
  5. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6  
  6.  
  7. #released updates  
  8. [updates]  
  9. name=CentOS-$releasever - Updates  
  10. baseurl=http://mirrors.163.com/centos/6/updates/$basearch/  
  11. gpgcheck=1  
  12. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6  
  13.  
  14. #packages used/produced in the build but not released  
  15. #[addons]  
  16. #name=CentOS-$releasever - Addons  
  17. #baseurl=http://mirrors.163.com/centos/$releasever/addons/$basearch/  
  18. #gpgcheck=1  
  19. #gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6  
  20. #additional packages that may be useful  
  21. [extras]  
  22. name=CentOS-$releasever - Extras  
  23. baseurl=http://mirrors.163.com/centos/6/extras/$basearch/  
  24. gpgcheck=1  
  25. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6  
  26. #additional packages that extend functionality of existing packages  
  27. [centosplus]  
  28. name=CentOS-$releasever - Plus  
  29. baseurl=http://mirrors.163.com/centos/6/centosplus/$basearch/  
  30. gpgcheck=1  
  31. enabled=0  
  32. gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-6 

现在立即来看看:

yum clean all

yum search gcc

显示如下:

  
  
  
  
  1. Loaded plugins: fastestmirror  
  2. Loading mirror speeds from cached hostfile  
  3. http://mirrors.163.com/centos/6/os/i386/repodata/repomd.xml: [Errno 14] PYCURL ERROR 6 - "" 
  4. Trying other mirror.  
  5. 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

显示如下:

 

  
  
  
  
  1. Loaded plugins: fastestmirror  
  2. Determining fastest mirrors  
  3. base                                                     | 3.7 kB     00:00       
  4. base/filelists_db                                                                                     | 4.9 MB     00:27       
  5. 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       
  6. base/other_db                                            | 1.9 MB     00:10       
  7. base/group_gz                                            | 209 kB     00:00       
  8. extras                                                   | 3.5 kB     00:00       
  9. extras/filelists_db                                      | 3.6 kB     00:00       
  10. extras/prestodelta                                       |  673 B     00:00       
  11. extras/primary_db                                        | 9.1 kB     00:00       
  12. extras/other_db                                          | 4.0 kB     00:00       
  13. updates                                                  | 3.5 kB     00:00       
  14. updates/filelists_db                                     | 2.4 MB     00:11       
  15. updates/prestodelta                                      | 318 kB     00:01       
  16. updates/primary_db                                                                                    | 3.3 MB     00:18       
  17. updates/other_db                                                                                      | 266 kB     00:01       
  18. Metadata Cache Created  
  19. [root@CentOS-localhost yum.repos.d]# yum search gcc  
  20. Loaded plugins: fastestmirror  
  21. Loading mirror speeds from cached hostfile  
  22. ======================================================= Matched: gcc ========================================================  
  23. compat-libgcc-296.i686 : Compatibility 2.96-RH libgcc library  
  24. gcc-gnat.i686 : Ada 95 support for GCC  
  25. gcc-objc.i686 : Objective-C support for GCC  
  26. gcc-objc++.i686 : Objective-C++ support for GCC  
  27. libgcc.i686 : GCC version 4.4 shared support library  
  28. compat-gcc-34.i686 : Compatibility GNU Compiler Collection  
  29. compat-gcc-34-c++.i686 : C++ support for compatibility compiler  
  30. compat-gcc-34-g77.i686 : Fortran 77 support for compatibility compiler  
  31. gcc.i686 : Various compilers (C, C++, Objective-C, Java, ...)  
  32. gcc-c++.i686 : C++ support for GCC  
  33. gcc-gfortran.i686 : Fortran support  
  34. gcc-java.i686 : Java support for GCC  
  35. libgcj-devel.i686 : Libraries for Java development using GCC  
  36. libgomp.i686 : GCC OpenMP v3.0 shared support library  
  37. libmudflap.i686 : GCC mudflap shared support library  
  38. libmudflap-devel.i686 : GCC mudflap support  
  39. compat-libgfortran-41.i686 : Compatibility Fortran 95 runtime library version 4.1.2  
  40. compat-libstdc++-33.i686 : Compatibility standard C++ libraries  
  41. libgcj.i686 : Java runtime library for gcc  
  42. libgcj-src.i686 : Java library sources from GCC4 preview  
  43. libgnat.i686 : GNU Ada 95 runtime shared libraries  
  44. libgnat-devel.i686 : GNU Ada 95 libraries  
  45. libstdc++.i686 : GNU Standard C++ Library  
  46. compat-glibc.i686 : Compatibility C library  
  47. compat-libf2c-34.i686 : Fortran 77 compatibility runtime  
  48. compat-libstdc++-296.i686 : Compatibility 2.96-RH standard C++ libraries  
  49. compat-libtermcap.i686 : A basic system library for accessing the termcap database 
  50. cpp.i686 : The C Preprocessor  
  51. lapack.i686 : Numerical linear algebra package libraries  
  52. libgfortran.i686 : Fortran runtime  
  53. libobjc.i686 : Objective-C runtime  
  54. libstdc++-devel.i686 : Header files and libraries for C++ development  
  55. libstdc++-docs.i686 : Documentation for the GNU standard C++ library  
  56. mcpp.i686 : Alternative C/C++ preprocessor 

我靠,行了。

你可能感兴趣的:(centos,6.0,下yum的配置)