CentOS7 设置yum源

1、关闭防火墙

  • 临时关闭防火墙
    systemctl stop firewalld
  • 永久防火墙开机自关闭
    systemctl disable firewalld
  • 临时打开防火墙
    systemctl start firewalld
  • 防火墙开机启动
    systemctl enable firewalld
  • 查看防火墙状态
    systemctl status firewalld

2、关闭selinux 关闭原因 自行google

修改sellinux=disabled :wq保存退出

可能存在的问题:若修改了selinuxtype=disabled的值会导致linux启动失败。

解决方案:

1. 重启时在启动页面,选择你要启动的内核 按 E, 进入 grub 编辑页面。

2. 找到 linux16 那一行,在language 后面 也就是LANG=zh_CN.UTF-8,空格 加上 selinux=0 或者 enforcing=0 (备注:我是加入selinux=0 生效的。)

3. 然后 ctrl + x 启动,就看到熟悉的登录界面。

4 .修改selinux配置文件,正确关闭selinux

解决方案原文:http://www.mamicode.com/info-detail-1847013.html

3、设置域名解析

配置下centos的DNS一个国内,一个国外

vi  /etc/resolv.conf

nameserver 114.114.114.114

nameserver 8.8.8.8

4、安装wget命令,已安装请忽略

命令:yum -y install wget

5、更新yum源配置

5.1、备份下原来的yum源

cd /etc/yum.repos.d/

mv CentOS-Base.repo CentOS-Base.repo_bak

5.2 、设置源网易或阿里云

网易yum源:

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

yum clean all

yum makecache

阿里云yum源:

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

yum clean all

yum makecache

图形方案:https://jingyan.baidu.com/article/215817f7aef2e01eda1423f4.html

yum命令常见问题:

yum install的时候提示:Loaded plugins: fastestmirror(加速插件)

解决方案:

1.修改插件的配置文件

# vi  /etc/yum/pluginconf.d/fastestmirror.conf

enabled = 1//由1改为0,禁用该插件

2.修改yum的配置文件

# vi /etc/yum.conf

plugins=1//改为0,不使用插件

解决方案原文:https://www.cnblogs.com/starof/p/4773209.html

原文地址:https://www.cnblogs.com/lenovo_tiger_love/p/9193472.html

时间: 2024-08-28 12:38:52

CentOS7 设置yum源的相关文章

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:

CentOS 设置 YUM 源

常用镜像 清华大学 https://mirrors.tuna.tsinghua.edu.cn/help/centos/ 生成后需要手动存储 浙江大学 http://mirrors.zju.edu.cn 生成后需要手动存储 重庆大学 http://mirrors.cqu.edu.cn/repo/centos/Centos-5.repo http://mirrors.cqu.edu.cn/repo/centos/Centos-6.repo http://mirrors.cqu.edu.cn/repo

修改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://mi

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   --------创建本地

Centos7 通过yum源安装nginx

通过rpm 添加yum源 rpm -Uvh http://nginx.org/packages/centos/7/noarch/RPMS/nginx-release-centos-7-0.el7.ngx.noarch.rpm 安装 yum -y install nginx 设置启动nginx同时以开机自动运行 systemctl start nginx.service systemctl enable nginx.service 转自:https://www.cnblogs.com/Liang-

Centos-7修改yum源为国内的yum源

以centos7为例 ,以 修改为阿里的yum源 1. 备份本地yum源 [root@localhost yum.repos.d]# cp CentOS-Base.repo CentOS-Base.repo.bak 2.获取阿里yum源配置文件 [root@localhost yum.repos.d]# wget http://mirrors.aliyun.com/repo/Centos-7.repo 3.更新cache yum makecache 4.查看 yum install update

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源为阿里源(大数据预科02_2)

##保证可以上互联网,不知如何联网查看大数据预科02_1 (1).安装wget软件 yum install -y wget 安装完成最后显示Complete,表示安装成功(2). 查看yum源信息: yum repolist 目前yum连接的是国外网站,普通(fq貌似现在管个很严)下载限制多和速度非常!非常!非常慢!(3). 进入安装目录 cd /etc/yum.repos.d (4).备份旧的配置文件 mv CentOS-Base.repo CentOS-Base.repo.bak (5).

centos7 安装yum源

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