
Ubuntu 20.04.3 LTS를 설치하고 Anaconda3도 설치했는데 문제가 발생해서 Anaconda3을 제거해야 했습니다. 이 명령을 루트로 사용하여 디렉터리에서 제거했습니다 /home/user
.
# rm -f anaconda3
그 후 아래와 같은 문제가 발생했습니다.
$ sudo -s
# ls
Command 'ls' is available in the following places
* /bin/ls
* /usr/bin/ls
The command could not be located because '/bin:/usr/bin' is not included in the PATH environment variable.
ls: command not found
내 마지막 몇 줄은 다음과 같습니다 .bashrc
.
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/home/thilipkumar/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/home/thilipkumar/anaconda3/etc/profile.d/conda.sh" ]; then
. "/home/thilipkumar/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/home/thilipkumar/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
echo path
일반 사용자와 루트에 대한 출력은 다음과 같습니다 .
~$ echo $PATH
/home/thilipkumar/anaconda3/condabin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
~$ sudo -s
/home/thilipkumar# echo $PATH
/root/anaconda3/
누구든지 나에게 다음에 무엇을 해야 할지 제안해 줄 수 있나요?
답변1
/root/.profile
루트 사용자의 및 파일을 확인하여 /root/.bashrc
경로가 잘못 설정된 부분을 수정하십시오.
또한 해당 파일을 에 복사하여 이러한 파일을 기본값으로 되돌릴 수도 /etc/skel
있습니다 /root
.
답변2
다음을 사용하여 파일 경로를 바꾸십시오.
export PATH=$PATH:/usr/bin:/bin
이 명령은 원본 경로를 영구적으로 대체합니다. 예는 다음과 같습니다.
/$ nano .bashrc
Command 'nano' is available in the following places
* /bin/nano
* /usr/bin/nano
The command could not be located because '/usr/bin:/bin' is not included in the PATH environment variable.
nano: command not found
/$ export PATH=$PATH:/usr/bin:/bin
/$ ls
backups bin boot cdrom dev etc home lib lib32 lib64 libx32 lost+found
madhu media mnt opt proc root run sbin snap srv swapfile sys
tmp usr var