linux下网络yum如何删除
时间: 2023-11-04 22:04:59 浏览: 82
您可以使用以下命令删除yum源:
1.使用命令查看yum源
yum repolist
2.禁用指定repo源
yum-config-manager --disable [repo源名字]
3.启用指定repo源
yum-config-manager --enable [repo源名字]
4.删除指定repo源
yum-config-manager --remove [repo源名字]
相关问题
Linux如何网络yum
在Linux中,使用yum命令安装软件包是非常方便的,但是有时候我们需要从网络上安装软件包。下面是网络yum的步骤:
1. 使用root用户登录Linux系统。
2. 打开终端,运行以下命令:
```
vi /etc/yum.repos.d/CentOS-Base.repo
```
3. 在打开的文件中,找到[base]、[updates]、[extras]和[centosplus]部分,并将其中的baseurl选项改为如下所示:
```
baseurl=http://mirrors.aliyun.com/centos/$releasever/os/$basearch/
```
4. 保存并退出该文件。
5. 运行以下命令:
```
yum clean all
```
该命令是清除yum的缓存,以便重新加载镜像源。
6. 运行以下命令:
```
yum makecache
```
该命令是重新生成yum的缓存,以便从新的镜像源中获取软件包信息。
7. 现在,您可以使用yum命令从网络上安装软件包了。例如,如果您要安装Apache Web服务器,请运行以下命令:
```
yum install httpd
```
在运行该命令之前,请确保您已经成功连接到网络,并且可以访问新的镜像源。
linux配置网络yum源
配置yum源可以让linux系统更快更好地下载和安装软件。可以通过修改/etc/yum.repos.d/目录下的配置文件来配置yum源。
首先备份配置文件:
```
$ sudo cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
```
然后使用文本编辑器打开配置文件:
```
$ sudo nano /etc/yum.repos.d/CentOS-Base.repo
```
找到[base]和[updates]下面的baseurl,将其改为需要使用的yum源地址,保存并退出。
最后运行以下命令更新yum缓存:
```
$ sudo yum clean all
$ sudo yum makecache
```
现在就可以使用新的yum源进行安装和更新了。
阅读全文
相关推荐















