Install RPM package in LAN yum

Source: Internet
Author: User


Linux beginners

Just getting started with RPM
Package dependency is a headache. Learned to use
Yum
It is a good thing to solve the dependency, but when we
Linux
What if the system is not connected to the Internet? Can it be automatically installed?
?

Of course there is a solution.

I. First, set the RPM of the CD
All packages are copied to the hard disk,
Xxx
Directory.
/Var/FTP/RPM
In this way, it makes it easier for others to connect;

2. Install createrepo
And
Yum
These two tools

# Rpm-IVH createrepo-0.4.11-3.el5.noarch.rpm

# Rpm-IVH yum-3.2.19-18.el5.noarch.rpm

# Createrepo/var/FTP/RPM

III,
Edit configuration file

# Cd/etc/yum. Repos. d/

# Cp rhel-debuginfo.repo local. Repo // The name can not start with the suffix must be
Repo

# Vi local. Repo

[Yum] # Name
Rhel-debuginfo.repo
Repeat it.



Name = Yum install # The name is also self-explanatory



Baseurl = file: // var/FTP/RPM # Here is the storage path of our installation package.
"///"



Enabled = 1 #1 is enabled
0
Yes



Gpgcheck = 0 # Here is the red hat check package consistency Option



Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release # Check the above through this file

IV,
Finally, execute the following command:

# Yum clean all


# Yum list

Output result:

Yum list


Loaded plugins: rhnplugin, security


This system is not registered with RHN.


RHN support will be disabled.


Yum | 951 B 00: 00


Primary.xml.gz | 812 KB


The yum 2361/2361

Server
Created successfully!

Start FTP
Service!

5. Set the client in the LAN

1. Install
Yum
Package

2./etc/yum. repo/create a file suffix
Repo
File

The content is basically the same as that of the server. You can modify the content as needed.

[Yum]

Name = Yum install


Baseurl = ftp: // 172.16.0.9/RPM # This is the only change you need.
FTP
Okay.



Enabled = 1


Gpgcheck = 0


Gpgkey = file: // etc/pki/rpm-GPG-key-RedHat-release

3.
Run
Yum clean all and
Yum list

All set!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.