Get the App
SLTechnology News&Howtos  ›  Servers  › 

The use of yum cache packages

Shulou Source: shulou.com Published: 2022-06-03 06:21:58 11月12日 Update

[TOC]

The use of yum cache package I. download the rpm package on the Internet

Sometimes we need to install some software, but we need some basic environment. We need to install some basic packages using yum. When we use it online, some servers are offline and cannot be installed using yum. If we do the rpm package ourselves, it will take up a lot of our time and the loss will outweigh the gain. At this time, we can use the cache function of yum to cache the package for us to use.

Yum install-- downloadonly package name

Specify download does not install, view the downloaded cache file, save `/ var/cache/yum by default

For example, if I want to install zabbix, but need a lot of installation packages, I can do this.

Cache package yum install-- downloadonly ntp vim-enhanced gcc gcc-c++\ flex bison autoconf automake bzip2 gzip zip\ bzip2-devel ncurses-devel zlib-devel\ libjpeg-devel libpng-devel libtiff-devel\ unzip net-snmp-devel libXpm-devel gettext-devel\ pam-devel libtool libtool-ltdl openssl openssl-devel\ fontconfig-devel libxml2-devel curl-devel\ libicu libicu-devel

I have cached it here.

/ var/cache/yum/x86_64/7/base/packages

Pack the rpm package

Tar-zcvf zabbix_need_pkg.tar.gz packages/

Take out the bag and use it

Sz zabbix_need_ PKG. Tar.gz II. Use the local rpm package for installation

Extract the package to the specified directory

Rm-rf / var/cache/yum/x86_64/7/base/packagestar xcf zabbix_need_pkg.tar.gz-C / var/cache/yum/x86_64/7/base/packages install the local package yum-C install ntp vim-enhanced gcc gcc-c++\ flex bison autoconf automake bzip2 gzip zip\ bzip2-devel ncurses-devel zlib-devel\ libjpeg-devel libpng-devel libtiff-devel\ unzip net-snmp-devel libXpm-devel gettext-devel\ pam-devel libtool libtool-ltdl openssl openssl-devel\ fontconfig -devel libxml2-devel curl-devel\ libicu libicu-devel-y

Tags: Cache basic the loss outweighs the gain function I want file time time sometimes server to make environment directory software this is online service Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Redmi Linux Huawei vpn Xiaomi