在yum源上
centos6默认是从官方源下载rpm包的,由于是国外的yum源很慢不能用,CentOS7在这里做了优化,当我们使用yum安装软件的时候,默认不会再从官方下载,而是自动寻找离自己地理位置最近的yum源开始下载。
在最小安装中,体积较小了
如果在安装系统的时候选择minimal,会比之前6的时候以更小的包来安装,比如:vim、ifconfig、route、setup、netstat等等很多命令都没有了。。在安装系统后可加入以下软件包:
yum install lrzsz tree net-tools nmap vim bash-completion lsof dos2unix nc telnet ntp wget rng-tools psmisc screen -y
#lrzsz 支持windowns平台的上传下载linux。在windowns远程连接工具上可以使用。
# net-tools CentOS 7.2.11 默认没有ifconfig命令。net-tools提供一些网络命令。
# bash-completion 自动命令补全的工具。
# rng-tools 生成随机数嫡池的一个工具,有了这个工具tomcat 启动会变得非常快。
# psmisc 这个包含有killall命令。
# screen 可以新建一个窗口,把任务放在后台运行。
防火墙及内核版本区别
Centos 6.x
防火墻 iptables
内核版本 2.6.x-x
默认数据库 mysql
centos 7.x
防火墙 firewalld
内核版本 3.10.x-x
默认数据库 maridb
在时间同步和修改时区,修改语言中,存在区别
Centos 6.x
时间同步 ntpq -p
修改时区 /etc/sysconfig/clock
修改语言 /etc/sysconfig/i18n
centos 7.x
时间同步 chronyc sources
修改时区 timedatectl set-timezone Asia/Shanghai
修改语言 localctl set-local LANG=zh_CN.UTF-8
主机名的配置文件位置及修改方式不同
主机名
centos 6配置文件 /etc/sysconfig/network
centos 7配置文件/etc/hostname
centos 7使用命令永久设置 hostnamectl set-hostname hbk.com
查看所有服务状态
centos 6使用 service --status-all
centos 7使用 systemctl list-units
查看所有服务自启动状态
centos 6使用 chkconfig --list
centos 7使用systemctl list-unit-files
还有一堆判断服务是否开机自启,启动,或失败等
在网络设置方面
centos6使用 ifconfig/setup,默认使用network服务
centos7使用 ip/nmtui,默认使用NetManager服务
centos7中/etc/rc.d/rc.local需要执行如下命令赋予可执行权限
chmod +x /etc/rc.d/rc.local
配置yum源
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo