Configure local yum source and linuxyum source in Linux

Source: Internet
Author: User

Configure local yum source and linuxyum source in Linux

Use yum to install software in non-network state for Linux Configuration

To install software on a network, you only need one yum install xxx command. For example, if you only need one command to install gcc: yum install gcc, how can you install gcc without a network? Although there is no network, I think you should have an installation disc or an ISO image, or at least the installation package required by gcc. If there is no such installation package, then goodbye.

Now, if you have an installed CD, let's take this as an example to describe how to use the yum command to install gcc in a non-network state.

I. Obtain the yum installation source. Here, you need to attach a CD to the Linux system.

Enter mount-o loop xxxx. iso/media/CentOS/on the terminal/

Note: xxxx. iso is your image file name (correct path)

/Media/Centos/This is the address of the mounted file. Centos is built by yourself. You can also select the path by yourself;

 

Without using the above method, you can directly mount the soft drive to a directory created by yourself:

Run mount/dev/cdrom/mnt/cdrom on the terminal to mount the content of the CD to the system.

  

2. Edit the content of the local yum source configuration file:/etc. yum_repos.d/CenCOS-Media.repo file. The main information is as follows:

  

# CentOS-Media.repo // local yum source name, which can be modified at will
#
# This repo can be used with mounted DVD media, verify the mount point
# CentOS-6. You can use this repo and yum to install items directly off
# Dvd iso that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
# Yum -- enablerepo = c6-media [command]
#
# Or for ONLY the media repo, do this:
#
# Yum -- disablerepo = \ * -- enablerepo = c6-media [command]

C6-media
Name = CentOS-$ releasever-Media
Baseurl = file: // mnt/cdrom // path of the local yum Source
Gpgcheck = 1 // check the security of the installation package
Enabled = 1 // use this yum source (if it is 0, this yum source is not applicable)
Gpgkey = file: // etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-6
Save and close the configuration file after modification.

3. Disable the network yum source. The CentOS-Base.repo is the configuration file for the network yum source.

Therefore, the editor's common method is to change the configuration file name of the network yum source to make it invalid.

Mv/etc/yum. repos. d/CentOS-Base.repo/etc/yum. repos. d/CentOS-Base.repo.bak

At this point, you can try whether yum install gcc can be successfully installed. Note: by default, the network yum source is preferred in Linux.

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.