Configure local source yum in CentOS 6.4

Source: Internet
Author: User

When CentOS 6.4 is installed and cannot be connected to the Internet, our yum command cannot be used. We can configure the local source to use the yum command.

1. Configure the repo file,
Cd/etc/yum. repos. d
Back up the original configuration file
Mv CentOS-Base.repo CentOS-Base.repo.bak
Mv CentOS-Debuginfo.repo CentOS-Debuginfo.repo.bak
Mv CentOS-Vault.repo CentOS-Vault.repo.bak
Mv CentOS-Media.repo CentOS-Media.repo.bak

Create a new configuration file vim CentOS-Debuginfo.repo

[Debug]
Name = centos
Baseurl = file: // mnt
Enabled = 1
Gpgcheck = 0
Gpgkey = file: // mnt/RPM-GPG-KEY-RedHat-release

: Wq save

2. Configure the yumRepo. py file,

Cd/usr/lib/python2.6/site-packages/yum
Vim yumRepo. py

Add remote = url + '/' + relative
Change to remote = "/mnt" + '/' + relative

: Wq save changes

3. Configure the iso mounting File

Mount/dev/cdrom/mnt


4. Verification Test (using vsftpd)
Rpm-qa | grep vsftpd
Yum list | grep vsftpd

[Root @ hsj2 yum] # yum list | grep vsftpd
Vsftpd. i686 2.2.2-11. el6_3.1 @ debug

Yum install vsftpd. i686

 

[Root @ hsj2 yum] # yum install vsftpd. i686
Loaded plugins: fastestmirror, refresh-packagekit, security
Loading mirror speeds from cached hostfile
Setting up Install Process
Resolving Dependencies
There are unfinished transactions remaining. You might consider running yum-complete-transaction first to finish them.
--> Running transaction check
---> Package vsftpd. i686. 2.2-11. el6_3.1 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

========================================================== ========================================================== ======================================
Package Arch Version Repository Size
========================================================== ========================================================== ======================================
Installing:
Vsftpd i686 2.2.2-11. el6_3.1 debug 157 k

Transaction Summary
========================================================== ========================================================== ======================================
Install 1 Package (s)

Total download size: 157 k
Installed size: 344 k
Is this OK [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
** Found 2 pre-existing rpmdb problem (s), 'yum check' output follows:
Glibc-2.12-1.107.el6_4.4.i686 is a duplicate with glibc-2.12-1.107.el6.i686
Glibc-common-2.12-1.107.el6_4.4.i686 is a duplicate with glibc-common-2.12-1.107.el6.i686
Installing: vsftpd-2.2.2-11.el6_3.1.i686 1/1
Verifying: vsftpd-2.2.2-11.el6_3.1.i686 1/1

Installed:
Vsftpd. i686. 2.2-11. el6_3.1

Complete!

Verify OK, succeeded

Description of yum configuration file

Install yum in RedHat 6.1)

YUM installation and cleaning

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.