sudo コマンドを使用すると、「Cannot open /etc/scl/prefixes/devtoolset-9!」が返されます。

sudo コマンドを使用すると、「Cannot open /etc/scl/prefixes/devtoolset-9!」が返されます。

私のシステムはRHEL 6.7で、出力は次のようになります。echo $PATH

[geoeast@hp2-12 ~]$ which rm
rm:      aliased to rm -i
[geoeast@hp2-12 ~]$ which cp
cp:      aliased to cp -i
[geoeast@hp2-12 ~]$ echo $PATH
/soft/geoeast4.0.3/opt/lightning/build/Linux.x86_64/bin:/soft/geoeast4.0.3/opt/gstomo/Linux.x86_64/bin:/soft/geoeast4.0.3/opt/diva/bin:/soft/geoeast4.0.3/opt/lightning/build/Linux.x86_64/bin:/soft/geoeast4.0.3/opt/diva/bin:/soft/geoeast4.0.3/opt/gstomo/Linux.x86_64/bin:/soft/geoeast4.0.3/support/fontforge/bin:/soft/geoeast4.0.3/support/tools/bin:.:/soft/geoeast4.0.3/bin/cw:/soft/geoeast4.0.3/bin/GeoGME:/soft/geoeast4.0.3/bin/vsp:/soft/geoeast4.0.3/bin/sfp:/soft/geoeast4.0.3/bin/sdp/cshell:/soft/geoeast4.0.3/bin/sdppy:/soft/geoeast4.0.3/bin/statics:/soft/geoeast4.0.3/bin/sdp/bin:/soft/geoeast4.0.3/bin/sdp/int:/soft/geoeast4.0.3/bin/sdp:/soft/geoeast4.0.3/bin/mc:/soft/geoeast4.0.3/bin/cw:/soft/geoeast4.0.3/bin/ggi:/soft/ieco1.0.3/support/zookeeper/bin:/soft/ieco1.0.3/support/hadoop/hadoop-2.7.2/bin:/soft/ieco1.0.3/support/hadoop/hadoop-2.7.2/sbin:/soft/ieco1.0.3/install:/soft/ieco1.0.3/bin/batp:/soft/ieco1.0.3/bin/nap:/soft/ieco1.0.3/bin/ndp:/soft/ieco1.0.3/bin/ncp:/soft/ieco1.0.3/bin/ncld:/soft/ieco1.0.3/bin/common:/soft/ieco1.0.3/GeoSeisIO/bin:/soft/ieco1.0.3/ivtms/console:/soft/ieco1.0.3/licmng/bin:/soft/ieco1.0.3/support_2.6.32/tools/bin:/soft/ieco1.0.3/support_2.6.32/python/gbin:/soft/ieco1.0.3/support_2.6.32/cwp/bin:/soft/ieco1.0.3/support_2.6.32/mojoview/bin:/soft/ieco1.0.3/support_2.6.32/DDS.2011-07-15/bin:/soft/ieco1.0.3/support_2.6.32/PCG/bin:/soft/ieco1.0.3/support_2.6.32/gslib90/bin:/soft/ieco1.0.3/support_2.6.32/qcad:/soft/ieco1.0.3/support_2.6.32/qt3/bin:/soft/ieco1.0.3/support_2.6.32/ImageMagick/bin:/soft/ieco1.0.3/support_2.6.32/jdk/bin:/soft/ieco1.0.3/support_2.6.32/mysql/bin:/soft/ieco1.0.3/support_2.6.32/oiv/bin:/soft/ieco1.0.3/support_2.6.32/ora/bin:/soft/ieco1.0.3/support_2.6.32/postgresql/bin:/soft/ieco1.0.3/support_2.6.32/mvapich2.tcp/bin:/soft/ieco1.0.3/support_2.6.32/devtoolset-9_as6/root/usr/bin:/usr/local/bin:/bin:/usr/bin:/usr/kerberos/sbin:/usr/kerberos/bin

例は次のとおりです。

