[Linux]挂载本地yum源 脚本

! /bin/bash
echo '[cdrom]' > /etc/yum.repos.d/cdrom.repo
echo 'name=cdrom' >> /etc/yum.repos.d/cdrom.repo
echo 'baseurl=file:///mnt' >> /etc/yum.repos.d/cdrom.repo
echo 'enable=1' >> /etc/yum.repos.d/cdrom.repo
echo 'gpgcheck=0' >> /etc/yum.repos.d/cdrom.repo
mount /dev/cdrom /mnt
yum list
echo 'Done!'

posted @ 2020-11-02 13:22  SkyBiuBiu  阅读(397)  评论(0编辑  收藏  举报