Solved

Centos 5 Package Manager, with no internet

Posted on 2009-07-01
2
951 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
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

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

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

I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
It’s 2016. Password authentication should be dead — or at least close to dying. But, unfortunately, it has not traversed Quagga stage yet. Using password authentication is like laundering hotel guest linens with a washboard — it’s Passé.
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…
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.:

770 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