You've already forked www.colben.cn
update
This commit is contained in:
46
content/post/yum.md
Normal file
46
content/post/yum.md
Normal file
@@ -0,0 +1,46 @@
|
||||
---
|
||||
title: "Yum 笔记"
|
||||
date: 2019-10-30T12:49:22+08:00
|
||||
lastmod: 2019-10-30T12:49:22+08:00
|
||||
tags: ["yum", "repo", "iso"]
|
||||
categories: ["os"]
|
||||
---
|
||||
|
||||
# CentOS 配置本地 ISO 镜像源
|
||||
### 上传 iso 文件
|
||||
- 上传 CentOS7 的 DVD iso 镜像文件到目标服务器,例如 /home/centos7.4.iso
|
||||
|
||||
### 挂载 iso 文件
|
||||
- 挂载该 iso 文件到操作系统的一个空目录中,例如 /mnt/ 下
|
||||
```bash
|
||||
mount -o loop /home/centos7.4.iso /mnt/
|
||||
```
|
||||
|
||||
### 修改软件源文件
|
||||
- 备份全部的 .repo 文件
|
||||
```bash
|
||||
cd /etc/yum.repos.d/
|
||||
ls *.repo|xargs -i mv {} {}_bak
|
||||
```
|
||||
- 创建 centos-base.repo 空文件,写入下面几行
|
||||
```
|
||||
[base]
|
||||
name=centos iso
|
||||
baseurl=file:///mnt/
|
||||
enabled=1
|
||||
gpgcheck=0
|
||||
```
|
||||
|
||||
### 重新创建 yum 缓存
|
||||
- 清空以前的 yum cache
|
||||
```bash
|
||||
yum clean all
|
||||
```
|
||||
- 生成新的 yum 缓存
|
||||
```bash
|
||||
yum makecache fast
|
||||
```
|
||||
|
||||
### 其他 yum 源汇总
|
||||
- [pkgs.org](https://pkgs.org/)
|
||||
|
Reference in New Issue
Block a user