I have installed miniconda, and I need to use ROS2 now, so I have commented the conda init code in .bashrc file. But if I run which python or which python3 command, the output is still the miniconda python.
yan@yan-Precision-7920-Tower:~$ which python
/home/yan/miniconda3/bin/python
yan@yan-Precision-7920-Tower:~$ which python3
/home/yan/miniconda3/bin/python3
So I tried the following methods.
yan@yan-Precision-7920-Tower:~$ ls /usr/bin/python*
/usr/bin/python     /usr/bin/python3.8           /usr/bin/python3-coverage    /usr/bin/python-argcomplete-check-easy-install-script3
/usr/bin/python2    /usr/bin/python3.8-config    /usr/bin/python3-futurize    /usr/bin/python-argcomplete-tcsh3
/usr/bin/python2.7  /usr/bin/python3.8-coverage  /usr/bin/python3-pasteurize
/usr/bin/python3    /usr/bin/python3-config      /usr/bin/python3-pbr
yan@yan-Precision-7920-Tower:~$ sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 1
update-alternatives: using /usr/bin/python3.8 to provide /usr/bin/python3 (python3) in auto mode
yan@yan-Precision-7920-Tower:~$ sudo update-alternatives --config python3
There is only one alternative in link group python3 (providing /usr/bin/python3): /usr/bin/python3.8
Nothing to configure.
yan@yan-Precision-7920-Tower:~$ sudo update-alternatives --set python3 /usr/bin/python3.8
yan@yan-Precision-7920-Tower:~$ which python3
/home/yan/miniconda3/bin/python3
So you can see that when I run which python3, it still output the miniconda python.
So how to reset the python to the system default python?
 
    