参考自: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. Yii2.0 发送文件

    1.发送文件 和浏览器跳转类似,文件发送是另一个依赖指定 HTTP 头的功能, Yii 提供方法集合来支持各种文件发送需求,它们对 HTTP 头都有内置的支持. yii\web\Response::s ...

  2. 自定义ViewPagerIndicator-视图指示器

    ViewPagerIndicator.java public class ViewPagerIndicator extends LinearLayout { private Paint mPaint; ...

  3. Codeforce Round #554 Div.2 D - Neko and Aki's Prank

    dp 找规律 我好菜啊好菜啊,完全没有思路. 在合法的括号序列中,左括号数一定大于等于右括号数的,所以我们可以先定义平衡度为左括号数-右括号数. 然后可以发现一个惊人的规律..就是在trie同一深度上 ...

  4. PAT——1035. 插入与归并

    根据维基百科的定义: 插入排序是迭代算法,逐一获得输入数据,逐步产生有序的输出序列.每步迭代中,算法从输入序列中取出一元素,将之插入有序序列中正确的位置.如此迭代直到全部元素有序. 归并排序进行如下迭 ...

  5. 【luogu P1879 [USACO06NOV]玉米田Corn Fields】 题解

    题目链接:https://www.luogu.org/problemnew/show/P1879 状压DP. 设dp[i][j]表示第i行,状态为j的方案数 初始dp[0][0] = 1 这样一共12 ...

  6. [Luogu2622]关灯问题$||$(状压$DP$)

    #\(\color{red}{\mathcal{Description}}\) \(Link\) 现有\(n\)盏灯,以及\(m\)个按钮.每个按钮可以同时控制这\(n\)盏灯--按下了第i个按钮,对 ...

  7. JBPM学习(四):运行流程实例

    概念: ProcessInstance,流程实例:代表流程定义的一次执行.如:张三昨天按请假流程请了一次假.一个流程实例包含了全部执行阶段,当中最典型的属性就是跟踪当前节点的指针,例如以下图. Exe ...

  8. a、button、input点击获取焦点时出现蓝色边框,如何去掉

    a,button,input{ -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-user-modify: read-write-plain ...

  9. C#多个if与if+多个else if有何不同?

    int a=1; if(a==1){System.out.println("1");} if(a==2){System.out.println("2");} i ...

  10. 再论C++引用(reference)类型

    很多C++初学者搞不清楚C++引用类型,不知有什么用,所以也不知怎么用.一个问题令人迷惑,不是读者有问题,而是教科书有问题. 和多数初学者一样,笔者在初学C++时,关于引用类型,教科书上也是如下表所述 ...