yum下载系统已经安装的rpm包

下载系统已经安装的rpm包

下载系统已经安装的rpm包

yum -y install yum-utils #安装yum下载工具

yumdownloader mysql #用yum下载到当前目录

实例:

查询mysql安装包

[root@localhost ~]# rpm -qa | grep mysql
mysql-community-libs-5.6.28-2.el6.x86_64
mysql-community-server-5.6.28-2.el6.x86_64
mysql-community-client-5.6.28-2.el6.x86_64
mysql57-community-release-el6-7.noarch
mysql-community-common-5.6.28-2.el6.x86_64

安装工具

yum -y install yum-utils

下载rpm包

yumdownloader mysql-community-libs
yumdownloader mysql-community-server
yumdownloader mysql-community-client
yumdownloader mysql57-community-release
yumdownloader mysql-community-common

安装到其他服务器上

yum -y install localinstall ./*

下载最新内核

#添加yum源仓库
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo 
curl -o /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

#更新yum源仓库
yum -y update

#查看可用的系统内核包
yum --disablerepo="*" --enablerepo="elrepo-kernel" list available

# 下载指定内核
yumdownloader kernel-lt-5.4.179       --enablerepo=elrepo-kernel
posted @ 2022-06-17 14:21  鸣昊  阅读(973)  评论(0编辑  收藏  举报