先上今天的思維導(dǎo)圖:
linux如何安裝軟件.png

linux如何安裝軟件.png
1. 了解conda
簡(jiǎn)單的說——linux的應(yīng)用商店,除此之外還有幾個(gè)概念。
- bioconda
- miniconda
- conda
- anaconda
以上四者區(qū)別,參考 關(guān)于bioconda, miniconda, conda, anaconda的區(qū)別

來源:生信星球
2. 安裝miniconda
(1)進(jìn)入網(wǎng)站
搜索“miniconda 清華”,進(jìn)入。搜素得到鏈接為:https://mirror.tuna.tsinghua.edu.cn/help/anaconda/

進(jìn)入頁(yè)面如上
(2)查看服務(wù)器
登錄輸入命令
uname -a
bio18@VM-0-10-ubuntu:~$ uname -a
Linux VM-0-10-ubuntu 4.15.0-54-generic #58-Ubuntu SMP Mon Jun 24 10:55:24 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
(3)安裝最新版
進(jìn)入(1)中頁(yè)面,https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
找到下載最新版,復(fù)制鏈接
在linux中,Windows復(fù)制——鼠標(biāo)左鍵點(diǎn)一下,粘貼——右鍵;Mac直接cmd + c 復(fù)制,cmd + v 粘貼

進(jìn)入到biosoft目錄,安裝
cd biosoft復(fù)制鏈接
wget 剛剛復(fù)制的鏈接
bio18@VM-0-10-ubuntu:~/biosoft$ wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
--2020-04-08 20:52:33-- https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh
Resolving mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)... 101.6.8.193, 2402:f000:1:408:8100::1
Connecting to mirrors.tuna.tsinghua.edu.cn (mirrors.tuna.tsinghua.edu.cn)|101.6.8.193|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 85055499 (81M) [application/octet-stream]
Saving to: ‘Miniconda3-latest-Linux-x86_64.sh’
Miniconda3-latest-L 100%[===================>] 81.12M 3.52MB/s in 21s
2020-04-08 20:52:55 (3.84 MB/s) - ‘Miniconda3-latest-Linux-x86_64.sh’ saved [85055499/85055499]
bio18@VM-0-10-ubuntu:~/biosoft$ bash Miniconda3-latest-Linux-x86_64.sh
Welcome to Miniconda3 4.8.2
In order to continue the installation process, please review the license
agreement.
Please, press ENTER to continue
>>>
===================================
根據(jù)提示完成安裝
(4)激活conda
輸入命令 source ~/.bashrc
Thank you for installing Miniconda3!
bio18@VM-0-10-ubuntu:~/biosoft$ source ~/.bashrc
可以輸入conda來檢查,因?yàn)槠浜鬀]有加具體的東西,會(huì)出現(xiàn)大段提示,報(bào)錯(cuò),則沒有激活
(5)添加鏡像
直接復(fù)制粘貼到命令行,回車
# 使用清華鏡像
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/bioconda
conda config --set show_channel_urls yes
(來源:生信星球)
(base) bio18@VM-0-10-ubuntu:~/biosoft$ 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/bioconda
conda config --set show_channel_urls yes(base)
Ready!
2. conda基本操作
- 查看當(dāng)前所有列表
conda list
(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda list
# packages in environment at /home/bio18/miniconda3:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main defaults
asn1crypto 1.3.0 py37_0 defaults
ca-certificates 2020.1.1 0 defaults
后面還很多
- 搜索軟件
conda search fastqc
(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda search fastqc
Loading channels: done
# Name Version Build Channel
fastqc 0.10.1 0 anaconda/cloud/bioconda
fastqc 0.10.1 1 anaconda/cloud/bioconda
fastqc 0.11.2 1 anaconda/cloud/bioconda
fastqc 0.11.2 pl5.22.0_0 anaconda/cloud/bioconda
fastqc 0.11.3 0 anaconda/cloud/bioconda
fastqc 0.11.3 1 anaconda/cloud/bioconda
fastqc 0.11.4 0 anaconda/cloud/bioconda
fastqc 0.11.4 1 anaconda/cloud/bioconda
fastqc 0.11.4 2 anaconda/cloud/bioconda
fastqc 0.11.5 1 anaconda/cloud/bioconda
fastqc 0.11.5 4 anaconda/cloud/bioconda
fastqc 0.11.5 pl5.22.0_2 anaconda/cloud/bioconda
以fastqc為例
- 安裝軟件
conda install fastqc -y-y自動(dòng)安裝,沒有則會(huì)出現(xiàn)問你可不可以
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.8.2
latest version: 4.8.3
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/bio18/miniconda3
自動(dòng)安裝最新
- 卸載軟件
conda remove fasty -y
(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda remove fastqc -y
Collecting package metadata (repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/bio18/miniconda3
removed specs:
- fastqc
The following packages will be downloaded:
package | build
---------------------------|-----------------
_libgcc_mutex-0.1 | conda_forge 3 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
3. conda選修操作

來源:生信星球
(懶懶怕迷路)
- 查看conda當(dāng)前環(huán)境
conda info --envs
(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base * /home/bio18/miniconda3
前面帶*為默認(rèn)
- 建立一個(gè)處理轉(zhuǎn)錄組的環(huán)境rna-seq,指定python版本是3,安裝軟件fastqc、trimmmomatic
conda create -n rna-seq python=3 fastqc trimmomatic -y
Collecting package metadata (current_repodata.json): done
Solving environment: done
## Package Plan ##
environment location: /home/bio18/miniconda3/envs/rna-seq
added / updated specs:
- fastqc
- python=3
- trimmomatic
The following packages will be downloaded:
package | build
---------------------------|-----------------
certifi-2020.4.5.1 | py38h32f6830_0 151 KB https://mirrors
- 檢查環(huán)境
(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base * /home/bio18/miniconda3
rna-seq /home/bio18/miniconda3/envs/rna-seq
- 激活新環(huán)境
conda activate rna-seq
(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda activate rna-seq
(rna-seq) bio18@VM-0-10-ubuntu:~/biosoft$ fastqc
Exception in thread "main" java.awt.HeadlessException:
No X11 DISPLAY variable was set, but this program performed an operation which requires it.
at java.desktop/java.awt.GraphicsEnvironment.checkHeadless(GraphicsEnvironment.java:208)
(rna-seq)在用戶名前,輸入fastqc,有提示——成功