0
我試圖讓我的科學Linux中的command_not_found_handle
工作。我安裝了command-not-found
包BASH command_not_found_handle() - 不建議解決方案
`sudo yum install PackageKit-command-not-found.x86_64`
現在如果我發出type command_not_found_handle
我得到:
[JmZ:/usr/lib]-->type command_not_found_handle
command_not_found_handle is a function
command_not_found_handle()
{
runcnf=1;
retval=127;
[ ! -S /var/run/dbus/system_bus_socket ] && runcnf=0;
[ ! -x /usr/sbin/packagekitd ] && runcnf=0;
if [ $runcnf -eq 1 ]; then
/usr/libexec/pk-command-not-found $1;
retval=$?;
else
echo "bash: $1: command not found";
fi;
return $retval
}
我沒有安裝軟件包之前看到。如果我現在發佈一些程序的命令(例如,GCL)沒有安裝,我只是得到如下:
[JmZ:/usr/lib]-->gcl
Command not found.
而如果我做我的Ubuntu類似的東西,我得到:
[email protected]:~$ gcl
The program 'gcl' is currently not installed. You can install it by typing:
sudo apt-get install gcl
我想在Scientific Linux中獲得類似的功能。我如何設置?
謝謝。
您是否嘗試履行給定的條件? – 2012-08-16 15:39:10
我不太清楚「履行條件」的含義。我沒有太多的shell腳本經驗,所以我正在破譯腳本。 – JmZ 2012-08-16 16:33:57
您可能需要安裝軟件包並運行dbus守護進程,該進程被配置爲將其接口放置在/ var/run/dbus/system_bus_socket中(通過符號鏈接) – fork0 2012-08-17 07:18:49