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

相关推荐
IMPYLH2 天前
Linux 的 basename 命令
linux·运维·服务器·ssh·bash
IMPYLH3 天前
Linux 的 b2sum 命令
linux·运维·服务器·bash
波特率1152003 天前
bash命令进阶学习(Shell 元字符)
linux·bash·shell
knighthood20014 天前
ROS1中source xxx.bash失效
开发语言·bash
IMPYLH4 天前
Bash 的 basenc 命令
linux·运维·服务器·bash·shell
IMPYLH4 天前
Linux 的 arch 命令
linux·运维·服务器·bash
Be for thing4 天前
Bash 编程语法
学习·bash
IMPYLH5 天前
Linux 的 base64 命令
linux·运维·服务器·bash·shell
IMPYLH5 天前
Linux 的 base32 命令
linux·运维·服务器·bash·shell
LuL_Vegetable5 天前
写一个Linux服务器自动tcpdum抓包脚本
linux·wireshark·bash·tcpdump