Solved

Centos 5 Package Manager, with no internet

Posted on 2009-07-01
2
939 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
2 Comments
 
LVL 5

Accepted Solution

by:
JohnmenZ earned 500 total points
Comment Utility
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
Comment Utility
fast, precise, fat free, and correct ;)
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

After running Ubuntu some time, you will be asked to download updates for fixing bugs and security updates. All the packages you download replace the previous ones, except for the kernel, also called "linux-image". This is due to the fact that w…
Introduction We as admins face situation where we need to redirect websites to another. This may be required as a part of an upgrade keeping the old URL but website should be served from new URL. This document would brief you on different ways ca…
Connecting to an Amazon Linux EC2 Instance from Windows Using PuTTY.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now