linux报错-bash: xhost: command not found

摘要:
这篇文章来自顽固的小梦想https://www.cnblogs.com/xphdbky/p/8243008.html固执的小梦想参考:http://blog.csdn.net/csdnones/article/details/51513163感谢原作者解决了我的问题。当在根用户下执行xhost+时,会报告以下错误,因为未安装相关的包(其他命令,如commandnotfound,无法以这种方式解决)

本帖转自倔强小梦https://www.cnblogs.com/xphdbky/p/8243008.html

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

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

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

安装该包即可:

[root@rac01 ~]# yum whatprovides "*/xhost"     ----------------------查看是哪些提供了 */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    ---------------------就是缺少这个包xorg-x11-server-utils-7.7-2.el6.x86_64
Repo        : base
Matched from:
Filename    : /usr/bin/xhost

安装xorg-x11-server-utils-7.7-2.el6.x86_64

[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!

安装完成,,再在root下执行xhost

[root@localhost database]# xhost +
xhost: unable to open display ":0.0"

xhost命令可以用啦啦。。

免责声明:文章转载自《linux报错-bash: xhost: command not found》仅用于学习参考。如对内容有疑问,请及时联系本站处理。

上篇Alpha版本冲刺(八)JQuery实现一个简单的鼠标跟随提示效果下篇

宿迁高防,2C2G15M,22元/月;香港BGP,2C5G5M,25元/月 雨云优惠码:MjYwNzM=

相关文章

Linux下查看硬盘UUID和修改硬盘UUID(转)

查看硬盘UUID: 1、 ls -l /dev/disk/by-uuid 2、 blkid /dev/sda5 修改硬盘UUID: 1、新建和改变分区的UUID sudo uuidgen | xargs tune2fs /dev/sda5 -U 2、将原有UUID写会到分区 tune2fs -U c1b9d5a2-f162-11cf-9ece-0020af...

Linux动态频率调节系统CPUFreq之三:governor

在上一篇文章中,介绍了cpufreq的core层,core提供了cpufreq系统的初始化,公共数据结构的建立以及对cpufreq中其它子部件提供注册功能。core的最核心功能是对policy的管理,一个policy通过cpufreq_policy结构中的governor字段,和某个governor相关联,本章的内容正是要对governor进行讨论。 通过...

Windows访问Linux下的共享目录的配置方法

user安全级别 第一步:安装samba3(如果已经安装就跳过这一步) [root@rhce2 /]# yum groupinstall "CIFS file server" 第二步:修改配置文件 [root@rhce2 /]# vi /etc/samba/smb.conf 将security参数的值设为user(这是默认值) security =...

Linux服务器性能检测命令集锦

uptime $ uptime 23:51:26 up 21:31, 1 user, load average: 30.02, 26.43, 19.02 这个命令可以快速查看机器的负载情况。在Linux系统中,这些数据表示等待CPU资源的进程和阻塞在不可中断IO进程(进程状态为D)的数量。这些数据可以让我们对系统资源使用有一个宏观的了解。 命令的输出...

Linux内核:关于中断你需要知道的

1、中断处理程序与其他内核函数真正的区别在于,中断处理程序是被内核调用来相应中断的,而它们运行于中断上下文(原子上下文)中,在该上下文中执行的代码不可阻塞。中断就是由硬件打断操作系统。 2、异常与中断不同,它在产生时必须考虑与处理器时钟同步。异常被称为同步中断,例如:除0、缺页异常、陷入内核(trap)引起系统调用处理程序异常。 3、不同的设备对应的中断不...

Linux下Redis开机自启(Centos)

废话少说,直接来步骤: 1、设置redis.conf中daemonize为yes,确保守护进程开启。 2、编写开机自启动脚本 vi /etc/init.d/redis 脚本内容如下: # chkconfig: 2345 10 90 # description: Start and Stop redis PATH=/usr/local/bin...