내 시스템은 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
$PATH
geou1
따라서 내 생각에는 첫 번째 사용자가 실행 하는 sudo
것이 실제로 추가 디렉터리에 있고 /etc/scl/prefixes/devtoolset-9
.type sudo
/usr/bin
이러한 디렉토리는 기관에서 추가한 것처럼 보이므로 가장 좋은 해결 방법은 IT 헬프 데스크나 시스템 관리자에게 문제를 보고하여 해결할 수 있도록 하는 것입니다.
또 다른 접근 방식은 비공식 버전이 전혀 실행되지 않도록 디렉터리 /soft/ieco1.0.3/support_2.6.32/devtoolset-9_as6/root/usr/bin
에서 해당 디렉터리를 제거하는 것입니다 . 그러나 이것이 무엇을 깨뜨릴 수 있는지는 말할 수 없습니다.$PATH
sudo
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