[geoeast@hp2-12 /tmp]$ sudo rm test2
Unable to open /etc/scl/prefixes/devtoolset-9!

sudo cp -a同じエラーを返します。

[geoeast@hp2-12 /tmp]$ sudo cp -a seismicview.log seismicview.log2
Unable to open /etc/scl/prefixes/devtoolset-9!

他のユーザーと連携します。

[geoeast@hp2-12 /tmp]$ su geou1
Password: 
[geou1@hp2-12 /tmp]$ sudo cp -a seismicview.log seismicview.log2
[sudo] password for geou1: 
[geou1@hp2-12 /tmp]$ 

geou1の出力echo $PATH

[geou1@hp2-12 /tmp]$ echo $PATH
.:/soft/geoeast3.0.5/support/fcitx/bin:/soft/geoeast3.0.5/support/fcitx/bin:/soft/geoeast3.0.5/bin/cw:/soft/geoeast3.0.5/GJSS/bin:/soft/geoeast3.0.5/support/ora/bin:/soft/geoeast3.0.5/bin/dp:/soft/geoeast3.0.5/GeoSeisIO/bin:/soft/geoeast3.0.5/bin/jsf:/soft/geoeast3.0.5/bin/vsp:/soft/geoeast3.0.5/bin/sfp:/soft/geoeast3.0.5/bin/sdp/int:/soft/geoeast3.0.5/bin/sdp/cshell:/soft/geoeast3.0.5/bin/sdp/bin:/soft/geoeast3.0.5/bin/systools:/soft/geoeast3.0.5/bin/mc:/soft/geoeast3.0.5/bin/cw:/soft/geoeast3.0.5/bin/gsm:/soft/geoeast3.0.5/bin/GJSS/gjssgui:/soft/geoeast3.0.5/bin/GJSS:/soft/geoeast3.0.5/bin/ggi:/soft/geoeast3.0.5/support/firefox:/soft/geoeast3.0.5/support/qcad:/soft/geoeast3.0.5/support/Adobe/Reader9/bin:/soft/geoeast3.0.5/support/Firefly/Client/bin:/soft/geoeast3.0.5/support/jdk/bin:/soft/geoeast3.0.5/support/qt3/bin:/soft/geoeast3.0.5/support/mysql/bin:/soft/geoeast3.0.5/support/oiv/bin:/soft/geoeast3.0.5/support/ora/bin:/soft/geoeast3.0.5/support/postgresql/bin:/soft/geoeast3.0.5/support/ImageMagick/bin:/soft/geoeast3.0.5/support/tools/bin:/soft/geoeast3.0.5/support/pyt/bin:/soft/geoeast3.0.5/support/mpi/bin:/soft/geoeast3.0.5/support/cwp/bin:/soft/geoeast3.0.5/support/cuda/bin:/soft/geoeast3.0.5/support/petsc/bin:/soft/geoeast3.0.5/support/mojoview/bin:/soft/geoeast3.0.5/support/paraview/bin:/usr/local/bin:/bin:/usr/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/sbin:/usr/GNQS/sbin:/usr/GNQS/bin

sudoコマンドを機能させるにはどうすればよいですか?

ベストアンサー1

エラーを生成したユーザーアカウントの対応するディレクトリ(検索コマンドのディレクトリリスト)に対応するUnable to open /etc/scl/prefixes/devtoolset-9!ディレクトリがあります。一方、正常に実行されたユーザーアカウントにはこのディレクトリは含まれていません。/soft/ieco1.0.3/support_2.6.32/devtoolset-9_as6/root/usr/bin$PATHgeou1

したがって、私の考えでは、最初のユーザーが実行することがsudo実際に追加のディレクトリにあります/etc/scl/prefixes/devtoolset-9type sudo/usr/bin

これらのディレクトリは機関によって追加されたように見えるため、最善の解決策はITヘルプデスクまたはシステム管理者に問題を報告して解決できるようにすることです。

