yum离线包下载安装

离线rpm

yum install -y vim nano htop net-tools wget curl git traceroute mtr nmap tcpdump telnet nc tree psmisc procps-ng lsof lshw dmidecode lscpu lsblk lspci parted gdisk fdisk smartmontools ncdu zip unzip bzip2 xz gcc make cmake openssh-server openssh-clients chrony logrotate cronie yum-utils bash-completion tmux screen

tar -zcvf

1

Createrepo filepath

2

cat > "/etc/yum.repos.d/1".repo << EOF

offline

name=Offline Local Repository

baseurl=file://filepath

enabled=1

gpgcheck=0

priority=1

protect=0

metadata_expire=never

skip_if_unavailable=0

EOF

mkdir -p /etc/yum.repos.d/backup

4

.

mv /etc/yum.repos.d/*.repo /etc/yum.repos.d/backup/ 2>/dev/null || true

mv "1.repo" /etc/yum.repos.d/

sudo yum clean all

sudo yum makecache

相关推荐
阿常呓语12 小时前
Bash `readonly` 详解:只读变量、数组与函数
bash·linux command
IMPYLH2 天前
Linux 的 mktemp 命令
linux·运维·服务器·bash
拾贰_C2 天前
【Claude Code | bash | install】安装Claude Code
开发语言·bash
程序员小崔日记3 天前
一个命令救命:GitHub 爆火项目 thefuck,真把我笑服了
github·bash·开发者·宝藏项目
IMPYLH3 天前
Linux 的 mkdir 命令
linux·运维·服务器·bash
zhaoshuzhaoshu3 天前
Bash 与 Dash 的区别与联系
开发语言·bash·dash
IMPYLH3 天前
Linux 的 mkfifo 命令
linux·运维·服务器·bash
IMPYLH4 天前
Linux 的 ls 命令
linux·运维·服务器·bash
IMPYLH5 天前
Linux 的 logname 命令
linux·运维·服务器·bash
IMPYLH5 天前
Linux 的 ln 命令
linux·运维·服务器·bash