centos查看默认下载源
时间: 2023-07-26 10:14:11 浏览: 132
要查看当前 CentOS 系统的默认软件源,可以执行以下命令:
```bash
yum repolist all
```
该命令将会列出所有的仓库,其中标注了 enabled 和 disabled 状态。您可以找到 CentOS 的默认仓库,例如:
```bash
repo id repo name status
base/7/x86_64 CentOS-7 - Base enabled
epel/x86_64 Extra Packages for Enterprise Linux enabled
extras/7/x86_64 CentOS-7 - Extras enabled
updates/7/x86_64 CentOS-7 - Updates enabled
```
在上面的输出中,`base` 仓库是 CentOS 7 的默认仓库之一,其中包含了 CentOS 7 的核心软件包。
相关问题
centos查看默认软件下载源
要查看 CentOS 系统默认的软件下载源,可以执行以下命令:
```bash
cat /etc/yum.repos.d/CentOS-Base.repo | grep baseurl
```
该命令将显示 CentOS 7 默认的软件源的下载地址,例如:
```bash
baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
```
在上面的输出中,`baseurl` 指定了 CentOS 7 的默认软件源的下载地址。你也可以通过编辑 `/etc/yum.repos.d/CentOS-Base.repo` 文件来更改 CentOS 7 的默认软件源下载地址。
centos恢复默认源
你可以按照以下步骤恢复CentOS默认源:
1.备份原来的yum源文件:
```
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
```
2.下载新的CentOS-Base.repo文件:
```
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirror.centos.org/centos/7/os/x86_64/Packages/CentOS-Base.repo
```
3.清除yum缓存:
```
yum clean all
```
4.生成yum缓存:
```
yum makecache
```
这样就可以恢复CentOS默认源了。