需要准备一个CentOS的安装镜像。
复制文件包
<code>[root@localhost ~]</code><code># cd /media/CentOS_6.4_Final/</code>
<code>[root@localhost CentOS_6.4_Final]</code><code># cp * /home/Pack</code>
复制验证
<code>[root@localhost CentOS_6.4_Final]</code><code># cp RPM-GPG-KEY-CentOS-6 /home/Pack/</code>
安装createrepo
<code>[root@localhost Pack]</code><code># rpm -ivh deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm</code>
<code>[root@localhost Pack]</code><code># rpm -ivh python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm</code>
<code>[root@localhost Pack]</code><code># rpm -ivh createrepo-0.9.9-17.el6.noarch.rpm</code>
生成包信息
<code>[root@localhost CentOS_6.4_Final]</code><code># createrepo -g /media/CentOS_6.4_Final/repodata/repomd.xml /home/Pack/</code>
<code>Spawning worker 0 with 3955 pkgs</code>
<code>Workers Finished</code>
<code>Gathering worker results</code>
<code>Saving Primary metadata</code>
<code>Saving </code><code>file</code> <code>lists metadata</code>
<code>Saving other metadata</code>
<code>Generating sqlite DBs</code>
<code>Sqlite DBs complete</code>
配置文件CentOS-Base.repo
<code># CentOS-Base.repo</code>
<code>#</code>
<code># The mirror system uses the connecting IP address of the client and the</code>
<code># update status of each mirror to pick mirrors that are updated to and</code>
<code># geographically close to the client. You should use this for CentOS updates</code>
<code># unless you are manually picking other mirrors.</code>
<code># If the mirrorlist= does not work for you, as a fall back you can try the</code>
<code># remarked out baseurl= line instead.</code>
<code>[base]</code>
<code>#name=CentOS-$releasever - Base</code>
<code>#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os</code>
<code>##baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/</code>
<code>#gpgcheck=1</code>
<code>#gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6</code>
<code>name=CentOS-$releasever - Base</code>
<code>baseurl=</code><code>file</code><code>:</code><code>///home/Pack/</code>
<code>enable</code><code>=1</code>
<code>gpgcheck=1</code>
<code>gpgkey=</code><code>file</code><code>:</code><code>///home/Pack/RPM-GPG-KEY-CentOS-6</code>
<code>#released updates</code>
<code>#[updates]</code>
<code>#name=CentOS-$releasever - Updates</code>
<code>#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates</code>
<code>##baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/</code>
<code>##additional packages that may be useful</code>
<code>#[extras]</code>
<code>#name=CentOS-$releasever - Extras</code>
<code>#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras</code>
<code>##baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/</code>
<code>##additional packages that extend functionality of existing packages</code>
<code>#[centosplus]</code>
<code>#name=CentOS-$releasever - Plus</code>
<code>#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus</code>
<code>##baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/</code>
<code>#enabled=0</code>
<code>##contrib - packages by Centos Users</code>
<code>#[contrib]</code>
<code>#name=CentOS-$releasever - Contrib</code>
<code>#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib</code>
<code>##baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/</code>
清出yum缓存
<code>[root@localhost Pack]</code><code># yum clean all</code>
yum安装包
<code>[root@localhost Pack]</code><code># yum -y install --skip-broken gcc gcc-c++ autoconf automake zlib zli</code>
<code>Loaded plugins: fastestmirror, refresh-packagekit, security</code>
<code>Determining fastest mirrors</code>
<code>Could not retrieve mirrorlist http:</code><code>//mirrorlist</code><code>.centos.org/?release=$releasever&arch=x86_64</code>
<code>14: PYCURL ERROR 7 - </code><code>"Failed to connect to 2a02:2498:1:3d:5054:ff:fed3:e91a: 网络不可达"</code>
<code>Error: Cannot </code><code>find</code> <code>a valid baseurl </code><code>for</code> <code>repo: extras</code>
<code>Cleaning repos: base</code>
<code>Cleaning up Everything</code>
<code>Cleaning up list of fastest mirrors</code>
<code>base</code>
<code>base</code><code>/primary_db</code>
<code>Setting up Install Process</code>
<code>Package zlib-1.2.3-29.el6.x86_64 already installed and latest version</code>
<code>Resolving Dependencies</code>
<code>--> Running transaction check</code>
<code>---> Package autoconf.noarch 0:2.63-5.1.el6 will be installed</code>
<code>---> Package automake.noarch 0:1.11.1-4.el6 will be installed</code>
<code>---> Package gcc.x86_64 0:4.4.7-3.el6 will be installed</code>
<code>--> Processing Dependency: cpp = 4.4.7-3.el6 </code><code>for</code> <code>package: gcc-4.4.7-3.el6.x86_64</code>
<code>--> Processing Dependency: glibc-devel >= 2.2.90-12 </code><code>for</code> <code>package: gcc-4.4.7-3.el6.x86_64</code>
<code>--> Processing Dependency: cloog-ppl >= 0.15 </code><code>for</code> <code>package: gcc-4.4.7-3.el6.x86_64</code>
<code>---> Package gcc-c++.x86_64 0:4.4.7-3.el6 will be installed</code>
<code>--> Processing Dependency: libstdc++-devel = 4.4.7-3.el6 </code><code>for</code> <code>package: gcc-c++-4.4.7-3.el6.x</code>
<code>--> Processing Dependency: libmpfr.so.1()(64bit) </code><code>for</code> <code>package: gcc-c++-4.4.7-3.el6.x86_64</code>
<code>---> Package openssl-devel.x86_64 0:1.0.0-27.el6 will be installed</code>
<code>--> Processing Dependency: krb5-devel </code><code>for</code> <code>package: openssl-devel-1.0.0-27.el6.x86_64</code>
<code>---> Package pcre-devel.x86_64 0:7.8-6.el6 will be installed</code>
<code>---> Package zlib-devel.x86_64 0:1.2.3-29.el6 will be installed</code>
<code>---> Package cloog-ppl.x86_64 0:0.15.7-1.2.el6 will be installed</code>
<code>--> Processing Dependency: libppl_c.so.2()(64bit) </code><code>for</code> <code>package: cloog-ppl-0.15.7-1.2.el6.x86</code>
<code>--> Processing Dependency: libppl.so.7()(64bit) </code><code>for</code> <code>package: cloog-ppl-0.15.7-1.2.el6.x86_6</code>
<code>---> Package cpp.x86_64 0:4.4.7-3.el6 will be installed</code>
<code>---> Package glibc-devel.x86_64 0:2.12-1.107.el6 will be installed</code>
<code>--> Processing Dependency: glibc-headers = 2.12-1.107.el6 </code><code>for</code> <code>package: glibc-devel-2.12-1.1</code>
<code>--> Processing Dependency: glibc-headers </code><code>for</code> <code>package: glibc-devel-2.12-1.107.el6.x86_64</code>
<code>---> Package krb5-devel.x86_64 0:1.10.3-10.el6 will be installed</code>
<code>--> Processing Dependency: libselinux-devel </code><code>for</code> <code>package: krb5-devel-1.10.3-10.el6.x86_64</code>
<code>--> Processing Dependency: libcom_err-devel </code><code>for</code> <code>package: krb5-devel-1.10.3-10.el6.x86_64</code>
<code>--> Processing Dependency: keyutils-libs-devel </code><code>for</code> <code>package: krb5-devel-1.10.3-10.el6.x86_64</code>
<code>---> Package libstdc++-devel.x86_64 0:4.4.7-3.el6 will be installed</code>
<code>---> Package mpfr.x86_64 0:2.4.1-6.el6 will be installed</code>
<code>---> Package glibc-headers.x86_64 0:2.12-1.107.el6 will be installed</code>
<code>--> Processing Dependency: kernel-headers >= 2.2.1 </code><code>for</code> <code>package: glibc-headers-2.12-1.107.el</code>
<code>--> Processing Dependency: kernel-headers </code><code>for</code> <code>package: glibc-headers-2.12-1.107.el6.x86_64</code>
<code>---> Package keyutils-libs-devel.x86_64 0:1.4-4.el6 will be installed</code>
<code>---> Package libcom_err-devel.x86_64 0:1.41.12-14.el6 will be installed</code>
<code>---> Package libselinux-devel.x86_64 0:2.0.94-5.3.el6 will be installed</code>
<code>--> Processing Dependency: libsepol-devel >= 2.0.32-1 </code><code>for</code> <code>package: libselinux-devel-2.0.94-</code>
<code>--> Processing Dependency: pkgconfig(libsepol) </code><code>for</code> <code>package: libselinux-devel-2.0.94-5.3.el6</code>
<code>---> Package ppl.x86_64 0:0.10.2-11.el6 will be installed</code>
<code>---> Package kernel-headers.x86_64 0:2.6.32-358.el6 will be installed</code>
<code>---> Package libsepol-devel.x86_64 0:2.0.41-4.el6 will be installed</code>
<code>--> Finished Dependency Resolution</code>
<code>Dependencies Resolved</code>
<code>===========================================================================================</code>
<code>Package Arch</code>
<code>Installing:</code>
<code>autoconf noarch</code>
<code>automake noarch</code>
<code>gcc x86_64</code>
<code>gcc-c++ x86_64</code>
<code>openssl-devel x86_64</code>
<code>pcre-devel x86_64</code>
<code>zlib-devel x86_64</code>
<code>Installing </code><code>for</code> <code>dependencies:</code>
<code>cloog-ppl x86_64</code>
<code>cpp x86_64</code>
<code>glibc-devel x86_64</code>
<code>glibc-headers x86_64</code>
<code>kernel-headers x86_64</code>
<code>keyutils-libs-devel x86_64</code>
<code>krb5-devel x86_64</code>
<code>libcom_err-devel x86_64</code>
<code>libselinux-devel x86_64</code>
<code>libsepol-devel x86_64</code>
<code>libstdc++-devel x86_64</code>
<code>mpfr x86_64</code>
<code>ppl x86_64</code>
<code>Transaction Summary</code>
<code>Install 20 Package(s)</code>
<code>Total download size: 29 M</code>
<code>Installed size: 68 M</code>
<code>Downloading Packages:</code>
<code>-------------------------------------------------------------------------------------------</code>
<code>Total</code>
<code>warning: rpmts_HdrFromFdno: Header V3 RSA</code><code>/SHA1</code> <code>Signature, key ID c105b9de: NOKEY</code>
<code>Retrieving key from </code><code>file</code><code>:</code><code>///home/Pack/RPM-GPG-KEY-CentOS-6</code>
<code>Importing GPG key 0xC105B9DE:</code>
<code>Userid: </code><code>"CentOS-6 Key (CentOS 6 Official Signing Key) <[email protected]>"</code>
<code>From : </code><code>/home/Pack/RPM-GPG-KEY-CentOS-6</code>
<code>Running rpm_check_debug</code>
<code>Running Transaction Test</code>
<code>Transaction Test Succeeded</code>
<code>Running Transaction</code>
<code>Warning: RPMDB altered outside of yum.</code>
<code>Installing : mpfr-2.4.1-6.el6.x86_64</code>
<code>Installing : cpp-4.4.7-3.el6.x86_64</code>
<code>Installing : ppl-0.10.2-11.el6.x86_64</code>
<code>Installing : cloog-ppl-0.15.7-1.2.el6.x86_64</code>
<code>Installing : libcom_err-devel-1.41.12-14.el6.x86_64</code>
<code>Installing : zlib-devel-1.2.3-29.el6.x86_64</code>
<code>Installing : libstdc++-devel-4.4.7-3.el6.x86_64</code>
<code>Installing : autoconf-2.63-5.1.el6.noarch</code>
<code>Installing : kernel-headers-2.6.32-358.el6.x86_64</code>
<code>Installing : glibc-headers-2.12-1.107.el6.x86_64</code>
<code>Installing : glibc-devel-2.12-1.107.el6.x86_64</code>
<code>Installing : gcc-4.4.7-3.el6.x86_64</code>
<code>Installing : keyutils-libs-devel-1.4-4.el6.x86_64</code>
<code>Installing : libsepol-devel-2.0.41-4.el6.x86_64</code>
<code>Installing : libselinux-devel-2.0.94-5.3.el6.x86_64</code>
<code>Installing : krb5-devel-1.10.3-10.el6.x86_64</code>
<code>Installing : openssl-devel-1.0.0-27.el6.x86_64</code>
<code>Installing : gcc-c++-4.4.7-3.el6.x86_64</code>
<code>Installing : automake-1.11.1-4.el6.noarch</code>
<code>Installing : pcre-devel-7.8-6.el6.x86_64</code>
<code>Verifying : pcre-devel-7.8-6.el6.x86_64</code>
<code>Verifying : krb5-devel-1.10.3-10.el6.x86_64</code>
<code>Verifying : libsepol-devel-2.0.41-4.el6.x86_64</code>
<code>Verifying : keyutils-libs-devel-1.4-4.el6.x86_64</code>
<code>Verifying : gcc-c++-4.4.7-3.el6.x86_64</code>
<code>Verifying : openssl-devel-1.0.0-27.el6.x86_64</code>
<code>Verifying : gcc-4.4.7-3.el6.x86_64</code>
<code>Verifying : glibc-headers-2.12-1.107.el6.x86_64</code>
<code>Verifying : kernel-headers-2.6.32-358.el6.x86_64</code>
<code>Verifying : mpfr-2.4.1-6.el6.x86_64</code>
<code>Verifying : glibc-devel-2.12-1.107.el6.x86_64</code>
<code>Verifying : libselinux-devel-2.0.94-5.3.el6.x86_64</code>
<code>Verifying : cpp-4.4.7-3.el6.x86_64</code>
<code>Verifying : autoconf-2.63-5.1.el6.noarch</code>
<code>Verifying : libstdc++-devel-4.4.7-3.el6.x86_64</code>
<code>Verifying : zlib-devel-1.2.3-29.el6.x86_64</code>
<code>Verifying : libcom_err-devel-1.41.12-14.el6.x86_64</code>
<code>Verifying : ppl-0.10.2-11.el6.x86_64</code>
<code>Verifying : cloog-ppl-0.15.7-1.2.el6.x86_64</code>
<code>Verifying : automake-1.11.1-4.el6.noarch</code>
<code>Installed:</code>
<code>autoconf.noarch 0:2.63-5.1.el6 automake.noarch 0:1.11.1-4.el6 gcc.x86_64 0:4.4.7-3.</code>
<code>zlib-devel.x86_64 0:1.2.3-29.el6</code>
<code>Dependency Installed:</code>
<code>cloog-ppl.x86_64 0:0.15.7-1.2.el6 cpp.x86_64 0:4.4.7-3.el6 glibc-devel.x8</code>
<code>keyutils-libs-devel.x86_64 0:1.4-4.el6 krb5-devel.x86_64 0:1.10.3-10.el6 libcom_err-dev</code>
<code>libstdc++-devel.x86_64 0:4.4.7-3.el6 mpfr.x86_64 0:2.4.1-6.el6 ppl.x86_64 0:0</code>
<code>Complete!</code>
<code>[root@localhost Pack]</code><code>#</code>
版权声明:原创作品,如需转载,请注明出处。否则将追究法律责任
本文转自 梦朝思夕 51CTO博客,原文链接:http://blog.51cto.com/qiangmzsx/1392112