Install the rpm package without network connection to CentOS

Source: Internet
Author: User
Because there is no network connection, yum cannot be used. this is a problem I encountered during manual installation and its solution I. the first thought should be to mount the centosios image, because the packages contains all the rpm packages of the current version, preferably the locally installed image. The steps are as follows: 1. first mount the disc to mount-oloop/mnt/iso/CentOS5.iso/mnt/cdrom

Yum cannot be used because there is no network connection. this is a problem I encountered during manual installation and its solution.

I. The first thought should be to mount the centos ios image, because packages contains all the rpm packages of the current version, preferably the locally installed image. The procedure is as follows:


1. first, attach the CD

Mount-o loop/mnt/iso/CentOS5.iso/mnt/cdrom

2. Understanding the truth

CentOS has two yum sources, which have two files under/etc/yum. repos. d/: CentOS-Base.repo and CentOS-Media.repo. But these two sources are not used at the same time, the default use of the Internet upgrade CentOS-Base.repo source (this file is the URL, you can look at it ), unless we manually modify the system to use the Media source, and the Media source is the local source of the computer, it contains the local CD that we just mounted.

3. start operation

First, rename the CentOS-Base.repo file so that the system can not find the file, so that you cannot use the internet update method:

Mv CentOS-Base.repo CentOS-Base.repo.bak


CpCentOS-Media.repo CentOS-Media.repo.bak
Vi CentOS-Media.repo

Delete the last two rows of the following three rows
Baseurl = file: // media/CentOS/
File: // media/cdrom/
File: // media/cdrecorder/

The first line is changed to the path of the attached disk, as follows:

Baseurl = file: // mnt/cdrom/

Then, find this attribute and change the value to 1, so that the enable switch of the local source file is enabled.
Enabled = 0

Enabled = 1

Save it.

Then, you can use yum check-update or yum install * to test whether the source is successful and effective.

However, there is a problem in this process, that is, your source and your system source may be different. This requires you to mount the installed iso image. If not, when you install yum, there may be different dependent package versions, but you still cannot install it. I wonder if I can update the dependent package as well?

2. Manual installation.

If the source cannot be found, you can only manually install the package. if the package is missing, you can search for the package in google. of course, you do not need to download the package. you need to find the correct version, because the dependent package may have been installed, you need to download the same version as the dependent package. If you are lucky, the dependency-dependency stack must have several layers. Below are the URLs of frequently used download packages:




There is a specific package download for each version, where the package in the the most comprehensive, the official does not approve of using certain packages, because

This directory (and version of CentOS) is deprecated.  For normal users,you should use /6/ and not /6.6/ in your path. Please see this FAQconcerning the CentOS release scheme: you know what you are doing, and absolutely want to remain at the 6.6level, go to for packages. Please keep in mind that 6.0, 6.1, 6.2, 6.3, 6.4 , 6.5 and 6.6 no longer gets any updates, norany security fix's.


The sequence of manual installation packages is recorded below:

Libstdc ++-4.4.7-4. el6.i686. rpm
Libstdc +-devel-4.4.7-4.el6.i686.rpm
Gcc-c ++-4.4.7-4. el6.x86 _ 64.rpm
Rpm-ivh compat-libstdc ++-33-3.2.3-69.el6.i686.rpm

The following are some problems encountered during the installation process:

1. packet conflict

File/usr/lib64/libstdc ++. so.6 from install of lib64stdc ++ 6-4.6.1-2.x86_64 conflicts with file from package libstdc ++-4.4.7-11. el6.x86 _ 64 file/usr/lib64/libstdc ++. so.6 from install of lib64stdc ++ 6-4.6.1-2.i686 conflicts with file from package libstdc ++-4.4.7-11. el6.i686


Yum-y remove libstdc ++-4.4.7-11. el6.i686

Yum-y remove libstdc ++-4.4.7-11. el6.x86 _ 64

However, this may cause all dependent packages to be detached, making things worse.

2. dependency issues

If you manually install the rpm package, two packages may depend on each other in many cases.


# Rpm-ivh elfutils-devel-0.125-3.el5.i386.rpm

Warning: elfutils-devel-0.125-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Error: Failed dependencies:

Elfutils-devel-static = 0.125-3. el5 is needed by elfutils-devel-0.125-3.el5.i386

Elfutils-libelf-devel = 0.125-3. el5 is needed by elfutils-devel-0.125-3.el5.i386


# Rpm-ivh elfutils-devel-static-0.125-3.el5.i386.rpm

Warning: elfutils-devel-static-0.125-3.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186

Error: Failed dependencies:

Elfutils-devel = 0.125-3. el5 is needed by elfutils-devel-static-0.125-3.el5.i386

Elfutils-libelf-devel-static = 0.125-3. el5 is needed by elfutils-devel-static-0.125-3.el5.i386

In this case, you only need to install the two packages together, that is:

Rpm-ivh elfutils-devel-0.125-3.el5.i386.rpm elfutils-devel-static-0.125-3.el5.i386.rpm




File xxx from install of xxx conflicts with file from xxx

In Linux, how to install the dependency-related RPM Package [go]

The dependency package is missing for installing oracle11g R2.

CentOS sets the yum source to a local IOS image

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: 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.