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

相关推荐
longzhizhui9266 天前
Ubuntu 全版本 CVE-2026-98432 内核安全升级操作手册
ubuntu·网络安全·云计算·bash
行走的陀螺仪8 天前
Claude Code 从入门到实战(二):Bash工具、Plan模式与后台任务
开发语言·bash
SEO_juper11 天前
Bash 交叉验证 robots.txt 和 sitemap:两个文件自相矛盾,页面永远收录不了
开发语言·python·node.js·json·bash
无足鸟ICT12 天前
【RHCA+】type命令(判断命令类型)
linux·ssh·bash
SEO_juper14 天前
Node.js 重定向链检测工具:301 跳了几跳、有没有成环,一次看清
xml·开发语言·python·node.js·json·bash
云计算练习生14 天前
什么是 Bash?Linux 默认 Shell 的核心功能
linux·操作系统·bash·shell·命令解释器
qetfw16 天前
Bash 函数与流程控制:read、if、for、case 验证
linux·前端·javascript·bash
qetfw17 天前
Bash 基础:脚本执行、引号与命令替换验证
linux·开发语言·chrome·bash
qetfw18 天前
Bash 变量:export、位置参数与默认值展开验证
linux·开发语言·chrome·bash
ZYH_060118 天前
rhcsa课程复习题
服务器·bash