Uninstall and install Miniconda3

Don't be afraid, take your time, I can.

1. Conda (I don't know what it's doing). What's inside seems to be useless

2. Condarc (I don't know what it is, it seems to be related to the configuration file) vi is similar to vim, gedit uses text editing

The mirror image (channel) will be displayed inside

 

3 df -lh 

The root directory mount point is on the physical hard disk

The mount point of the data directory is on the mobile hard disk

The last one is the mobile hard drive inserted by yourself

And the folder under the root directory is the same thing

Usually, the storage is not specifically specified. Basically, it will be stored in the root directory, which is the physical hard disk, but the physical hard disk is relatively small, so the project will be placed in the root directory in the future. Then the data set is placed in the data folder, because the data set is very large, and many data sets are larger than 100G.

It's all levels of directories.

4. The a3 directory can be deleted, and it has been backed up on the hard disk.

5. Ctrl+A can jump directly to the front of the command to input.

6. The up arrow on the keyboard can directly call back the code.

7. Ctrl +C don't use two hands to hit. To tap with one hand.

8. Don't call rename. Called an alias. You can save the command of always typing. For example, enter the environment, conda activate mou alias torch_use exit the environment conda deactivate alias q

9. alias can view alias

10. To find out what bus means in the computer, not a bus, Master is laughing so hard. It means bus.

11. du -sh recursively check the folder size, first enter the folder and then check. Remember to use tab completion, but it needs to be in the directory where it is located.

12. conda remove -n 岩岩--all (delete)

13. Check if cuda is installed successfully

14. To download miniconda, go directly to miniconda's official website. Remember to choose 64-bit, but also Linux. Official website link: https://docs.conda.io/en/latest/miniconda.html

(1) mv XX. Move to the upper directory of XX

(2) chmod 755 Miniconda3-latest-Linux-x86_64.sh #Give execution permission to the .sh file

         chomd gives XX permission and XX turns green
(3) bash Miniconda3-latest-Linux-x86_64.sh #Run

(4) ./ Miniconda3-latest-Linux-x86_64.sh installation (you don't need it, the following installation is successful, it will be useful)
https://blog.csdn.net/qq_42677001/article/details/98472633

 

15. Completely uninstall conda

Miniconda is the son of conda, so the method is the same. A total of four downloads can be completely deleted.

Uninstalling miniconda on this machine does not follow these four steps, so the configuration files such as mirror elements are still the original ones. The configuration files such as alias configuration are also original.

(1) Delete the miniconda installation directory  https://ywnz.com/linuxjc/3834.html

rm -rf ~/miniconda3

(2) Delete the PATH environment variable. Comment out the conda statement with #

vim ~/.bashrc

How to install and uninstall miniconda in linux system

(3) Reactivate .bashrc

source .bashrc

(4) Delete the hidden files and folders that may be created in the home directory (I feel that my miniconda is also not in the home directory. I don’t know if this step is needed. It doesn’t matter. I don’t know if it will break if I use it. Maybe not. Bad, just delete it in the directory where anaconda is located. This is all related to miniconda. If you want to delete it, delete it all)

rm -rf ~/.condarc ~/.conda ~/.continuum

16. du -sh

Recursively view the file size inside

la -l view folder size

17. gedit .condarc (there is a channel and you can delete the default base environment directly)

18. Where does cp -r * go. Copy the files under the folder

Make good use of tabs for completion

19. rm -rf folder: the permissions of the forced deletion folder are not enough, don’t be afraid, you are the king and you can sudo

You can press the up arrow to roll back the previous command, and then alt+A can directly enter sudo with the cursor in front of the command line without typing spaces. The brushed ones are deleted, thief quickly. It feels much better than the mouse, and I have a sense of the command line.

20. df -lh view mount point

The root directory is hung on the physical hard disk. Create a user folder called why in the root directory, enter the why folder, and create a text file touch cute.txt in the why folder

 

The folder created in the root directory and then create a text file says that the permissions are not enough

Therefore, you need to change this permission: this folder belongs to the top-level folder root, and you don’t have the permission to operate root. I feel that the root directory is also under root. You should change the permissions of the folder to home directory. The point here should be to display the upper level directory and the upper level directory. There is no point in the others, so it is not clear.

sudo changes the directory where the folder is located to the home directory, pay attention to use tab to complete, there is also a point, does it correspond to the above point. You can see that a text file has been successfully created.

21. Move the folder. The mv folder goes there: It looks like moving the workspace 2 under another directory in the previous section to the current directory. It seems to be the current directory,... it seems to be the above directory.

 

22. Delete miniconda The command here is a bit simple, the configuration file is not deleted, so the configuration file is still there when re-downloading anaconda.

23. Configure minianaconda

24.rm Miniconda3-latest-Linux-x86_64.sh Why delete Miniconda (I don't understand) Maybe this Miniconda is not very good. So download and install it again.

The magic is that after ls it was still there, and it came back, why and why. I don't understand! ! ! !

25. Move the mv folder to a new folder (how to create a new folder if there is no new folder), it can be seen that it should be the upper directory. . Should be the current directory

26. Configuration and installation

Give execution permission to .sh

Run (installation) After the installation is complete, open the terminal and you will see (base) appear

27. The base virtual environment will be activated by default when the terminal is opened. This virtual environment comes with Miniconda and is useless. So the command line stopped. conda config --set auto_activate_base false

But I found that there is also a configuration in .condarc (I wonder if it is necessary)

28. View the virtual environment: conda env list

29. Create a virtual environment with Python=3.7 conda create -n pt1_7 python=3.7

Usually the unsuccessful download should be a network problem, because the source is configured.

After the virtual environment is successfully created, it will prompt the command to activate this environment and the command to exit this environment

For example, enter the environment conda activate pt1_7 exit the environment conda deactivate

30. It is a waste of time to type so many words every time you enter and exit the environment, so set two aliases for these two commands. Use alias to find alias

Set entry environment alias

gedit .bashrc (.bashrcgedit in the home directory)

gedit .bashrc

31.. .Bashrc I don't understand what it means, but the master clicks every time. It feels like the source is activated. Really guess, guess right.

When the source command under linux modifies a file, I want it to take effect immediately. Instead of logging in again, you can use the source command.

The source command has also become a "dot command", which is a dot symbol (.), which is an internal command of bash.

Function: Make Shell read in the specified Shell program file and execute all the statements in the file in turn.

The source command is usually used to re-execute the newly modified initialization file to make it take effect immediately without having to log out and log in again.

Usage: source filename or .filename

So the file name is .bashrc and executed as. .bashrc immediately executes the bashrc file to make it effective

The full name of rc is the file of the command executed when the run commands are started.

32. The alias of the activated environment can already be seen at the alias arrow.

33. Exit the environment conda deactivate alias is set to q

34. 删除 workspace2:sudo rm -rf workspace2

35. I have done a great job of moving all the files in the folder under the current directory to the current directory.

36. Delete all the files in the current folder. If the tab is not good, it may not be in the directory where the completion folder is located, just switch the folder.

37. Delete a3 in the data folder. I feel that there is no problem with my operation, but it cannot be operated.

38. Use pip to install the package, no need to ask master conda.

 

Guess you like

Origin blog.csdn.net/weixin_42133481/article/details/115198205