虽然是一些很简单的内容,但对于 linux 初学者来人说,还是很有用的,软件环境 CentOS6.3 写一些简单易学 的教程,小风博客欢迎大家光临!今天要写的内容是修改yum来源为本地,用系统光盘做yum来源 来安装gcc,简单的例子摆脱RPM安装依赖关系 关于yum
Yum(全称为 Yellow dog Updater, Modified)是一个在Fedora和RedHat以及SUSE、CentOS中的Shell前端软 件包管理器。基於RPM包管理,能够从指定的服务器自动下载RPM包并且安装,可以自动处理依赖性关系, 并且一次安装所有依赖的软件包,无须繁琐地一次次下载、安装。 修改软件包来源
默认软件包来源是从网络上下载进行安装的,现在我们要做的是修改来源为本地进行安装
接下来挂载光盘到系统,我在根目录下建立过ISO文件夹,所以直接挂到ISO上 从图中可以看到/dev/cdrom已经挂载到了iso目录。 [root@CentOS6-EN /]# mount /dev/corom /iso
2. 写一个yum配置文件
yum的配置文件目录为:/etc/yum.repos.d/ 这里我们先备份好系统默认的四个文件:
用mv命令来备份下 [root@CentOS6-EN yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak [root@CentOS6-EN yum.repos.d]# mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak [root@CentOS6-EN yum.repos.d]# mv CentOS-Media.repo CentOS-Media.repo.bak [root@CentOS6-EN yum.repos.d]# mv CentOS-Vault.repo CentOS-Vault.repo.bak
新建一个文件,名为:xiaofeng.repo 内容如下: [xiaofeng] name=xiaofeng baseurl=file:///mnt \\查找路径 enable=1 \\是否检查GPG-KEY,0为不检查,1为检查 gpgchack=0 \\是否启用yum源,0为不启用,1为启用 [root@CentOS6-EN yum.repos.d]# vim xiaofeng.repo
3.安装软件(gcc等) 查找gcc: yum search gcc
安装gcc:
yum –y install gcc
[root@CentOS6-EN /]# yum search gcc Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile xiaofeng | 4.0 kB 00:00 ... ================================== N/S Matched: gcc =================================== compat-libgcc-296.i686 : Compatibility 2.96-RH libgcc library gcc-c++.i686 : C++ support for GCC gcc-gnat.i686 : Ada 95 support for GCC gcc-java.i686 : Java 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-gfortran.i686 : Fortran support libgcj.i686 : Java runtime library for gcc libgcj-devel.i686 : Libraries for Java development using GCC libgcj-src.i686 : Java library sources from GCC4 preview libgomp.i686 : GCC OpenMP v3.0 shared support library libmudflap.i686 : GCC mudflap shared support library libmudflap-devel.i686 : GCC mudflap support
Name and summary matches only, use "search all" for everything. [root@CentOS6-EN /]# yum -y gcc Loaded plugins: fastestmirror, security No such command: gcc. Please use /usr/bin/yum --help [root@CentOS6-EN /]# yum -y install gcc Loaded plugins: fastestmirror, security Loading mirror speeds from cached hostfile Setting up Install Process Resolving Dependencies --> Running transaction check ---> Package gcc.i686 0:4.4.6-4.el6 will be installed --> Processing Dependency: cpp = 4.4.6-4.el6 for package: gcc-4.4.6-4.el6.i686 --> Processing Dependency: glibc-devel >= 2.2.90-12 for package: gcc-4.4.6-4.el6.i686 --> Processing Dependency: cloog-ppl >= 0.15 for package: gcc-4.4.6-4.el6.i686 --> Running transaction check ---> Package cloog-ppl.i686 0:0.15.7-1.2.el6 will be installed --> Processing Dependency: libppl_c.so.2 for package: cloog-ppl-0.15.7-1.2.el6.i686 --> Processing Dependency: libppl.so.7 for package: cloog-ppl-0.15.7-1.2.el6.i686 ---> Package cpp.i686 0:4.4.6-4.el6 will be installed --> Processing Dependency: libmpfr.so.1 for package: cpp-4.4.6-4.el6.i686 ---> Package glibc-devel.i686 0:2.12-1.80.el6 will be installed --> Processing Dependency: glibc-headers = 2.12-1.80.el6 for package: glibc-devel-2.12-1.80.el6.i686 --> Processing Dependency: glibc-headers for package: glibc-devel-2.12-1.80.el6.i686 --> Running transaction check ---> Package glibc-headers.i686 0:2.12-1.80.el6 will be installed --> Processing Dependency: kernel-headers >= 2.2.1 for package: glibc-headers-2.12-1.80.el6.i686 --> Processing Dependency: kernel-headers for package: glibc-headers-2.12-1.80.el6.i686 ---> Package mpfr.i686 0:2.4.1-6.el6 will be installed ---> Package ppl.i686 0:0.10.2-11.el6 will be installed --> Running transaction check ---> Package kernel-headers.i686 0:2.6.32-279.el6 will be installed --> Finished Dependency Resolution
Dependencies Resolved
======================================================================================= ackage Arch Version Repository Size ======================================================================================= Installing: gcc i686 4.4.6-4.el6 xiaofeng 8.2 M Installing for dependencies: cloog-ppl i686 0.15.7-1.2.el6 xiaofeng 93 k cpp i686 4.4.6-4.el6 xiaofeng 3.4 M glibc-devel i686 2.12-1.80.el6 xiaofeng 970 k glibc-headers i686 2.12-1.80.el6 xiaofeng 609 k kernel-headers i686 2.6.32-279.el6 xiaofeng 1.9 M mpfr i686 2.4.1-6.el6 xiaofeng 153 k ppl i686 0.10.2-11.el6 xiaofeng 1.3 M
Transaction Summary ======================================================================================= Install 8 Package(s)
Total download size: 16 M Installed size: 35 M Downloading Packages: --------------------------------------------------------------------------------------- Total 18 MB/s | 16 MB 00:00 Running rpm_check_debug Running Transaction Test Transaction Test Succeeded Running Transaction Installing : kernel-headers-2.6.32-279.el6.i686 1/8 Installing : glibc-headers-2.12-1.80.el6.i686 2/8 Installing : glibc-devel-2.12-1.80.el6.i686 3/8 Installing : ppl-0.10.2-11.el6.i686 4/8 Installing : cloog-ppl-0.15.7-1.2.el6.i686 5/8 Installing : mpfr-2.4.1-6.el6.i686 6/8 Installing : cpp-4.4.6-4.el6.i686 7/8 Installing : gcc-4.4.6-4.el6.i686 8/8 Verifying : glibc-headers-2.12-1.80.el6.i686 1/8 Verifying : kernel-headers-2.6.32-279.el6.i686 2/8 Verifying : cpp-4.4.6-4.el6.i686 3/8 Verifying : glibc-devel-2.12-1.80.el6.i686 4/8 Verifying : mpfr-2.4.1-6.el6.i686 5/8 Verifying : ppl-0.10.2-11.el6.i686 6/8 Verifying : gcc-4.4.6-4.el6.i686 7/8 Verifying : cloog-ppl-0.15.7-1.2.el6.i686 8/8
Installed: gcc.i686 0:4.4.6-4.el6
Dependency Installed: cloog-ppl.i686 0:0.15.7-1.2.el6 cpp.i686 0:4.4.6-4.el6 glibc-devel.i686 0:2.12-1.80.el6 glibc-headers.i686 0:2.12-1.80.el6 kernel-headers.i686 0:2.6.32-279.el6 mpfr.i686 0:2.4.1-6.el6 ppl.i686 0:0.10.2-11.el6
Complete! [root@CentOS6-EN /]#到这里就完成了安装,小风博客 欢迎大家光临,学习交流! |