CentOS Local Yum Source build-up

Source: Internet
Author: User
Tags gpg ftp protocol

Recently in an internal knowledge base system, is required to be used only in the intranet environment, a physical server virtualized a server, after the installation of CentOS6.4 system, in the deployment of the environment to find that the system is minimized installation (other colleagues to minimize the installation), there are many development packages are not installed. However, the server is unable to sisu the network, can not use the public network Yum source to install software packages. So on their own inside the network to build a Yum source and the steps to organize a bit, has done before but has been relatively lazy, no finishing, today tidy up. I wrote the steps more detailed, so looks longer, but suitable for novice reference.

(here in order to facilitate the same intranet to deploy the same version of the other servers, I am on this computer using FTP to do yum source, in the future the other servers in the intranet can be directly through the use of FTP in the way of the Yum source. )

(1), mount the ISO image file to/media/cdrom/.
Attach the downloaded Centos-6.4-x86_64-bin-dvd1.iso image file to a directory under the following method, and mount it to/media/cdrom/under the same load:
Mount-t Iso9660-o loop/root/centos-6.4-x86_64-bin-dvd1.iso/media/cdrom/

(2), install and start the VSFTPD service.
Since my server is minimized, the VSFTPD service is not installed by default, and it goes to the directory you just mounted. Install the VSFTPD service using the Rpm-ivh method.
[[Email protected]]# cd/media/cdrom/
[Email protected]]# ll
Total Dosage 676
-r--r--r--2 Root root14 March 6 Centos_buildtag
DR-XR-XR-X3 Root root2048 March 5 EFI
-r--r--r--2 Root root212 March 3 EULA
-r--r--r--2 Root root18009 March 3 GPL
DR-XR-XR-X3 Root root2048 March 5 images
DR-XR-XR-X2 Root root2048 March 5 isolinux
dr-xr-xr-x2 root root 649216 March 6 Packages
-r--r--r--2 Root root1354 March 3 release-notes-en-us.html
DR-XR-XR-X2 Root root4096 March 6 repodata
-r--r--r--2 Root root1706 March 3 rpm-gpg-key-centos-6
-r--r--r--2 Root root1730 March 3 rpm-gpg-key-centos-debug-6
-r--r--r--2 Root root1730 March 3 rpm-gpg-key-centos-security-6
-r--r--r--2 Root root1734 March 3 rpm-gpg-key-centos-testing-6
-r--r--r--1 Root root3380 March 6 TRANS. TBL
[Email protected]]# rpm-ivh packages/vsftpd-2.2.2-11.el6_3.1.x86_64.rpm
After the installation is complete, start the VSFTPD service:
[Email protected] cdrom]# service vsftpd restart
[Email protected] cdrom]# chkconfig vsftpd on # #设置vsftpd服务为自启动
[Email protected]]# chkconfig--list |grep vsftpd
Vsftpd0: Off 1: Off 2: Enable 3: Enable 4: Enable 5: Enable 6: Off

(3). Set up the Yum repository directory
The/var/ftp/pub/directory is automatically created by default after VSFTPD is installed, and we have created the Yum repository directory under this directory, named centos6.4, as follows:
[Email protected] cdrom]# mkdir-p/var/ftp/pub/centos6.4/
[[email protected] cdrom] #cp-rf/media/cdrom/*/var/ftp/pub/centos6.4/# #将光盘镜像里的所有文件拷贝到yum仓库目录里
This is the directory structure after the copy is completed:
[Email protected] cdrom]# cd/var/ftp/pub/centos6.4
[Email protected]]# ll
Total dosage 328
-r--r--r--1 Root root14 November 6 15:03 Centos_buildtag
DR-XR-XR-X3 Root root4096 November 6 15:03 EFI
-r--r--r--1 Root root212 November 6 15:03 EULA
-r--r--r--1 Root root18009 November 6 15:03 GPL
DR-XR-XR-X3 Root root4096 November 6 15:03 Images
DR-XR-XR-X2 Root root4096 November 6 15:03 Isolinux
dr-xr-xr-x2 root root 266240 November 6 15:06 Packages
-r--r--r--1 Root root1354 November 6 15:06 release-notes-en-us.html
DRWXR-XR-X2 Root root4096 November 6 16:04 repodata
-r--r--r--1 Root root1706 November 6 15:06 rpm-gpg-key-centos-6
-r--r--r--1 Root root1730 November 6 15:06 rpm-gpg-key-centos-debug-6
-r--r--r--1 Root root1730 November 6 15:06 rpm-gpg-key-centos-security-6
-r--r--r--1 Root root1734 November 6 15:06 rpm-gpg-key-centos-testing-6
-r--r--r--1 Root root3380 November 6 15:06 TRANS. TBL

