This commit is contained in:
47
Docs/Centos配置本地Yum源.md
Normal file
47
Docs/Centos配置本地Yum源.md
Normal file
@@ -0,0 +1,47 @@
|
||||
> 本文作者:丁辉
|
||||
|
||||
# Centos配置本地Yum源
|
||||
|
||||
1. 进入目录
|
||||
|
||||
```bash
|
||||
cd /etc/yum.repos.d/
|
||||
```
|
||||
|
||||
2. 移走其他文件
|
||||
|
||||
```bash
|
||||
mkdir /opt/yum
|
||||
mv * /opt/yum
|
||||
```
|
||||
|
||||
3. 创建文件并编写内容
|
||||
|
||||
```bash
|
||||
vi yum.repo
|
||||
```
|
||||
|
||||
内容如下
|
||||
|
||||
```bash
|
||||
[name]
|
||||
name=yum
|
||||
baseurl=file:///mnt/
|
||||
gpgcheck=0
|
||||
enabled=1
|
||||
```
|
||||
|
||||
4. 挂载镜像DVD
|
||||
|
||||
```bash
|
||||
mount /dev/cdrom /mnt/
|
||||
```
|
||||
|
||||
5. 清理缓存
|
||||
|
||||
```bash
|
||||
yum clean all
|
||||
yum makecache
|
||||
```
|
||||
|
||||
|
Reference in New Issue
Block a user