Linux环境下的软件安装
一、了解conda
conda就相当于一个软件商店,方便我们在Linux环境中下载学习和使用生信需要用到的程序。
二、下载conda
- 我们本次下载的是miniconda。Miniconda 是一个 Anaconda 的轻量级替代,默认只包含了 python 和 conda,但是可以通过 pip 和 conda 来安装所需要的包。(摘自清华大学开源软件镜像站)
- 下载miniconda推荐使用国内的镜像站(清华大学镜像站),与软件官网相比起来,下载速度会更快些。
- 在镜像站中找到最新版本的miniconda,右键复制下载链接,在服务器指定目录中输入命令下载程序安装包。
bio03@VM-0-6-ubuntu:~/biosoft$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
- 启动安装包安装程序,这里会有一系列需要enter或yes的,注意!
bio03@VM-0-6-ubuntu:~/biosoft$ bash Miniconda3-latest-Linux-x86_64.sh
- 激活conda程序
bio03@VM-0-6-ubuntu:~/biosoft$ source ~/.bashrc
bio03@VM-0-6-ubuntu:~/biosoft$ conda
- 为你的conda添加镜像,为你的学习提速!
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda config --set show_channel_urls yes
三、使用conda
- 查看conda中安装的所有软件
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda list
查看到的安装程序列表
- 搜索程序、下载、卸载
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda search fastqc #搜索fastqc
(base) bio03@VM-0-6-ubuntu:~/biosoft$ conda install fastqc -y #下载fastqc,-y是在安装过程中出现的询问都默认为yes
conda remove fastqc -y #卸载fastqc
四、配置你的conda环境
在生信学习和分析过程中,对于不同的项目,需要用到不同的软件,软件的版本也不相同,这就需要我们配置不同的conda环境。
- 查看已有的conda环境
(base) bio03@VM-0-6-ubuntu:~$ conda info --envs
*表示默认环境
- 配置新的conda环境
(base) bio03@VM-0-6-ubuntu:~$ conda create -n rna-seq python=3 fastqc trimmomatic -y
# -n 表示环境的名称,这里命名为rna-seq
# 指定python为第三版本(表示的是这个环境中与python相关的软件是python3版本的,与我们操作无关)
# 下载fastqc、trimmomatic这两个软件,并默认询问都为yes
-
查看配置好的新环境
配置好了新环境 激活新环境
(base) bio03@VM-0-6-ubuntu:~$ conda activate rna-seq
将默认环境改为了rna-seq
- 退出当前环境
(rna-seq) bio03@VM-0-6-ubuntu:~$ conda deactivate
默认环境又变回了base
五、一些思考
- 在服务器中安装conda或下载软件,也会遇到卡顿问题,重新尝试即可。
- 在学习掌握命令的过程中,不是单纯的死记硬背,了解全称更有助于记忆。