3 安装步骤
3.1 执行CentOS7 最小安装
去官网下载CentOS-7.0-1406-x86_64-Minimal.iso,然后刻录光盘,安装之。
修改源
首先备份 CentOS-Base.repo
# sudo mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.bak
# vi /etc/yum.repos.d/CentOS-Base.repo
之后启用 TUNA 软件仓库, 将以下内容写入
# 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
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=https://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-7
更新软件包缓存
# yum makecache
安装完成后执行yum update更新系统。
删除多余的内核
1.首先列出系统中正在使用的内核:
# uname -a
2.查询系统中全部的内核:
# rpm -qa | grep kernel
3.将你想删除的内核删除掉:
#yum remove kernel-***
修改启动时间
# vim /etc/default/grub
# grub2-mkconfig -o /boot/grub2/grub.cfg
然后,执行
# yum install epel-release
安装额外包yum源(extra package for Enterprise Linux)。
3.2 安装X Window system
# yum groupinstall "X Window system"
3.3 安装Xfce4
# yum groupinstall xfce
# startxfce4
3.4 安装中文字体和中文输入法
# yum install cjkuni-ukai-fonts
【增加字体】
把Windows系统下C:\Windows\Fonts目录下需要的字体文件复制到CentOS的/usr/share/fonts/chinese/目录下,
然后执行如下命令即可安装这些字体:
# cd /usr/share/fonts/chinese/
# fc-cache -fv
# fc-list
【中文输入法】
# yum install ibus ibus-libpinyin
# ibus-setup
默认启动在用户根目录下 .bashrc中添加
export GTK_IM_MODULE=ibus
export XMODIFIERS=@im=ibus
export QT_IM_MODULE=ibus
ibus-daemon -drRx
设置图形界面启动
systemctl set-default graphical.target
安装VirtualBox Addon
-
yum install -y bzip2 gcc gcc-devel gcc-c++ gcc-c++-devel make kernel kernel-devel mount /dev/cdrom /media cd /media ./VBoxLinuxAdditions.run sudo usermod -a -G vboxsf $USER
----------以下是我加的----
3.5 xfce 字体美化
$ yum install http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm
$ yum update
$ yum install freetype-infinality
$ ./etc/fonts/infinality/infctl.sh setstyle
选择 6)win7
设置自动登录
简单来说就是:vi /etc/gdm/custom.conf
然后在[daemon]下面添加:
[daemon]
AutomaticLoginEnable=True
AutomaticLogin=root #你想自动登录的用户名
保存并重启,重启的时候已经以root用户登录了。
安装vnc
yum install -y tigervnc-server
echo 'VNCSERVERS="1:root"' > /etc/sysconfig/vncservers
echo 'VNCSERVERARGS[1]="-geometry 1280x960"' >> /etc/sysconfig/vncservers
vncserver 设置密码
vncpasswd 修改密码
echo '#!/bin/sh' > ~/.vnc/xstartup
echo '/usr/bin/startxfce4' >> ~/.vnc/xstartup
启动
开启三个vnc窗口
for i in `seq 1 3`; do vncserver -kill :$i; vncserver :$i;done