Solved

Centos 5 Package Manager, with no internet

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

Ransomware-A Revenue Bonanza for Service Providers

Ransomware – malware that gets on your customers’ computers, encrypts their data, and extorts a hefty ransom for the decryption keys – is a surging new threat.  The purpose of this eBook is to educate the reader about ransomware attacks.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Printing to old printer through Linux (CUPS) Print Server? 7 48
CentOS 7 Installation 7 60
Hacked File Timestamps 4 50
linux redhat 7.2 10 46
Little introduction about CP: CP is a command on linux that use to copy files and folder from one location to another location. Example usage of CP as follow: cp /myfoder /pathto/destination/folder/ cp abc.tar.gz /pathto/destination/folder/ab…
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…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
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…

867 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