Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Install the RPM package when the network is off

2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/02 Report--

Experimental platform: CentOS7

Experimental analysis: the source rpm package in linux system is stored in the official yum repository. Usually, we can call the rpm package in the yum repository at will under the network state, but under the disconnected state, all this is obviously impossible. If we need to install rpm packages, we can only build a temporary yum repository ourselves, which depends on the installation image of the linux operating system. Obviously, there are a lot of rpm packages stored in the installation image, but compared to the yum repository in the network, the rpm packages in the image cannot be upgraded at any time, updated version, etc.

rpm package overview

rpm package is one of the most widely used packages in Linux distributions. rpm package is supported by most Linux distributions and supported by Linux users because of its powerful functions and wide compatibility. Rpm package manager keeps detailed records of rpm packages installed, uninstalled and upgraded in linux systems by establishing a unified file database, and can automatically analyze dependencies between packages to keep applications running in a coordinated and orderly overall environment.

experimental process

First disconnect CentOS7 from the network, set the NIC to host-only mode, and click OK.

Network card mode is host only mode, we need to reconfigure the network card, add ip address, subnet mask, gateway, etc. In Linux terminal, enter command to enter network card configuration

Initial entry to the original interface

Interface after change

After configuration is complete, enter wq in the last row mode to save and exit. After the configuration file is changed, the service must be restarted to take effect.

Enter ifconfig command to see if configuration is successful

This is an error when trying to load yum list. The reason is naturally that it is already in a disconnected state and the client cannot access the official yum repository.

Once the configuration is complete, we move on to the next step, creating a yum repository to install the rpm package, relying on the system image file.

Use df -h command to see if the CD image has been mounted

It's still on the CD, it's not attached.

We need to mount the optical drive, so to use the files in the optical drive, just open the directory where the optical drive is mounted. First find an empty directory as the mount point,/mnt directory is empty directory, can be viewed through ls. The mount command is mount

Use df -h to check whether the mount is successful

Once we are done, we move on to the next step. When installing the system, the yum source is concentrated in one place. After the network is disconnected, these packages cannot be used. We move the packages to an empty folder and use the packages from the CD.

Create a private yum repository

After the configuration is complete, you can use the yum repository. Here, use yum to install the httpd service.

Access website via ip address

successful visit in

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report