参考自:http://blog.csdn.net/csdnones/article/details/51513163,感谢原作者解决了我的问题。

执行xhost +,报以下错误,原因是因未没有安装相关的包(其他类似command not found命令没有可以用这种方式解决)

[root@rac01 ~]# xhost +
-bash: xhost: command not found

安装该包即可:

[root@rac01 ~]# yum whatprovides "*/xhost"
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
base/filelists_db                                                               | 3.4 MB     00:00 ...
xorg-x11-server-utils-7.7-2.el6.x86_64 : X.Org X11 X server utilities
Repo        : base
Matched from:
Filename    : /usr/bin/xhost

[root@rac01 ~]# yum -y install xorg-x11-server-utils-7.7-2.el6.x86_64
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package xorg-x11-server-utils.x86_64 0:7.7-2.el6 will be installed
--> Processing Dependency: mcpp for package: xorg-x11-server-utils-7.7-2.el6.x86_64
--> Processing Dependency: libXxf86misc.so.1()(64bit) for package: xorg-x11-server-utils-7.7-2.el6.x86_64
--> Running transaction check
---> Package libXxf86misc.x86_64 0:1.0.3-4.el6 will be installed
---> Package mcpp.x86_64 0:2.7.2-4.1.el6 will be installed
--> Processing Dependency: libmcpp.so.0()(64bit) for package: mcpp-2.7.2-4.1.el6.x86_64
--> Running transaction check
---> Package libmcpp.x86_64 0:2.7.2-4.1.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=======================================================================================================
 Package                           Arch               Version                   Repository        Size
=======================================================================================================
Installing:
 xorg-x11-server-utils             x86_64             7.7-2.el6                 base             155 k
Installing for dependencies:
 libXxf86misc                      x86_64             1.0.3-4.el6               base              18 k
 libmcpp                           x86_64             2.7.2-4.1.el6             base              69 k
 mcpp                              x86_64             2.7.2-4.1.el6             base              23 k

Transaction Summary
=======================================================================================================
Install       4 Package(s)

Total download size: 265 k
Installed size: 570 k
Downloading Packages:
-------------------------------------------------------------------------------------------------------
Total                                                                  2.2 MB/s | 265 kB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : libXxf86misc-1.0.3-4.el6.x86_64                                                     1/4
  Installing : libmcpp-2.7.2-4.1.el6.x86_64                                                        2/4
  Installing : mcpp-2.7.2-4.1.el6.x86_64                                                           3/4
  Installing : xorg-x11-server-utils-7.7-2.el6.x86_64                                              4/4
  Verifying  : libmcpp-2.7.2-4.1.el6.x86_64                                                        1/4
  Verifying  : xorg-x11-server-utils-7.7-2.el6.x86_64                                              2/4
  Verifying  : libXxf86misc-1.0.3-4.el6.x86_64                                                     3/4
  Verifying  : mcpp-2.7.2-4.1.el6.x86_64                                                           4/4

Installed:
  xorg-x11-server-utils.x86_64 0:7.7-2.el6

Dependency Installed:
  libXxf86misc.x86_64 0:1.0.3-4.el6    libmcpp.x86_64 0:2.7.2-4.1.el6    mcpp.x86_64 0:2.7.2-4.1.el6

Complete!

