安装vim设置彩色BASH
# yum -y install vim-enhanced
# vi /etc/bashrc

 
# David's profile
alias vi='vim'
PS1='
\033[01;32m
\0
33
[
01
;
32
�
\u@\h
\033[01;34m
\0
33
[
01
;
34
�
\w \$
\033[00m
\0
33
[
00
�
'
# source /etc/ bashrc

 
设置主机名
# hostnamectl set-hostname  xxxxx
# source /etc/profile

关闭SELinux
#  getenforce
# vi /etc/selinux/config
SELINUX=disabled 
# reboot

关闭笔记本屏幕后不休眠的设置
# vi /etc/systemd/logind.conf
HandleLidSwitchDocked=ignore
HandleLidSwitch=ignore
重启login服务
# systemctl restart systemd-logind

设置本地时间
# date -s "mm/dd/yyy 08:40"
# timedatectl set-local-rtc true
自动更新时间
#  yum -y install cronie
# systemctl start crond

安装第三方源
查看所有安装的源
# yum repolist
(参见本人安装第三方源文章)
如果安装出错,先清理缓存,再做一个yum缓存后重新安装。
# yum clean all
# yummakecache

更新系统
# yum -y update
# yum -y upgrade

关闭防火墙
# systemctl status firewalld 
# systemctl stop firewalld 
# systemctl disable firewalld
====================================================================
安装配置VNC服务
#  yum -y install tigervnc-server
Installed:
tigervnc-server.x86_64 0:1.3.1-9.el7
 
  # cp /lib/systemd/system/vncserver@.service 
  /etc/systemd/system/vncserver@:1.service 
 
 
  或者再增加一个管理窗口 
 
 
  # cp /lib/systemd/system/vncserver@.service /etc/systemd/system/vncserver@:2.service 
 
 
  编辑配置文件 
 
 
  #vi /etc/systemd/system/vncserver@:1.service 
 
 
  把<user>替换成root用户,最终修改如下: 
 
 
  [Service] 
 
 
  Type=forking   
 
 
  # if it is not root user Type=simple 
 
 
  # 可以不改,如果出现错误代码98,须将forking改为simple 
 
 
  ExecStart=/sbin/runuser -l root -c "/usr/bin/vncserver :1 -geometry 1680x1050 -depth 24 -securitytypes=none -fp /usr/share/X11/fonts/misc" 
 
 
  PIDFile=/root/.vnc/%H%i.pid 
 
 
  重启 systemd 
 
 
  # systemctl daemon-reload 
 
 
  
 
   
  
  
 
  
 
   开启自启动服务 
  
 
  
 
   # systemctl enable vncserver@:1.service 
  
 
  
 
   # systemctl start vncserver@:1.service 
  
 
  
 
   # systemctl status vncserver@:1.service 
  
 
  
 
   # netstat -lnt | grep 590* 
  
 
  
 
   
  
  
 
 
 
  设置VNC密码(可选) 
 
 
  root用户vnc密码: 
 
 
  # 
  vncpasswd 
 
 
  
 
   
  
  
 
  
 
   david用户vnc密码: 
  
 
  
 
   # su david$ sudo vncpasswd 
  
 
 
 
  
 
 
 
  查看报错信息 
 
 
  # grep vnc /var/log/messages 
 
 
  
 
 
 
  防火墙设置 
 

   我们需要配置防火墙来让 VNC 服务正 
  常工作。 
 
 
  $ sudo firewall-cmd --permanent --add-service vnc-server 
 
 
  $ sudo systemctl restart firewalld.service 
 
 
  
 
 
 
  现在就可以用 IP 和端口号(LCTT 译注:例如 192.168.1.1:1 ,这里的端口不是服务器的端口,而是视 VNC 连接数的多少从1开始排序)来连接 VNC 服务器了。 
 
 
  
 
 
 
  其他命令 
 
 
  关闭/禁止VNC服务 
 
 
  # systemctl stop vncserver@:1.service 
 
 
  # systemctl disable vncserver@:1.service 
 
 
  关闭/禁用防火墙。 
 
 
  # systemctl stop firewalld.service 
 
 
  # systemctl disable firewalld.s 
  ervice 
 
 
  在某用户下手工启动VNC(临时启用服务) 
 
 
  # su <user> 
 
 
  $vncserver :1 -geometry 1680x1024 -depth 24 
 
 
  $ 
  vncserver -kill :1 
 
=======================================================================
安装图形化界面
# yum  -y groupinstall "GNOME Desktop" "Graphical Administration Tools"
# systemctl set-default  graphical.target
# reboot

 
如果安装出错,先清理缓存,再做一个yum缓存后重新安装。
# yum clean all
# yummakecache

安装压缩软件
让centos 7 方便的用鼠标右键压缩与解压缩
zip,tag.gz格式系统自带
# yum install -y p7zip p7zip-plugins

删除不常用软件
删除evolution  
# rpm -qa evolution
# yum remove   evolution
Removed:
  evolution.x86_64 0:3.12.11-22.el7
Dependency Removed: 
  evolution-ews.x86_64 0:3.12.11-9.el7 evolution-help.noarch 0:3.12.11-22.el7
  evolution-mapi.x86_64 0:3.12.10-5.el7  

# rpm -qa 
# yum remove