(4), create a Yum source, update package dependencies.
Creating a repository dependency file manually, creating a Yum source requires installing the Createrepo package. Due to my minimal installation, the package installation also relies on the following two packages:
python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm
So the three packages are installed together, as follows:
[Email protected]]# rpm-ivh packages/createrepo-0.9.9-17.el6.noarch.rpm packages/ python-deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm packages/deltarpm-3.5-0.5.20090913git.el6.x86_64.rpm

[Email protected] cdrom]# rm-rf/var/ftp/pub/centos6.4/repodata/# #将原来的依赖关系文件删除, regenerate.
[[email protected] cdrom] #createrepo-v/var/ftp/pub/centos6.4/# #重建依赖关系库文件 will regenerate Repodata directory
Next, modify the configuration file for the Yum source address.
[[Email protected]~]# cd/etc/yum.repos.d/
[[email protected] yum.repos.d]# for i in ' ls./';d OMV $i $i-bak;done; # #把 files under the/etc/yum.repos.d/directory are renamed and backed up.
[[email protected] YUM.REPOS.D] #cp centos-media.repo-bak Centos-media.repo
[[email protected] centos6.4]# Vi/etc/yum.repos.d/centos-media.repo # #只用这一个文件, modify the contents of the bold section below. Everyone changes according to their actual directory.
As follows:

[C6-media]
name=centos-$releasever-media
#baseurl =file:///media/centos/
file:///media/cdrom/
file:///media/cdrecorder/
baseurl=ftp://192.168.0.109/pub/centos6.4/
Gpgcheck=1
Enabled=1
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-centos-6

Description
name=centos-$releasever-media Customization Instructions
BASEURL=FILE:///YUM/SERVER specifies the protocol used and where the Yum source resides
Enabled=1 whether to enable the Yum Repository, 1 for use, 0 for non-use
Gpgcheck=0 whether the process GPG key check, 1 for check, 0 for not checking
Gpgkey=file:///etc/pki/rpm-gpg/rpm-gpg-key-redhat-release specifying the location of the GPG key

Description
The baseurl= column specifies which Yum source to use
File means using the local Yum source, in the format file://source path
FTP means using FTP protocol to get Yum source in the format ftp://sourceIP/repository directory
HTTP indicates the use of the HTTP protocol to obtain the Yum source, in the format http://sourceIP/repository directory

Gpgcheck= A column Indicates whether the secret key detection, if need to check, you can manually import the secret key
#rpm--IMPORT/ETC/PKI/RPM-GPG/GPG secret key file name

In the/etc/yum.repo.d/directory, it is best to have only one suffix named repo file, other files renamed, to prevent interference.


[[email protected] centos6.4]# yum Clean all # #清除一下yum缓存, otherwise it may be an error when Yum is installed.
Loadedplugins:fastestmirror, security
Cleaningrepos:c6-media
Cleaningup everything
Cleaningup List of fastest mirrors

Install the screen software package with Yum and test it properly. As follows:
[[email protected] centos6.4]# yum install screen-y # #使用-y parameter, meaning direct installation without reconfirmation.
Loadedplugins:fastestmirror, security
Determiningfastest Mirrors
c6-media| 2.9 kb00:00
c6-media/primary_db| 3.3 mb00:00
Settingup Install Process
Resolvingdependencies
-->running transaction Check
--->package screen.x86_64 0:4.0.3-16.el6 'll be installed
-->finished Dependency Resolution
Dependenciesresolved
=============================================================================================================== =============================================
Packagearchversionrepositorysize
=============================================================================================================== =============================================
Installing:
screenx86_644.0.3-16.el6c6-media494 K
Transactionsummary
=============================================================================================================== =============================================
INSTALL1 Package (s)
Totaldownload size:494 K
installedsize:795 K
Downloadingpackages:
screen-4.0.3-16.el6.x86_64.rpm| 494 kb00:00
Warning:rpmts_HdrFromFdno:Header V3 rsa/sha1 Signature, key ID C105b9de:nokey
Retrievingkey from File:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
IMPORTINGGPG Key 0xc105b9de:
Userid:centos-6 Key (CentOS 6 officialsigning key) <[email protected]>
package:centos-release-6-4.el6.centos.10.x86_64 (@anaconda-centos-201303020151.x86_64/6.4)
From:/etc/pki/rpm-gpg/rpm-gpg-key-centos-6
Runningrpm_check_debug
Runningtransaction Test
Transactiontest succeeded
Runningtransaction
Warning:rpmdb altered outside of Yum.
Installing:screen-4.0.3-16.el6.x86_641/1
Verifying:screen-4.0.3-16.el6.x86_641/1

Installed:
Screen.x86_64 0:4.0.3-16.el6

complete!

Note Above blog is reproduced http://www.linuxidc.com/Linux/2014-03/97904.htm, this is only convenient for me to view only reproduced

CentOS Local Yum source build

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.