別のアプローチは、非公式バージョンがまったく実行されないように、ディレクトリから/soft/ieco1.0.3/support_2.6.32/devtoolset-9_as6/root/usr/binそのディレクトリを削除することです。しかし、これが何を破ることができるかは言えません。$PATHsudo

PATH=$(echo "$PATH" | sed 's!:/soft/ieco1.0.3/support_2.6.32/devtoolset-9_as6/root/usr/bin:!:!g')

あなたがここにいるとき、私はそうです。強く.から始めることをお勧めします$PATH

PATH=$(echo "$PATH" | sed 's!:\.:!:!g')

または、システムディレクトリが最初に一覧表示されるように、ディレクトリリストの順序を変更します。ここでは順序を変更し、重複項目を削除して削除しました.

PATH=/usr/local/bin:/bin:/usr/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/soft/geoeast4.0.3/opt/lightning/build/Linux.x86_64/bin:/soft/geoeast4.0.3/opt/gstomo/Linux.x86_64/bin:/soft/geoeast4.0.3/opt/diva/bin:/soft/geoeast4.0.3/opt/lightning/build/Linux.x86_64/bin:/soft/geoeast4.0.3/opt/gstomo/Linux.x86_64/bin:/soft/geoeast4.0.3/support/fontforge/bin:/soft/geoeast4.0.3/support/tools/bin:/soft/geoeast4.0.3/bin/cw:/soft/geoeast4.0.3/bin/GeoGME:/soft/geoeast4.0.3/bin/vsp:/soft/geoeast4.0.3/bin/sfp:/soft/geoeast4.0.3/bin/sdp/cshell:/soft/geoeast4.0.3/bin/sdppy:/soft/geoeast4.0.3/bin/statics:/soft/geoeast4.0.3/bin/sdp/bin:/soft/geoeast4.0.3/bin/sdp/int:/soft/geoeast4.0.3/bin/sdp:/soft/geoeast4.0.3/bin/mc:/soft/geoeast4.0.3/bin/cw:/soft/geoeast4.0.3/bin/ggi:/soft/ieco1.0.3/support/zookeeper/bin:/soft/ieco1.0.3/support/hadoop/hadoop-2.7.2/bin:/soft/ieco1.0.3/support/hadoop/hadoop-2.7.2/sbin:/soft/ieco1.0.3/install:/soft/ieco1.0.3/bin/batp:/soft/ieco1.0.3/bin/nap:/soft/ieco1.0.3/bin/ndp:/soft/ieco1.0.3/bin/ncp:/soft/ieco1.0.3/bin/ncld:/soft/ieco1.0.3/bin/common:/soft/ieco1.0.3/GeoSeisIO/bin:/soft/ieco1.0.3/ivtms/console:/soft/ieco1.0.3/licmng/bin:/soft/ieco1.0.3/support_2.6.32/tools/bin:/soft/ieco1.0.3/support_2.6.32/python/gbin:/soft/ieco1.0.3/support_2.6.32/cwp/bin:/soft/ieco1.0.3/support_2.6.32/mojoview/bin:/soft/ieco1.0.3/support_2.6.32/DDS.2011-07-15/bin:/soft/ieco1.0.3/support_2.6.32/PCG/bin:/soft/ieco1.0.3/support_2.6.32/gslib90/bin:/soft/ieco1.0.3/support_2.6.32/qcad:/soft/ieco1.0.3/support_2.6.32/qt3/bin:/soft/ieco1.0.3/support_2.6.32/ImageMagick/bin:/soft/ieco1.0.3/support_2.6.32/jdk/bin:/soft/ieco1.0.3/support_2.6.32/mysql/bin:/soft/ieco1.0.3/support_2.6.32/oiv/bin:/soft/ieco1.0.3/support_2.6.32/ora/bin:/soft/ieco1.0.3/support_2.6.32/postgresql/bin:/soft/ieco1.0.3/support_2.6.32/mvapich2.tcp/bin:/soft/ieco1.0.3/support_2.6.32/devtoolset-9_as6/root/usr/bin

おすすめ記事