centos常用命令

centos7:

查看centos版本 cat /etc/redhat-release

systemctl status firewalld (查看防火墙状态)

systemctl stop firewalld  (停止防火墙)

systemctl disable firewalld(禁止开机启动)

安装 wget vim

yum -y install wget

yum -y install vim*

更新yum源为阿里云

1、备份

mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup

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

CentOS 5

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

CentOS 6

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

CentOS 7

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

原文地址:https://www.cnblogs.com/yulehuayuan/p/12460840.html