yum源 下载包
1. 需要安装 yum-utilsyum install yum-utils
[root@Xue ~]# rpm -qa | grep yum yum-metadata-parser-1.1.4-10.el7.x86_64 yum-plugin-fastestmirror-1.1.31-42.el7.noarch yum-3.4.3-154.el7.centos.noarch [root@Xue ~]# [root@Xue ~]# yum install yum-utils Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile Resolving Dependencies --> Running transaction check ---> Package yum-utils.noarch 0:1.1.31-54.el7_8 will be installed --> Processing Dependency: python-kitchen for package: yum-utils-1.1.31-54.el7_8.noarch --> Processing Dependency: libxml2-python for package: yum-utils-1.1.31-54.el7_8.noarch --> Running transaction check ---> Package libxml2-python.x86_64 0:2.9.1-6.el7_9.6 will be installed --> Processing Dependency: libxml2 = 2.9.1-6.el7_9.6 for package: libxml2-python-2.9.1-6.el7_9.6.x86_64 ---> Package python-kitchen.noarch 0:1.1.1-5.el7 will be installed --> Processing Dependency: python-chardet for package: python-kitchen-1.1.1-5.el7.noarch --> Running transaction check ---> Package libxml2.x86_64 0:2.9.1-6.el7_2.3 will be updated ---> Package libxml2.x86_64 0:2.9.1-6.el7_9.6 will be an update ---> Package python-chardet.noarch 0:2.2.1-3.el7 will be installed --> Finished Dependency Resolution Dependencies Resolved =============================================================================================================================================== Package Arch Version Repository Size =============================================================================================================================================== Installing: yum-utils noarch 1.1.31-54.el7_8 base 122 k Installing for dependencies: libxml2-python x86_64 2.9.1-6.el7_9.6 updates 247 k python-chardet noarch 2.2.1-3.el7 base 227 k python-kitchen noarch 1.1.1-5.el7 base 267 k Updating for dependencies: libxml2 x86_64 2.9.1-6.el7_9.6 updates 668 k Transaction Summary =============================================================================================================================================== Install 1 Package (+3 Dependent packages) Upgrade ( 1 Dependent package) Total download size: 1.5 M Is this ok [y/d/N]: y Downloading packages: Delta RPMs disabled because /usr/bin/applydeltarpm not installed. (1/5): python-kitchen-1.1.1-5.el7.noarch.rpm | 267 kB 00:00:00 (2/5): python-chardet-2.2.1-3.el7.noarch.rpm | 227 kB 00:00:00 (3/5): yum-utils-1.1.31-54.el7_8.noarch.rpm | 122 kB 00:00:00 (4/5): libxml2-python-2.9.1-6.el7_9.6.x86_64.rpm | 247 kB 00:00:00 (5/5): libxml2-2.9.1-6.el7_9.6.x86_64.rpm | 668 kB 00:00:00 ----------------------------------------------------------------------------------------------------------------------------------------------- Total 5.7 MB/s | 1.5 MB 00:00:00 Running transaction check Running transaction test Transaction test succeeded Running transaction Updating : libxml2-2.9.1-6.el7_9.6.x86_64 1/6 Installing : libxml2-python-2.9.1-6.el7_9.6.x86_64 2/6 Installing : python-chardet-2.2.1-3.el7.noarch 3/6 Installing : python-kitchen-1.1.1-5.el7.noarch 4/6 Installing : yum-utils-1.1.31-54.el7_8.noarch 5/6 Cleanup : libxml2-2.9.1-6.el7_2.3.x86_64 6/6 Verifying : python-chardet-2.2.1-3.el7.noarch 1/6 Verifying : libxml2-2.9.1-6.el7_9.6.x86_64 2/6 Verifying : libxml2-python-2.9.1-6.el7_9.6.x86_64 3/6 Verifying : python-kitchen-1.1.1-5.el7.noarch 4/6 Verifying : yum-utils-1.1.31-54.el7_8.noarch 5/6 Verifying : libxml2-2.9.1-6.el7_2.3.x86_64 6/6 Installed: yum-utils.noarch 0:1.1.31-54.el7_8 Dependency Installed: libxml2-python.x86_64 0:2.9.1-6.el7_9.6 python-chardet.noarch 0:2.2.1-3.el7 python-kitchen.noarch 0:1.1.1-5.el7 Dependency Updated: libxml2.x86_64 0:2.9.1-6.el7_9.6 Complete! [root@Xue ~]#2 . 使用 yumdownloader 包名 ##下载到当前目录
[root@Xue ~]# yumdownloader gcc Loaded plugins: fastestmirror Loading mirror speeds from cached hostfile gcc-4.8.5-44.el7.x86_64.rpm | 16 MB 00:00:00 [root@Xue ~]# ll total 16572 -rw-r--r-- 1 root root 16963328 Oct 15 2020 gcc-4.8.5-44.el7.x86_64.rpm [root@Xue ~]#



