网络yum源下载

思路一:

按照本地网罗源,然后使用reposync直接将源同步下载到本地

wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo

yum makecache fast

reposync -r epel -p /var/ftp/epel/

createrepo /var/ftp/epel/

 

思路二:

使用wget直接把整个源下载下来

注意:–cut-dirs=1 ,wget中这个参数指定的是目录的层级,按需来指定,我想要的软件包和仓库文件都在一层,所以参数1就够了。

mkdir -p /var/ftp/zabbix

wget -m -c -np -nH --cut-dirs=1 -e robots=off https://mirror.tuna.tsinghua.edu.cn/zabbix/zabbix/5.2/rhel/7/x86_64/ -P /var/ftp/zabbix

 

附:wget --help

 

 

参考链接:https://blog.csdn.net/qq_43152344/article/details/112212991

posted @ 2022-10-29 21:50  咿呀哒喏  阅读(765)  评论(0编辑  收藏  举报