写在前面:本笔记根据学习RHEL6.X中遇到的问题整理,以便日后学习参考。
1. 安装YUM源
1.1. 删除redhat原有的yum源
[root@master yum.repos.d]# rpm -aq | grep yum|xargs rpm -e --nodeps
1.2. 获取CentOS源安装文件
[root@master yum.repos.d]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
[root@master yum.repos.d]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/python-iniparse-0.3.1-2.1.el6.noarch.rpm
[root@master yum.repos.d]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-3.2.29-69.el6.centos.noarch.rpm
[root@master yum.repos.d]# wget http://mirrors.163.com/centos/6/os/x86_64/Packages/yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm 【在对应的网页上查看相应的版本】
[root@master yum.repos.d]# ll
total 1120
-rw-r--r-- 1 root root 37052 Jul 3 2011 python-iniparse-0.3.1-2.1.el6.noarch.rpm
-rw-r--r--. 1 root root 529 Jan 29 2013 rhel-source.repo.bak
-rw-r--r-- 1 root root 1035636 Jul 25 2015 yum-3.2.29-69.el6.centos.noarch.rpm
-rw-r--r-- 1 root root 27224 Sep 26 2011 yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
-rw-r--r-- 1 root root 31340 Oct 18 2014 yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
1.3.安装yum命令
[root@master yum.repos.d]# rpm -ivh python-iniparse-0.3.1-2.1.el6.noarch.rpm
warning: python-iniparse-0.3.1-2.1.el6.noarch.rpm: Header V3 RSA/SHA256 Signature, key ID c105b9de: NOKEY
Preparing...########################################### [100%]
package python-iniparse-0.3.1-2.1.el6.noarch is already installed
[root@master yum.repos.d]# rpm -ivh yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
warning: yum-metadata-parser-1.1.2-16.el6.x86_64.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...########################################### [100%]
1:yum-metadata-parser########################################### [100%]
root@master yum.repos.d]# rpm -ivh yum-3.2.29-69.el6.centos.noarch.rpm yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
warning: yum-3.2.29-69.el6.centos.noarch.rpm: Header V3 RSA/SHA1 Signature, key ID c105b9de: NOKEY
Preparing...########################################### [100%]
1:yum-plugin-fastestmirro########################################### [ 50%]
2:yum########################################### [100%]
[root@master yum.repos.d]# yum
Usage: yum [options] COMMAND
.........
1.4.获取并修改CentOS6-Base-163.repo
[root@master yum.repos.d]# wget http://mirrors.163.com/.help/CentOS6-Base-163.repo
[root@master yum.repos.d]# ll
total 1120
-rw-r--r-- 1 root root2006 Sep 18 2014 CentOS6-Base-163.repo
-rw-r--r-- 1 root root 37052 Jul 3 2011 python-iniparse-0.3.1-2.1.el6.noarch.rpm
-rw-r--r--. 1 root root 529 Jan 29 2013 rhel-source.repo.bak
-rw-r--r-- 1 root root 1035636 Jul 25 2015 yum-3.2.29-69.el6.centos.noarch.rpm
-rw-r--r-- 1 root root 27224 Sep 26 2011 yum-metadata-parser-1.1.2-16.el6.x86_64.rpm
-rw-r--r-- 1 root root 31340 Oct 18 2014 yum-plugin-fastestmirror-1.1.30-30.el6.noarch.rpm
[root@master yum.repos.d]# cat CentOS6-Base-163.repo
# 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
baseurl=http://mirrors.163.com/centos/$releasever/os/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=os
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#released updates
[updates]
name=CentOS-$releasever - Updates - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/updates/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=updates
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/extras/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=extras
gpgcheck=1
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/centosplus/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=centosplus
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
#contrib - packages by Centos Users
[contrib]
name=CentOS-$releasever - Contrib - 163.com
baseurl=http://mirrors.163.com/centos/$releasever/contrib/$basearch/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=contrib
gpgcheck=1
enabled=0
gpgkey=http://mirror.centos.org/centos/RPM-GPG-KEY-CentOS-6
[root@master yum.repos.d]# vi CentOS6-Base-163.repo
:%s+$releasever +6
1.5.验证是否安装成功
root@master yum.repos.d]# yum install sar
Loaded plugins: fastestmirror, product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Determining fastest mirrors
base | 3.7 kB 00:00
base/primary_db| 4.6 MB 00:03
extras | 3.4 kB 00:00
extras/primary_db | 37 kB 00:00
updates| 3.4 kB 00:00
updates/primary_db | 4.6 MB 00:03
No package sar available.
Error: Nothing to do
[root@master yum.repos.d]# sar
Linux 2.6.32-358.el6.x86_64 (master) 04/09/2016 _x86_64_ (1 CPU)
07:32:10 AM LINUX RESTART
07:40:47 AM LINUX RESTART
07:50:01 AM CPU %user %nice %system %iowait%steal %idle
08:00:01 AM all 0.03 0.00 0.20 0.06 0.00 99.71
08:10:01 AM all 0.12 0.00 0.34 0.21 0.00 99.33
Average:all 0.08 0.00 0.27 0.14 0.00 99.52
2. 安装图形化界面
yum groupinstall "X Window System" –y
yum groupinstall "Desktop" –y
yum grouplist
3. 解决非root用户无法登陆图形化界面
错误提示信息如下:
[hadoop@master ~]$ startx
xauth: creating new authority file /home/huang/.serverauth.2542
(EE)
Fatal server error:
(EE) PAM authentication failed, cannot start X server.
Perhaps you do not have console ownership?
(EE)
(EE)
Please consult the CentOS support
at http://wiki.centos.org/Documentation
for help.
(EE)
giving up.
xinit: Connection refused (errno 111): unable to connect to X server
xinit: No such process (errno 3): Server error.
解决方法:
使用root用户执行以下命令:
touch /var/run/console/hadoop