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

相关推荐
scx_link3 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
江华森3 天前
高级 Bash 脚本编程指南 — 实战教程
开发语言·bash
承渊政道3 天前
【MySQL数据库学习】(MySQL表的内外连接)
数据库·学习·mysql·leetcode·bash·数据库开发·数据库系统
hyunbar4 天前
配置 Cloudflare Tunnel:把 Mac 上的 Web 服务变成安全域名
网络协议·https·bash
承渊政道4 天前
【MySQL数据库学习】(MySQL复合查询)
数据库·学习·mysql·bash·database·数据库开发·数据库架构
zh路西法6 天前
【tmux入门】终端分屏、SSH远程守护与一键启动脚本
linux·运维·ssh·bash
承渊政道6 天前
【MySQL数据库学习】(MySQL内置函数)
数据库·学习·mysql·ubuntu·bash·数据库开发·数据库系统
allway26 天前
How to Echo Multiline to a File in Bash [3 Methods]
开发语言·chrome·bash
Dontla6 天前
git bash打开Claude code报错:Claude Code on Windows requires git-bash.(别把git装其他位置,严格按照默认安装)找不到claude code
windows·git·bash
weixin_462446236 天前
手把手教你用 Bash 脚本自动更新 /etc/hosts —— 自动绑定网卡 IP 与节点名
开发语言·tcp/ip·bash