Solved

Centos 5 Package Manager, with no internet

Posted on 2009-07-01
2
971 Views
Last Modified: 2013-12-15
With a fresh install of Centos 5 on a Virtual Server, how do I use the Package Manager when the linux server doesn't have an internet connection? The VM is strictly an internal VM and when I try to open the Package Manager (need to install a C compiler for example), it produces an error and closes because it doesn't have internet access. How can I utilize this without internet? I have all the ISO's I used during install.
0
Comment
Question by:MMDeveloper
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 5

Accepted Solution

by:
JohnmenZ earned 500 total points
ID: 24757798
You can use YUM to install packages that are from your local ISO images. CentOS comes with a .repo file that is for local pacakage installation, it is /etc/yum.repo.d/CentOS-Media.repo.  Here is the contents of it:

# CentOS-Media.repo
#
# This repo is used to mount the default locations for a CDROM / DVD on
#  CentOS-5.  You can use this repo and yum to install items directly off the
#  DVD ISO that we release.
#
# To use this repo, put in your DVD and use it with the other repos too:
#  yum --enablerepo=c5-media [command]
#
# or for ONLY the media repo, do this:
#
#  yum --disablerepo=\* --enablerepo=c5-media [command]

[c5-media]
name=CentOS-$releasever - Media
baseurl=file:///media/CentOS/
        file:///media/cdrom/
        file:///media/cdrecorder/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5

As you can see, you can use the the command  yum --disablerepo=\* --enablerepo=c5-media to install package with local media.  However, you will need to make sure the ISO image is mounted in one of those places mentioned in the .repo file:

/media/CentOS
/media/cdrom
/media/cdrecorder
0
 
LVL 15

Author Closing Comment

by:MMDeveloper
ID: 31598926
fast, precise, fat free, and correct ;)
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

In my business, I use the LTS (Long Term Support) versions of Linux. My workstations do real work, and so I rarely have the patience to deal with silly problems caused by an upgraded kernel that had experimental software on it to begin with from a r…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question