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源的更多相关文章

  1. [转]centos7 修改yum源为阿里源

    centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv CentOS-Base.repo ...

  2. centos7 修改yum源为阿里源

    centos7 修改yum源为阿里源,某下网络下速度比较快 首先是到yum源设置文件夹里 安装base reop源 cd /etc/yum.repos.d 接着备份旧的配置文件 sudo mv Cen ...

  3. 设置yum源:

    1.企业    阿里开源镜像站:   http://mirrors.aliyun.com/ 搜狐开源镜像站: http://mirrors.sohu.com/ 网易开源镜像站: http://mirr ...

  4. [问题解决]RedHat7更换CentOS7的yum源时踩过的坑

    更换yum源的流程 查看当前yum程序 $ rpm -qa|grep yum 这里推荐将其结果截屏或拷贝出来,以免后面报错修复. 删除原有yum源 $ rpm -aq | grep yum|xargs ...

  5. Fedora19添加和设置YUM源

    Fedora19添加和设置YUM源添加yum源前先安装fastestmirror/downloadonly插件和axelget插件: 1.安装fastestmirror/downloadonly插件 ...

  6. 修改Centos7的yum源

    以下为修改Centos7的yum源: 1. 备份原镜像文件,便于后期恢复 [root@keepmydream ~]# mv /etc/yum.repos.d/CentOS-Base.repo /etc ...

  7. CentOS7搭建yum源仓库(阿里源)

    文章目录 注意:环境要求 1.配置服务器端yum 1.1.安装yum源工具 1.2.配置nginx 1.2.1.配置nginx页面目录 1.3.替换yum源文件 1.4.建立yum源仓库 2.配置客户 ...

  8. 在centos7虚拟机上挂载镜像,并设置yum源(包括遇到的问题)

    挂载镜像方法很简单: mkdir /etc/a mount /dev/cdrom /etc/a 查看挂载情况  : df -h 修改yum源文件 : 先把 CentOS-Base.repo 文件名改一 ...

  9. CentOS7更换yum源为阿里云镜像源

    1. 备份原来的yum源 cp /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak 2.设置aliyun的y ...

随机推荐

  1. [Swift]LeetCode206. 反转链表 | Reverse Linked List

    Reverse a singly linked list. Example: Input: 1->2->3->4->5->NULL Output: 5->4-> ...

  2. [Swift]LeetCode221. 最大正方形 | Maximal Square

    Given a 2D binary matrix filled with 0's and 1's, find the largest square containing only 1's and re ...

  3. [Swift]LeetCode829. 连续整数求和 | Consecutive Numbers Sum

    Given a positive integer N, how many ways can we write it as a sum of consecutive positive integers? ...

  4. [Swift]LeetCode910. 最小差值 II | Smallest Range II

    Given an array A of integers, for each integer A[i] we need to choose either x = -K or x = K, and ad ...

  5. [Swift]LeetCode986. 区间列表的交集 | Interval List Intersections

    Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order ...

  6. SpringCloud(7)---网关概念、Zuul项目搭建

    SpringCloud(7)---网关概念.Zuul项目搭建 一.网关概念 1.什么是路由网关 网关是系统的唯一对外的入口,介于客户端和服务器端之间的中间层,处理非业务功能 提供路由请求.鉴权.监控. ...

  7. Android:剖析源码,随心所欲控制Toast显示

    前言 Toast相信大家都不会陌生吧,如果对于Toast不甚了解,可以参考我的上一篇博客<Android:谈一谈安卓应用中的Toast情节>,里面有关于Toast基础比较详细的介绍.但是如 ...

  8. 爬虫入门(三)——动态网页爬取:爬取pexel上的图片

    Pexel上有大量精美的图片,没事总想看看有什么好看的自己保存到电脑里可能会很有用 但是一个一个保存当然太麻烦了 所以不如我们写个爬虫吧(๑•̀ㅂ•́)و✧ 一开始学习爬虫的时候希望爬取pexel上的 ...

  9. 不能ssh连接ubuntu linux 服务器 secureCRT不能ssh连接服务器 不能远程ssh连接虚拟机的ubuntu linux

    我是用的是secureCRT,远程连接我的虚拟机里面的ubuntu 直接报错,连接不上 1,先分别在windows上ipconfig和ubuntu上ifconfig下 互ping一下,是可以ping通 ...

  10. 强大的jupyter,python开发者的福音

    jupyter是一种交互式计算和开发环境的笔记,ipython命令行比原生的python命令行更加友好和高效,还可以运行web版的界面,支持多语言,输出图形.音频.视频等功能. 一.安装 pip3 i ...