ITPub博客

首页 > 数据库 > Oracle > 【ORACLE】安装时遇到“display at least 256 colors”

【ORACLE】安装时遇到“display at least 256 colors”

原创 Oracle 作者:enyaer 时间:2017-06-30 19:10:17 0 删除 编辑
我们在Linux安装ORACLE时经常会遇到如下报错:

  1. [oracle@db1 database]$ ./runInstaller
  2. Starting Oracle Universal Installer...
  3. Checking Temp space: must be greater than 120 MB. Actual 16450 MB Passed
  4. Checking swap space: must be greater than 150 MB. Actual 3071 MB Passed
  5. Checking monitor: must be configured to display at least 256 colors
  6. >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set. Failed <<<<
  7. Some requirement checks failed. You must fulfill these requirements before
  8. continuing with the installation,
  9. Continue? (y/n) [n] n
  10. User Selected: No
  11. Exiting Oracle Universal Installer, log for this session can be found at /tmp/OraInstall2017-06-30_12-28-12AM/installActions2017-06-30_12-28-12AM.log
这个问题是由于图形化设置不当造成的,需要正确执行xhost + 以及设置DISPLAY参数,解决步骤如下:

1、安装VNCSERVER(root用户)(已安装可以跳过)

  1. [root@db1 ~]# yum install tigervnc-server
  2. Complete!
  3. [root@db1 ~]# vncserver
  4. You will require a password to access your desktops.
  5. Password:
  6. Verify:
  7. xauth: creating new authority file /root/.Xauthority
  8. New 'db1.us.oracle.com:1 (root)' desktop is db1.us.oracle.com:1
  9. Creating default startup script /root/.vnc/xstartup
  10. Starting applications specified in /root/.vnc/xstartup
  11. Log file is /root/.vnc/db1.us.oracle.com:1.log
2、设置DISPLAY参数以及xhost +(root用户)

  1. [root@db1 ~]# export DISPLAY=db1.us.oracle.com:1
  2. [root@db1 ~]# xhost +
  3. access control disabled, clients can connect from any host

3、设置DISPLAY参数(oracle用户)

  1. [root@db1 ~]# su - oracle
  2. [oracle@db1 ~]$ export DISPLAY=:0.0

  3. [oracle@db1 database]$ ./runInstaller
  4. Starting Oracle Universal Installer...
  5. Checking Temp space: must be greater than 120 MB. Actual 11334 MB Passed
  6. Checking swap space: must be greater than 150 MB. Actual 3071 MB Passed
  7. Checking monitor: must be configured to display at least 256 colors. Actual 16777216 Passed
  8. Preparing to launch Oracle Universal Installer from /tmp/OraInstall2017-06-30_08-42-28AM. Please wait ...
之所以使用startx启动图形不需要设置,是因为 DISPLAY环境变量在这种模式下将自动设置为:0:0

环境变量DISPLAY用来设置将图形显示到何处,格式为:host:NumA.NumB


直接登陆图形界面或者登陆命令行界面后使用startx启动图形, DISPLAY环境变量将自动设置为:0:0。此时Host为空, 则表示Xserver运行于本机, 并且图形程序(Xclient)使用unix socket方式连接到Xserver, 而不是TCP方式。


NumA的值:
使用TCP方式连接时, NumA为连接的端口减去6000的值, 如果NumA为0, 则表示连接到6000端口
使用unix socket方式连接时则表示连接的unix socket的路径, 如果为0, 则表示连接到/tmp/.X11-unix/X0 


NumB则几乎总是0


可以通过下面的命令查看环境变量DISPLAY
root@root-desktop:~$ env | grep DISPLAY
DISPLAY=:0.0

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/618091/viewspace-2141446/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    10
  • 访问量
    18691