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

How to automatically mount the local YUM warehouse program on Shell?

2025-02-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

This article "Shell how to automatically mount the local YUM warehouse program" most people do not understand, so the editor summarized the following content, detailed, clear steps, with a certain reference value, I hope you can get something after reading this article, let's take a look at this "Shell how to automatically mount the local YUM warehouse program" article.

Shell can automatically mount the local YUM warehouse automation program on boot, and you can also use the yum installer without a network.

#! / bin/bash# automatically build yum local warehouse # cdrom () {mount / dev/cdrom / media/cdrom & > / dev/null [$?-eq 0] & & echo "mount successfully"} [- d / media/cdrom] | | mkdir / media/cdrommount | grep-Q / dev/sr0if [$?-eq 0] thenumount / dev/sr0cdromelsecdromfi [- d / etc/yum.repos.d/bak] | | mkdir / etc/yum.repos.d/bakls- L / etc/yum.repos.d/ | grep * repo > / dev/nullif [$?-ne 0] thenecho "moving files to directory" mv / etc/yum.repos.d/*repo bakelseecho "files have moved directories!" Fi [- e / etc/yum.repos.d/centos-media.repo] | | echo "[media] name=CentOS-$releasever-Mediabaseurl= file:///media/cdrom/gpgcheck=0enabled=1" > / etc/yum.repos.d/centos-media.repoecho" clear the yum cache "yum clean all & > / dev/nullecho" YUM has completed the "echo-n" common software package: "yum repolist | tail-1 | awk-fagger''{print $2} 'cat / etc/fstab | grep | / dev/sr0 & > / dev/nullif [$?-ne 0] thenecho is writing the boot auto-mount CD "echo" / dev/sr0 / media/cdrom iso9660 defaults 00 "> > / etc/fstabfi above is the content of this article on" how to enable Shell to automatically mount local YUM repository programs on boot " I believe we all have a certain understanding. I hope the content shared by the editor will be helpful to you. If you want to know more about the relevant 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

Development

Wechat

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

12
Report