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

The method of configuring local yum source by CentOS8

2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

Today, the editor will share with you the relevant knowledge points about the method of configuring local yum sources in CentOS8. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article.

1. Create a directory

Mkdir / mnt/cdrom

two。 Mount your cdrom file.

2.1 Optical drive mode

Using the method of optical drive, for vmware users, you can directly use the image, as shown in the figure

Sudo mount / dev/cdrom / mnt/cdrom

Then enter the directory, as long as you can list the following files to show that the mount is successful.

2.2 Mount using iso image file

First of all, you have to upload the iso file to your centos, so we can only think of something here. No network flash drive, no USB drive. Anyway, it has to be uploaded to a corresponding directory.

Then use the mount command to mount the file. The difference is whether there is a parameter-o

Mount-o loop / mnt/iso/centos-8-x86_64-1905-dvd1.iso / mnt/cdrom

3 enter the / etc/yum.repos.d directory

Cd / etc/yum.repos.d

4. Open the centos-media.repo file

Sudo vi centos-media.repo

The file is modified in the following way, with six changes

Baseurl, the baseos and appstream directories under the specified mount directory

Gpgcheck does not check

Enabled enables this mirror

3. Mask the default image

Vim enters the following three files, and then modifies enabled=0

It looks like the following, but there is a problem. If you want to install the package using the network in the future, remember to change it here to 1 to re-enable it.

3.yum clean all

Clear cache

Sudo yum clean all

4.yum makecache

Rebuild cache

Sudo yum makecache

5. Result verification

Try searching for any bag.

If there is no problem with yum search openssh, the configuration is ok.

6. Power on and hang the disk automatically

In order to avoid the problem that the mirror source cannot be accessed after reboot. We need to configure the operation of hanging disk in our / etc/fstab file

6.1 use mount-l to view the information of the disk we hung up

You can get five pieces of information from above.

/ dev/cdrom / mnt/cdrom iso9660 defaults 0 0

In fact, it can also be written like this.

/ dev/cdrom / mnt/cdrom autodefaults 0 0

The device name is linked by me. You can fill in sr0 here, but I will write / dev/cdrom.

6.2 configure information into the / etc/fstab file

These are all the contents of this article entitled "how CentOS8 configures local yum sources". Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.

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

Internet Technology

Wechat

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

12
Report