CentOS7安装

参考:http://www.linuxidc.com/Linux/2016-07/133646.htm

 

安装过程遇到的问题

 

1 选择安装界面选择“Install CentOS 7”后,卡在:

sd 8:0:0:0 :[sda] assuming drive cache:write through

解决方式:

在选择“Install CentOS 7”后,按Tab键编辑命令,

>/xxx/vmlinuz initrd=/xxx/initrd.img linux dd quiet

只需要修改上面红色的部分,此命令会把磁盘各分区信息显示出来,然后记下U盘是哪个,我的是/dev/sda4。

然后重启,选择“Install CentOS 7”后,按Tab键编辑命令,

>/xxx/vmlinuz /xxx/initrd=/xxx/initrd.img inst.stage2=hd:LABEL=CentOS\x207\x20x86_64 quiet

改为

>/xxx/vmlinuz /xxx/initrd=/xxx/initrd.img inst.stage2=hd:/dev/sda4 quiet

仍然只需要修改上面红色部分。

然后运行。

这时仍然会卡在之前那里,不过等一小会就OK了。

 

分区选择标准分区。

配置网络。

url填: http://centos.ustc.edu.cn/centos/7.4.1708/os/x86_64

Minimal Install

 

系统配置

ifconfig没有了

使用ip addr

 

selinux

查看SELinux状态:

1、/usr/sbin/sestatus -v      ##如果SELinux status参数为enabled即为开启状态

SELinux status:                 enabled

2、getenforce                 ##也可以用这个命令检查

关闭SELinux:

1、临时关闭(不用重启机器):

setenforce 0                  ##设置SELinux 成为permissive模式

                              ##setenforce 1 设置SELinux 成为enforcing模式

2、修改配置文件需要重启机器:

修改/etc/selinux/config 文件

将SELINUX=enforcing改为SELINUX=disabled

重启机器即可

 

挂载硬盘

mkdir /data
[root@localhost yum.repos.d]# blkid
/dev/sdb2: UUID="a82b1e8c-8241-483c-a7a3-f8181236888b" TYPE="ext4" PARTUUID="763d6733-fda4-4bab-b8b9-cc3626e418f1" 
/dev/sdb3: UUID="08e1ecd3-611c-4cbc-95b9-5df6632b7be6" TYPE="ext4" PARTUUID="532feda2-dacd-4d61-9152-1ebe3b0338b1" 
/dev/sdb1: SEC_TYPE="msdos" UUID="68B0-0185" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="dcb7248c-2dec-4fe5-ac72-5a38e631f06a" 
/dev/sdb4: UUID="ec94e7d7-1c99-4aac-ba3e-a8b787f3980c" TYPE="swap" PARTUUID="39117d64-7ca1-4b0f-a499-86ee87733ffa" 
/dev/sda1: UUID="7cf73565-6893-4c9c-99b6-25eb8c23aa60" TYPE="ext4"

 

vi /etc/fstab

添加
UUID=7cf73565-6893-4c9c-99b6-25eb8c23aa60 /data ext4 defaults 1 2

 

配置yum源 

http://mirrors.163.com/.help/centos.html

[root@localhost ~]# cd /etc/yum.repos.d/
[root@localhost yum.repos.d]# ls
CentOS-Base.repo  CentOS-Debuginfo.repo  CentOS-Media.repo    CentOS-Vault.repo
CentOS-CR.repo    CentOS-fasttrack.repo  CentOS-Sources.repo
[root@localhost yum.repos.d]# mv CentOS-Base.repo CentOS-Base.repo.bak
[root@localhost yum.repos.d]# vi CentOS-Base.repo
[root@localhost yum.repos.d]# yum clean all
[root@localhost yum.repos.d]# yum makecache
# CentOS-Base.repo
#
# The mirror system uses the connecting IP address of the client and the
# update status of each mirror to pick mirrors that are updated to and
# geographically close to the client.  You should use this for CentOS updates
# unless you are manually picking other mirrors.
#
# If the mirrorlist= does not work for you, as a fall back you can try the 
# remarked out baseurl= line instead.
#
#
[base]
name=CentOS-$releasever - Base - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=http://mirrors.163.com/centos/RPM-GPG-KEY-CentOS-7

 修改服务器时区为中国。
先用tzselect选择时区,结果为“Asia/Shanghai”

$> tzselect 
Please identify a location so that time zone rules can be set correctly.
Please select a continent or ocean.
 1) Africa
 2) Americas
 3) Antarctica
 4) Arctic Ocean
 5) Asia
 6) Atlantic Ocean
 7) Australia
 8) Europe
 9) Indian Ocean
10) Pacific Ocean
11) none - I want to specify the time zone using the Posix TZ format.
#? 5
Please select a country.
 1) Afghanistan          18) Israel            35) Palestine
 2) Armenia          19) Japan            36) Philippines
 3) Azerbaijan          20) Jordan            37) Qatar
 4) Bahrain          21) Kazakhstan        38) Russia
 5) Bangladesh          22) Korea (North)        39) Saudi Arabia
 6) Bhutan          23) Korea (South)        40) Singapore
 7) Brunei          24) Kuwait            41) Sri Lanka
 8) Cambodia          25) Kyrgyzstan        42) Syria
 9) China          26) Laos            43) Taiwan
10) Cyprus          27) Lebanon            44) Tajikistan
11) East Timor          28) Macau            45) Thailand
12) Georgia          29) Malaysia            46) Turkmenistan
13) Hong Kong          30) Mongolia            47) United Arab Emirates
14) India          31) Myanmar (Burma)        48) Uzbekistan
15) Indonesia          32) Nepal            49) Vietnam
16) Iran          33) Oman            50) Yemen
17) Iraq          34) Pakistan
#? 9
Please select one of the following time zone regions.
1) Beijing Time
2) Xinjiang Time
#? 1
The following information has been given:
    China
    Beijing Time
Therefore TZ='Asia/Shanghai' will be used.
Local time is now:    Mon Nov  6 21:24:23 CST 2017.
Universal Time is now:    Mon Nov  6 13:24:23 UTC 2017.
Is the above information OK?
1) Yes
2) No
#? 1
You can make this change permanent for yourself by appending the line
    TZ='Asia/Shanghai'; export TZ
to the file '.profile' in your home directory; then log out and log in again.
Here is that TZ value again, this time on standard output so that you
can use the /usr/bin/tzselect command in shell scripts:
Asia/Shanghai​

然后再执行:

$> rm -rf /etc/localtime
$> ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime​

完成!

 

yum grouplist显示的包不全

yum grouplist hidden 

转载于:https://my.oschina.net/igiantpanda/blog/1838350

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值