?
Solved

Centos 5 Package Manager, with no internet

Posted on 2009-07-01
2
Medium Priority
?
991 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 2000 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
Suggested Courses
Course of the Month12 days, 14 hours left to enroll

777 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