【linux报错】-bash: xhost: command not found的更多相关文章

  1. linux报错-bash: xhost: command not found

    本帖转自倔强小梦https://www.cnblogs.com/xphdbky/p/8243008.html 倔强小梦参考自:http://blog.csdn.net/csdnones/article ...

  2. source /etc/profile报错-bash: id:command is not found

    由于误操作导致 source /etc/profile 报错 -bash: id:command is not found 此时,linux下很多命令到不能能用,包括vi ls 等... 可以使用 e ...

  3. linux下报错bash: service: command not found

    在linux下操作的时候经常会遇到,bash: service: command not found这个错误,以前在网上找了,照着弄了,也没细看原因,今天又碰到这个问题,就顺便研究一下. 1.通常这种 ...

  4. scp报错 -bash: scp: command not found

    环境:RHEL6.5 使用scp命令报错: [root@oradb23 media]# scp /etc/hosts oradb24:/etc/ -bash: scp: command not fou ...

  5. scp命令报错-bash: scp: command not found

    # scp -bash: scp: command not found # which scp /usr/bin/scp # rpm -qf /usr/bin/scp openssh-clients- ...

  6. scp拷贝文件报错-bash: scp: command not found

    今天用scp远程传输资料,报错如下: -bash: scp: command not found 在网上搜资料解决办法如下: 安装scp的软件包: # yum install openssh-clie ...

  7. Mac 终端命令行报错 -bash: vi: command not found

    我遇到的问题与这个类似,但是我的问题也是用该博文作者方法进行中断才解决的,在此表示感谢. 前段时间在 Mac 下使用终端遇到了这个问题: appledeMacBook-Air:~ air$ vi .b ...

  8. Mac 执行 gulp 报错 -bash: gulp: command not found

    在mac系统下安装gulp,之后执行gulp 报如下错误: -bash: gulp: command not found 回溯安装过程发现问题如下 1.执行 npm root: Application ...

  9. Linux pip命令报错 -bash: pip: command not found

    下载 $ wget https://bootstrap.pypa.io/get-pip.py 安装 $ python get-pip.py 查看版本 $ pip -V 查看安装路径: find / - ...

  10. linux 报错 bash ‘/bin/sh: Syntax error: “(” unexpected

    今天用make 编译 蹦到 bash ‘/bin/sh: Syntax error: “(” unexpected 和 /bin/sh: [[: not found 这种莫名奇妙的错误 原因是是lin ...

随机推荐

  1. docker-6-DockerFile解析

    1.是什么 Dockerfile是用来构建Docker镜像的构建文件,是由一系列命令和参数构成的脚本. 构建三步骤: 1.编写Dockerfile文件 2.docker build 3.docker ...

  2. TCP连接三次握手协议,释放连接四次挥手,以及使用 awl伪造mac地址进行多线程syn洪泛攻击。

    这个TCP连接就是一次追女生-谈恋爱-分手,追求比分手简单,但是分手比追求复杂.哥,谈了半年的女朋友,在就快要成功了的时候分了,原因是因为有人在后面该老子背后搞SYN洪泛攻击,最后女朋友丢失了.学会T ...

  3. cocos2d-x3.0 用CCDictionary写文件

    bool CDownLoad_LocalData::WriteToConfigFile( DownLoadLocalData* downdata ){ CCDictionary* pDict = CC ...

  4. 用JavaScript编写气泡

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  5. 容易忽略的expect脚本问题,暗藏的僵尸进程,wait命令不要漏掉

    问题描述 前几天有个小需求,用到expect脚本去循环的发送一些数据,主要问题代码如下: #! /usr/bin/expect while {true} { set timeout 60 spawn ...

  6. python3 使用pyinstaller打包可执行程序

    步骤 1.使用pip安装pyinstaller pip install pyinstaller 2. 使用pyinstaller打包程序 pyinstaller -F xxx.py pyinstall ...

  7. Linux-- 文件编辑器 vi/vim(2)

    多文件编辑 vi 可以用来打开多个文件,如下: 进入编辑界面以后,输入 :n 可以切换到下一个文本,:N 可以切换到上一个文本,:files 列出目前这个 vi 打开的所有文件,举例如下: 切换到下一 ...

  8. linux学习笔记三:防火墙设置

    请注意:centOS7和7之前的版本在防火墙设置上不同,只有正确的设置防火墙才能实现window下访问linux中的web应用. centOS6添加端口: vi /ets/sysconfig/ipta ...

  9. PS中10种样式操作

    (1)投影:将为图层上的对象.文本或形状后面添加阴影效果.投影参数由“混合模式”.“不透明度”.“角度”.“距离”.“扩展”和“大小”等各种选项组成,通过对这些选项的设置可以得到需要的效果. (2)内 ...

  10. CRLF注入学习

    预备 <CRLF>是换行符,CRLF注入顾名思义就是把换行符写入,那么要把换行符写入到哪里呢?看看下面的http头 可以看到,每一行都包含特定的头部信息,然后以换行为标志写入其他的头部信息 ...