linux配置清华大学镜像
时间: 2024-12-25 16:07:41 浏览: 87
在Linux系统中,配置清华大学镜像通常用于加快软件包、更新和下载速度。这里是一个简单的步骤指南:
1. **安装`apt-get`或`yum`**:
- 对于基于Debian的系统(如Ubuntu、Linux Mint),使用`apt`:
```
sudo apt-get update
```
- 对于基于Red Hat的系统(如CentOS、Fedora),使用`yum`:
```
sudo yum makecache fast
```
2. **切换到清华源**:
- Debian/Ubuntu用户可以编辑`sources.list`文件,添加以下行:
```
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ <RELEASE> main restricted universe multiverse
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ <RELEASE> main restricted universe multiverse
deb http://mirrors.tuna.tsinghua.edu.cn/debian/ stable main contrib non-free
deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ stable main contrib non-free
```
- CentOS/Fedora用户则编辑`etc/yum.repos.d/*.repo`文件,添加类似下面的内容:
```
[base]
name=Base
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/<RELEASE>/os/$basearch/
gpgcheck=0
enabled=1
[epel]
name=EPEL $releasever - $basearch
mirrorlist=https://mirrors.tuna.tsinghua.edu.cn/epel/$basearch/$releasever镜子列表
gpgkey=https://mirrors.tuna.tsinghua.edu.cn/epel/RPM-GPG-KEY-EPEL-$basearch
enabled=1
```
3. **更新软件列表**:
```
sudo apt-get update (对于apt) 或者
sudo yum check-update (对于yum)
```
4. **开始安装软件**:
此时你可以直接使用`apt-get install <package>`或`yum install <package>`命令安装软件。
记得将`<RELEASE>`替换为你系统的实际版本,例如`bionic`、`centos7`等。
阅读全文
相关推荐


















