In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces the relevant knowledge of "how to use shell to automatically mount the local YUM warehouse program". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
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 the 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.repo echo" clear the yum cache "yum clean all & > / dev/nullecho" YUM has completed the "echo-n" common software package: "yum repolist | tail-1 | awk-favored virtual'{print $2} 'cat / etc/fstab | | grep / dev/sr0 & > / dev/nullif [$?-ne 0] thenecho "writing the boot auto mount CD" echo "/ dev/sr0 / media/cdrom iso9660 defaults 00" > > / etc/fstabfi "how to use shell to automatically mount the local YUM repository program" ends here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
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.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.