最近使用conda一直在网页上查命令,因此总结一下,用于备忘。
Install and uninstall
# install it
apt-get install anaconda -y
# uninstall it
apt-get purge anaconda -y
Add to System variables
sudo vim /etc/bashrc
export PATH=/tools/anaconda3/bin:$PATH
Change channels
wirte those code below in a bash scripts,and run as root.
conda config --add channels conda-forge
conda config --add channels defaults
conda config --add channels r
conda config --add channels bioconda
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/
conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/
conda config --add channels https://mirrors.ustc.edu.cn/anaconda/cloud/bioconda/
conda config --set show_channel_urls yes
Envrioments arrangement
# view
conda info -e
# create
conda create -n env_name
# active it
conda activate env_name
# exit
conda deactivate env_name
# copy
conda create -n new_env_name --clone old_env_name
# remove
conda remove -name env_name -all
Channels arrangement
# 查看channels
conda config --show channels
# or
conda config --get channels
# add channels
## lowest channels
conda config --add channels http://*
# highest channels
conda config --append channels http://*
# add to current env
conda config --env --add channels http://*
# remove channels
conda config --remove channels http://*
# back to default channels
conda config --remove-key channels
Packages or softwares arrangement
# view all packages or software installed
conda list
# install
conda install software_name=version_number
# install it into env_name
conda install -n env_name software_name
# install it from channel_name
conda install -c channel_name software_name
# for r, for example
conda install r-base
conda install r-ggplot2
conda install bioconductor-GenomicRanges
# update a software
conda update software_name
# update all
conda update --all
Debug
CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.ustc.edu.cn/anaconda/pkg
Use vim get in /.condarc and edit https to http will be ok!!!
reference link as this
)
/bin/bash: 1: x86_64-conda_cos6-linux-gnu-c++: not found
just install some files as the reference link below guides.
reference link as this
use conda but without priverlige, in which leads to lots of errors.
sudo chown user_name folder_name -R
# for example:
sudo chown asd anaconda/ -R