linux 安装软件_linux如何安装软件

这是生信学习的第3

b866ca0a647081b57132367fc910910a.png

先上今天的思维导图

474bfb1775938a4bcb0fb54de5c8f07c.png
linux如何安装软件
1. 了解conda

简单的说——linux的应用商店,除此之外还有几个概念。

  • bioconda

  • miniconda

  • conda

  • anaconda
    以上四者区别,参考 [关于bioconda, miniconda, conda, anaconda的区别](https://www.jianshu.com/p/0534043b4471
    )

15f9aa89b28d90e3a06c5e2cc15af3e9.png
来源:生信星球
2. 安装miniconda

(1)进入网站
搜索“miniconda 清华”,进入。搜素得到链接为:https://mirror.tuna.tsinghua.edu.cn/help/anaconda/

f754ef64f56e3b2f81bb0b3d5241102d.png
进入页面如上
(2)查看服务器 登录输入命令 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)安装最新版
进入(1)中页面,https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/
找到下载最新版,复制链接在linux中,Windows复制——鼠标左键点一下,粘贴——右键;Mac直接cmd + c 复制,cmd + v 粘贴

fbfad4798ad616b4c27a475ba6cf88f4.png
进入到biosoft目录,安装 cd biosoft 复制链接 wget 刚刚复制的链接
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
>>>
===================================

根据提示完成安装

(4)激活conda

输入命令 source ~/.bashrc
Thank you for installing Miniconda3!
bio18@VM-0-10-ubuntu:~/biosoft$ source ~/.bashrc可以输入conda来检查,因为其后没有加具体的东西,会出现大段提示,报错,则没有激活

(5)添加镜像
直接复制粘贴到命令行,回车

# 使用清华镜像
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!

3. conda基本操作
  • 查看当前所有列表 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自动安装,没有则会出现问你可不可以

(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda install fastqc -y
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

自动安装最新

  • 卸载软件 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
4. conda选修操作
369b946b9c7dd1055612d596c7068969.png
来源:生信星球
(懒懒怕迷路)
  • 查看conda当前环境 conda info --envs

(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base                  *  /home/bio18/miniconda3

前面带*为默认

  • 建立一个处理转录组的环境rna-seq,指定python版本是3,安装软件fastqc、trimmmomatic  conda create -n rna-seq python=3 fastqc trimmomatic -y

(base) bio18@VM-0-10-ubuntu:~/biosoft$ 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
  • 检查环境

(base) bio18@VM-0-10-ubuntu:~/biosoft$ conda info --envs
# conda environments:
#
base                  *  /home/bio18/miniconda3
rna-seq                  /home/bio18/miniconda3/envs/rna-seq
  • 激活新环境 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,有提示——成功

最后放一个写的很好的笔记: conda的安装与使用 https://www.jianshu.com/p/edaa744ea47d

a2e461457bae3510e3d91d352ba76690.gif

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值