CentOS - HowardWhile/2021_note GitHub Wiki

CentOS

[TOC]

下載rpm包的方法

htop為例

必須在可以聯網的電腦製作

首先啟用 EPEL Repository:

sudo yum -y install epel-release

下載htop

export pkg_name=htop
mkdir $pkg_name 
sudo yum install --installroot=/tmp/yumrepo --releasever=/ --downloadonly --downloaddir=./$pkg_name  $pkg_name 

此時會把htop與相依的rpm通通下載

image-20211207085834403

https://ephrain.net/linux-%E5%9C%A8-centos-%E4%B8%8A%E4%BD%BF%E7%94%A8-yum%EF%BC%8C%E4%B8%8B%E8%BC%89%E6%89%80%E6%9C%89%E7%9B%B8%E9%97%9C%E8%81%AF%E7%9A%84-rpm-%E5%A5%97%E4%BB%B6/

將整個資料夾壓縮方便搬動

zip -r $pkg_name $pkg_name 

Home