修改Centos7的yum源

以下为修改Centos7的yum源:

1. 备份原镜像文件,便于后期恢复

[[email protected] ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

2.下载新的CentOS-Base.repo 到/etc/yum.repos.d/

Centos6 阿里云yum源地址:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-6.repo

Centos7 阿里云yum地址:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo

Centos6 163yum源地址:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS6-Base-163.repo

Centos7 163yum源地址:

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo

3. 清除缓存

yum clean all

4. 生成缓存

yum makecache

如果提示另外一个程序已经存在,使用kill -9 加进程ID杀掉线程。再运行一次yum makecache

原文地址:https://www.cnblogs.com/leelice/p/12299932.html

时间: 2024-08-29 06:40:36

修改Centos7的yum源的相关文章

修改CentOS默认yum源为国内yum镜像源

修改CentOS默认yum源为mirrors.163.com 1.首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.进入yum源配置文件所在的文件夹 cd /etc/yum.repos.d/ 3.下载163的yum源配置文件到上面那个文件夹内 CentOS7 wget http://mir

centos7 本地yum源

使用光盘镜像作为软件yum源: [1]上传centos7光盘镜像到/usr/local/src目录下:(工具Xftp) [2]挂载系统文件 mkdir /media/cdrom   # 习惯用这个目录名称了: cd /usr/local/src ls CentOS-7.0-1406-x86_64-DVD.iso # mount -t iso9660 -o loop /usr/local/src/CentOS-7.0-1406-x86_64-DVD.iso /media/cdrom/ mount:

CentOS7 设置yum源

1.关闭防火墙 临时关闭防火墙 systemctl stop firewalld 永久防火墙开机自关闭 systemctl disable firewalld 临时打开防火墙 systemctl start firewalld 防火墙开机启动 systemctl enable firewalld 查看防火墙状态 systemctl status firewalld 2.关闭selinux 关闭原因 自行google 修改sellinux=disabled :wq保存退出 可能存在的问题:若修改了

centos7 安装yum源

centos7的服务器,没有yum,没有wget命令真的寸步难行,经过总结和查询,现在算搞定了,把经验总结一下,以免大家再浪费时间去找原因: 安装yum需要wget安装yum的rpm包,所以前提是先有wget,服务器上没有wget的包怎么办,就去国内的镜像源去找,我这里是找的网易163的,http://mirrors.163.com/centos/7/os/x86_64/Packages/ 需要什么从里面找到下载下来就好了,注意了,如果你看到别人的博客,给了一个例子,你去下载,发现包不存在,那就

CentOS7本地yum源搭建

CentOS 7基于HTTP的本地yum源 [[email protected] ~]# yum install  httpd [[email protected] ~]# systemctl  status httpd[[email protected] ~]# yum update && yum install createrepo [[email protected] ~]# mkdir -p /var/www/html/repos/centos/7/0   --------创建本地

CentOS-7 本地yum源挂载

在Linux无法连接到互联网时,手动安装依赖是及其麻烦的一件事,需要花费大量的时间寻找rpm包.但在配置本地yum源后,绝决依赖问题就会变得非常简单. 一.准备 centos-7.ISO镜像文件: 二.本地yum源挂载. 加载镜像文件到虚拟机: 开启虚拟机,查看镜像文件是否挂载成功: 删除Centos7自带的yum仓库,在root用户下进行操作: 配置本地yum源,在当前目录下创建base.repo文件: [base] name=Base enabled=1 # 允许使用yum配置 baseur

Centos7 更改yum源与更新系统

[1] 首先备份 /etc/yum.repos.d/CentOS-Base.repo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup [2] 进入yum源配置文件所在文件夹 [[email protected] yum.repos.d]# cd /etc/yum.repos.d/ [3] 下载163的yum源配置文件,放入/etc/yum.repos.d/ [[email protecte

修改Centos默认yum源换成国内源

1.首先备份系统自带yum源配置文件/etc/yum.repos.d/CentOS-Base.repo [[email protected] ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup 2.进入yum源配置文件所在的文件夹 [[email protected] ~]# cd /etc/yum.repos.d/ 3.下载163的yum源配置文件到上面那个文件夹内 CentOS7

centos7 更换yum源为阿里云

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo yum makecache