Shell script: Automatically build Yum

Source: Internet
Author: User
Tags yum repolist
1 scripting
[Email protected] ~]# vim/root/yum.sh
Script content:
#!/bin/bash
rm-rf/etc/yum.repos.d/*
echo "[110]
name=110
Baseurl=http://192.168.4.254/rhel7//yum Source to see the actual change, it is best to use the network Yum source, to ensure that each installation host can connect
Enabled=1
Gpgcheck=0 ">/etc/yum.repos.d/110.repo
Yum Clean all &>/dev/null
echo "Yum has been built"
echo "Shared packages:"
Yum Repolist | Tail-1
[Email protected] ~]# chmod +x/root/yum.sh

2 Implementation Results
[Email protected] ~]#./yum.sh
Yum has been built to complete
Total Packages:
repolist:4,620

Shell script: Automatically build Yum

Related Article

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.