linux报错-bash: xhost: command not found

当在Linux环境下遇到`-bash: xhost: command not found`错误时,原因是缺少了xorg-x11-server-utils包。通过运行`yum whatprovides "*/xhost"`找到需要的包,然后使用`yum -y install xorg-x11-server-utils`进行安装。安装过程中可能会有依赖问题,按照提示安装即可解决。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

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

倔强小梦参考自:http://blog.youkuaiyun.com/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
-->

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值