Centos 7.X 安装及常规设置
一、制作USBHDD+启动
需要工具:
UltraISO(软碟通)
U盘
centos7镜像: http://www.centos.org
二、安装(有坑)
U盘启动电脑,进入安装界面:
选中第一项,直接安装会报错!
原因:LABEL=CentOS\x207\x20x86_64 这个卷标长度超过了windows系统允许的长度,所以你制作U盘启动的时候你卷标没有成为CentOS 7 x86_64,因而系统因找不到安装源而报错。
按下TAB后,可以看到install的参数:
vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 rd.live.check quiet
-
解决办法一:
Windows下改短卷标,并把 "LABEL=CentOS\x207\x20x86_64" 改为 "LABEL=更改后的卷标" -
解决办法二:
选中第一项按“TAB”(选第二项按“e”)编辑路径:
将vmlinuz initrd=initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet
改成
vmlinuz initrd=initrd.img linux dd
在结果中找出你u盘盘符,一般为:sda*
然后热启动重启电脑,重复上述步骤并改为:vmlinuz initrd=initrd.img inst.stage2=hd:/dev/sda*(上一步查到的U盘盘符)
之后可继续安装!
三、安装完成后的常规设置
关闭selinux
[root@localhost ~]# vim /etc/selinux/config
修改yum源,base源,为阿里云的源
[root@colman ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
repo源(需要时候再修改)
[root@colman ~]# curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/epel-7.repo
修改主机名
[root@colman ~]# hostnamectl set-hostname ***(主机名)
也可直接修改配置文件: /etc/hostname
字符集/语言
[root@colman ~]# cat /etc/locale.conf
LANG="zh_CN.UTF-8"
管理服务
[root@colman ~]# systemctl disable firewalld.service
[root@colman ~]# systemctl enable firewalld.service
Created symlink from /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service to /usr/lib/systemd/system/firewalld.service.
Created symlink from /etc/systemd/system/multi-user.target.wants/firewalld.service to /usr/lib/systemd/system/firewalld.service.
[root@colman ~]# systemctl stop firewalld.service
[root@colman ~]# systemctl status firewalld.service
● firewalld.service - firewalld - dynamic firewall daemon
Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:firewalld(1)