Linux:Check if the DISPLAY variable is set.

 问题描述:安装oracle过程中,执行./runInstaller时报错

[oracle@*** database]$ ./runInstaller 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 26477 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed
Checking monitor: must be configured to display at least 256 colors
    >>> Could not execute auto check for display colors using command /usr/bin/xdpyinfo. Check if the DISPLAY variable is set.    Failed <<<<

Some requirement checks failed. You must fulfill these requirements before

continuing with the installation,

Continue? (y/n) [n] 

解决方法:

使用到xhost + 命令,xhost 是用来控制Xserver访问权限的,xhost + 是使所有用户都能访问Xserver。

[oracle@*** database]$ xhost +
bash: xhost: command not found

参考:【Linux:bash: xhost: command not found】

[root@*** database]# su oracle
[oracle@*** database]$ xhost +
xhost:  unable to open display ""

参考:【Linux:xhost: unable to open display ""】

安装xdpyinfo

[root@*** database]# yum install xdpyinfo
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
 * base: 100.125.0.40
 * extras: 100.125.0.40
 * updates: 100.125.0.40
Resolving Dependencies
--> Running transaction check
---> Package xorg-x11-utils.x86_64 0:7.5-23.el7 will be installed
--> Processing Dependency: libdmx.so.1()(64bit) for package: xorg-x11-utils-7.5-23.el7.x86_64
--> Processing Dependency: libXxf86dga.so.1()(64bit) for package: xorg-x11-utils-7.5-23.el7.x86_64
--> Processing Dependency: libXv.so.1()(64bit) for package: xorg-x11-utils-7.5-23.el7.x86_64
--> Running transaction check
---> Package libXv.x86_64 0:1.0.11-1.el7 will be installed
---> Package libXxf86dga.x86_64 0:1.1.4-2.1.el7 will be installed
---> Package libdmx.x86_64 0:1.1.3-3.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved
================================================================================
 Package                Arch           Version               Repository    Size
================================================================================
Installing:
 xorg-x11-utils         x86_64         7.5-23.el7            base         114 k
Installing for dependencies:
 libXv                  x86_64         1.0.11-1.el7          base          18 k
 libXxf86dga            x86_64         1.1.4-2.1.el7         base          19 k
 libdmx                 x86_64         1.1.3-3.el7           base          16 k

Transaction Summary
================================================================================
Install  1 Package (+3 Dependent packages)

Total download size: 168 k
Installed size: 334 k
Is this ok [y/d/N]: y
Downloading packages:
(1/4): libXv-1.0.11-1.el7.x86_64.rpm                       |  18 kB   00:00     
(2/4): libXxf86dga-1.1.4-2.1.el7.x86_64.rpm                |  19 kB   00:00     
(3/4): libdmx-1.1.3-3.el7.x86_64.rpm                       |  16 kB   00:00     
(4/4): xorg-x11-utils-7.5-23.el7.x86_64.rpm                | 114 kB   00:00  
--------------------------------------------------------------------------------
Total                                              3.0 MB/s | 168 kB  00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : libXxf86dga-1.1.4-2.1.el7.x86_64                             1/4 
  Installing : libdmx-1.1.3-3.el7.x86_64                                    2/4 
  Installing : libXv-1.0.11-1.el7.x86_64                                    3/4 
  Installing : xorg-x11-utils-7.5-23.el7.x86_64                             4/4 
  Verifying  : xorg-x11-utils-7.5-23.el7.x86_64                             1/4 
  Verifying  : libXv-1.0.11-1.el7.x86_64                                    2/4 
  Verifying  : libdmx-1.1.3-3.el7.x86_64                                    3/4 
  Verifying  : libXxf86dga-1.1.4-2.1.el7.x86_64                             4/4 

Installed:
xorg-x11-utils.x86_64 0:7.5-23.el7                                            

Dependency Installed:
  libXv.x86_64 0:1.0.11-1.el7         libXxf86dga.x86_64 0:1.1.4-2.1.el7        
  libdmx.x86_64 0:1.1.3-3.el7        

Complete!

 切换到oracle用户,再执行./runInstaller ,如果还出现Check if the DISPLAY variable is set的错,那么就打开Xstart窗口,把用户从root直接改成oracle,再执行./runInstaller。

Linux:Check if the DISPLAY variable is set._第1张图片

[oracle@*** ~]$ cd /opt/oracle/database/
[oracle@*** database]$ ./runInstaller 
Starting Oracle Universal Installer...

Checking Temp space: must be greater than 500 MB.   Actual 23978 MB    Passed
Checking swap space: must be greater than 150 MB.   Actual 4095 MB    Passed
Checking monitor: must be configured to display at least 256 colors.    Actual 16777216    Passed
Preparing to launch Oracle Universal Installer from /tmp/OraInstall2019-07-22_05-16-23PM. Please wait ...[oracle@*** database]$ 

 

 

如果有写的不对的地方,请大家多多批评指正,非常感谢!

你可能感兴趣的:(Linux)