我现在用的是一个内存256,512突发的VPS,安装GNOME KDE有点吃不消,所以装了个轻量级的桌面,即Fluxbox
第一步:重转系统,我选用的是CentOS
第二步:安装yum-priorities
yum install yum-priorities
第三步:(添加)修改priority优先级
打开
vi /etc/yum.repos.d/CentOS-Base.repo
见到如下内容之后,在每段最后加上priority=X,X为优先级数字。
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
第四步:安装 RPMforge 具体可以参考:
http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
第五步:(添加)修改RPMforge的priority优先级
打开
vi /etc/yum.repos.d/rpmforge.repo
见到如下内容之后,在段落最后加上priority=11,降低rpm的优先级,这样可以解决yum的时候搜索rpm导致过慢的问题。
### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=11
第六步:安装vnc、firefox、fluxbox资源
yum -y install vnc vnc-server firefox xorg-x11* fluxbox
第七步:首次运行vncserver并设置密码
vncserver
第八步:终止VNC进程,清除通道1的临时文件
pkill -9 vnc #终止VNC进程
rm -rf /tmp/.X1* #清除下临时文件
第九步(重要):修改vnc启动项,让vnc连接的时候启动桌面。(如果忘记此步,VNC连接的时候可能只有一个黑X而没有其它东西)
vi /root/.vnc/xstartup #把最后的那行 “twm &”修改成 “exec /usr/bin/fluxbox”,保存退出
第十步:运行vncserver,如果有失败的情况,可以试一下先重启。
vncserver
最后用RealVNC viewer这个软件就可以远程连接到桌面了。
第一步:重转系统,我选用的是CentOS
第二步:安装yum-priorities
yum install yum-priorities
第三步:(添加)修改priority优先级
打开
vi /etc/yum.repos.d/CentOS-Base.repo
见到如下内容之后,在每段最后加上priority=X,X为优先级数字。
[base]
name=CentOS-$releasever - Base
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
#baseurl=http://mirror.centos.org/centos/$releasever/os/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#released updates
[updates]
name=CentOS-$releasever - Updates
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
#baseurl=http://mirror.centos.org/centos/$releasever/updates/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#packages used/produced in the build but not released
[addons]
name=CentOS-$releasever - Addons
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=addons
#baseurl=http://mirror.centos.org/centos/$releasever/addons/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
#baseurl=http://mirror.centos.org/centos/$releasever/extras/$basearch/
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=1
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
#baseurl=http://mirror.centos.org/centos/$releasever/centosplus/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib
mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
#baseurl=http://mirror.centos.org/centos/$releasever/contrib/$basearch/
gpgcheck=1
enabled=0
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-5
priority=2
第四步:安装 RPMforge 具体可以参考:
引用
http://wiki.centos.org/AdditionalResources/Repositories/RPMForge
第五步:(添加)修改RPMforge的priority优先级
打开
vi /etc/yum.repos.d/rpmforge.repo
见到如下内容之后,在段落最后加上priority=11,降低rpm的优先级,这样可以解决yum的时候搜索rpm导致过慢的问题。
### Name: RPMforge RPM Repository for Red Hat Enterprise 5 - dag
### URL: http://rpmforge.net/
[rpmforge]
name = Red Hat Enterprise $releasever - RPMforge.net - dag
baseurl = http://apt.sw.be/redhat/el5/en/$basearch/rpmforge
mirrorlist = http://apt.sw.be/redhat/el5/en/mirrors-rpmforge
#mirrorlist = file:///etc/yum.repos.d/mirrors-rpmforge
enabled = 1
protect = 0
gpgkey = file:///etc/pki/rpm-gpg/RPM-GPG-KEY-rpmforge-dag
gpgcheck = 1
priority=11
第六步:安装vnc、firefox、fluxbox资源
yum -y install vnc vnc-server firefox xorg-x11* fluxbox
第七步:首次运行vncserver并设置密码
vncserver
第八步:终止VNC进程,清除通道1的临时文件
pkill -9 vnc #终止VNC进程
rm -rf /tmp/.X1* #清除下临时文件
第九步(重要):修改vnc启动项,让vnc连接的时候启动桌面。(如果忘记此步,VNC连接的时候可能只有一个黑X而没有其它东西)
vi /root/.vnc/xstartup #把最后的那行 “twm &”修改成 “exec /usr/bin/fluxbox”,保存退出
第十步:运行vncserver,如果有失败的情况,可以试一下先重启。
vncserver
最后用RealVNC viewer这个软件就可以远程连接到桌面了。