CentOS7 设置yum源
1、关闭防火墙
- 临时关闭防火墙
systemctl stop firewalld - 永久防火墙开机自关闭
systemctl disable firewalld - 临时打开防火墙
systemctl start firewalld - 防火墙开机启动
systemctl enable firewalld - 查看防火墙状态
systemctl status firewalld
2、关闭selinux 关闭原因 自行google vi /etc/selinux/config

修改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/ ls
mv CentOS-Base.repo CentOS-Base.repo_bak
5.2 、设置源网易或阿里云
网易yum源:http://mirrors.163.com/.help/centos.html
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.163.com/.help/CentOS7-Base-163.repo
yum clean all
yum makecache
阿里云yum源:http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum clean all
yum makecache
查看已安装yum源:yum repolist all
图形方案: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
6、安装VIM命令,默认未安装
检测是否安装VIM rpm -aq|grep vim
若出现以下命令则未安装 vim-minimal.x86_64 2:7.4.160-4.el7
执行命令,yum -y install vim* 提示安装完毕!
7、检测IP地址 ipaddr show 或ifconfig
提示ifconfig command not found的解决方案:
1、确认sbin目录是否存在 cd /sbin ls
2、不存在执行命令:yum install net-tools
CentOS7 设置yum源的更多相关文章
- [转]centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv CentOS-Base.repo ...
- centos7 修改yum源为阿里源
centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 安装base reop源 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv Cen ...
- 设置yum源:
1.企业 阿里开源镜像站: http://mirrors.aliyun.com/ 搜狐开源镜像站: http://mirrors.sohu.com/ 网易开源镜像站: http://mirr ...
- [问题解决]RedHat7更换CentOS7的yum源时踩过的坑
更换yum源的流程 查看当前yum程序 $ rpm -qa|grep yum 这里推荐将其结果截屏或拷贝出来,以免后面报错修复. 删除原有yum源 $ rpm -aq | grep yum|xargs ...
- Fedora19添加和设置YUM源
Fedora19添加和设置YUM源添加yum源前先安装fastestmirror/downloadonly插件和axelget插件: 1.安装fastestmirror/downloadonly插件 ...
- 修改Centos7的yum源
以下为修改Centos7的yum源: 1. 备份原镜像文件,便于后期恢复 [root@keepmydream ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc ...
- CentOS7搭建yum源仓库(阿里源)
文章目录 注意:环境要求 1.配置服务器端yum 1.1.安装yum源工具 1.2.配置nginx 1.2.1.配置nginx页面目录 1.3.替换yum源文件 1.4.建立yum源仓库 2.配置客户 ...
- 在centos7虚拟机上挂载镜像,并设置yum源(包括遇到的问题)
挂载镜像方法很简单: mkdir /etc/a mount /dev/cdrom /etc/a 查看挂载情况 : df -h 修改yum源文件 : 先把 CentOS-Base.repo 文件名改一 ...
- CentOS7更换yum源为阿里云镜像源
1. 备份原来的yum源 cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2.设置aliyun的y ...
随机推荐
- [Swift]LeetCode267.回文全排列 II $ Palindrome Permutation II
Given a string s, return all the palindromic permutations (without duplicates) of it. Return an empt ...
- [Swift]LeetCode371. 两整数之和 | Sum of Two Integers
Calculate the sum of two integers a and b, but you are not allowed to use the operator + and -. Exam ...
- Python内置函数(26)——globals
英文文档: globals() Return a dictionary representing the current global symbol table. This is always the ...
- Qt之自定义托盘(二)
上一篇文章讲述了自定义Qt托盘,不过不是使用QSystemTrayIcon这个类,而是我们自己完全自定义的一个类,我们只需要处理这个类的鼠标hover.鼠标左键点击.鼠标右键点击和鼠标左键双击,就可以 ...
- phpStrom映射代码
- C# - 2017微软校园招聘笔试题 之 MS Recognition[待解决]
MS Recognition 在线提交: hihoCoder 1402 http://hihocoder.com/problemset/problem/1402 类似: OpenJudge - I:P ...
- 带着萌新看springboot源码11(springboot启动原理 源码上)
通过前面这么多讲解,springboot原理应该也大概有个轮廓了,一些基本的配置,从客户端url到controller(配置一些要用的组件,servlet三大组件,处理器映射器,拦截器,视图解析器这些 ...
- WebAssembly完全入门——了解wasm的前世今身
前言 接触WebAssembly之后,在google上看了很多资料.感觉对WebAssembly的使用.介绍.意义都说的比较模糊和笼统.感觉看了之后收获没有达到预期,要么是文章中的例子自己去实操不能成 ...
- Python:zip 函数的用法
zip() 接受一系列可迭代的对象作为参数,将对象中对应的元素打包成一个个 tuple,然后返回由这些 tuple 组成的 list. 若传入参数的长度不等,则返回 list 的长度和参数中长度最短的 ...
- 使用mongoskin操作MongoDB
mongoskin是一个操作MongoDB的模型工具 相当于数据库类 与之相当的还有mongoose比较出名 安装模块(特地加了版本,这里被坑过,在Ubuntu中开发的好好的,部署到线上centos中 ...