思维导图
linux环境下的软件安装
下载miniconda
- 清华的conda镜像网站
浏览器搜索 “miniconda 清华”
- 查看服务器是多少位的
# 打开服务器,输入命令 uname -a,
bio06@VM-0-6-ubuntu:~$ uname -a
Linux VM-0-6-ubuntu 4.15.0-118-generic #119-Ubuntu SMP Tue Sep 8 12:30:01 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
选择相应的位数,右键-复制下载链接
- 可以新建一个biosoft目录并进入
#看看自己在哪里
bio06@VM-0-6-ubuntu:~$ pwd
/home/bio06
# mkdir+空格+想要建的文件名(biosoft)
bio06@VM-0-6-ubuntu:~$ mkdir biosoft
#ls 显示目录和文件,看看有没有在bio06下创立biosoft
bio06@VM-0-6-ubuntu:~$ ls
biosoft rm_text tmp
#cd+空格+想要进入的文件名(biosoft)
bio06@VM-0-6-ubuntu:~$ cd biosoft
bio06@VM-0-6-ubuntu:~/biosoft$
- 下载
wget + 刚才复制的清华的下载链接
wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda-1.6.0-Linux-x86_64.sh
回车后出现下列一大长串,尤其是最后的单词“saved”,表示OK了
--2021-04-21 22:22:03-- https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda-1.6.0-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: 19618279 (19M) [application/octet-stream]
Saving to: ‘Miniconda-1.6.0-Linux-x86_64.sh’
Miniconda-1.6.0-Linux-x86_64.sh 100%[=======================================================================================================================================================>] 18.71M 11.8MB/s in
2021-04-21 22:22:05 (11.8 MB/s) - ‘Miniconda-1.6.0-Linux-x86_64.sh’ saved [19618279/19618279]
安装miniconda
先讲2个错误的例子
第一个例子
# 输入了bash的安装命令
bio06@VM-0-6-ubuntu:~/biosoft$ bash Miniconda3-latest-Linux-x86_64.sh
# 但显示没有这个文件或目录
bash: Miniconda3-latest-Linux-x86_64.sh: No such file or directory
(bash就是安装的意思,如用这句话“bash Miniconda3-latest-Linux-x86_64.sh”安装这句话“wget https://mirrors.tuna.tsinghua.edu.cn/anaconda/miniconda/Miniconda3-latest-Linux-x86_64.sh”下载的miniconda,可见bash命令是安装)
这是因为下载的conda 与安装的conda不是一个,看下面的图片:
我下载的是:
我安装的是:
(这句代码是我直接复制的,可见不懂代码的背后含义直接复制别人的代码有多危险)
教训:下载的与安装的必须名称一致,否则计算机找不到你指令的文件,可以用“bash”+安装完成后单词“saved”后面的文件名
第二个例子
# 无意中用了命令cd ..返回到了上一级文件夹
bio06@VM-0-6-ubuntu:~/biosoft$ cd ..
# 安装指令与下载的conda不是一个,肯定不行,对吧,对!
bio06@VM-0-6-ubuntu:~$ bash Miniconda3-latest-Linux-x86_64.sh
bash: Miniconda3-latest-Linux-x86_64.sh: No such file or directory
bio06@VM-0-6-ubuntu:~$ ls
biosoft rm_text tmp
# 但是此时我意识到了错误,更改了安装名,还是说没有文件或目录
bio06@VM-0-6-ubuntu:~$ bash Miniconda-1.6.0-latest-Linux-x86_64.sh
bash: Miniconda-1.6.0-latest-Linux-x86_64.sh: No such file or directory
这是因为我下载的conda在biosoft文件夹下(目录文件夹,姑且先叫文件夹),而我安装是在bio06文件夹下,为什么呢?我刚才不是cd+空格+我想要进入的文件夹名称了吗?
原因是我无意当中用了cd..
#cd biosoft进入这个文件夹,ls看看所有文件或目录
bio06@VM-0-6-ubuntu:~$ cd biosoft
bio06@VM-0-6-ubuntu:~/biosoft$ ls
Miniconda-1.6.0-Linux-x86_64.sh #果然在这
# 确认一下,就是在biosoft,我刚才在bio06里命令Linux安装conda,但bio06里根本没有安装包(安装包我下载到了biosoft)
bio06@VM-0-6-ubuntu:~/biosoft$ pwd
/home/bio06/biosoft
教训:安装包下载到了哪里,就在哪里叫Linux安装
剩下的就是一路该ENTER的ENTER,该YES的YES
激活miniconda
# 具体原理不也不太明白
bio06@VM-0-6-ubuntu:~$ echo 'export PATH=~/miniconda3/bin:$PATH' >> ~/.bashrc # 这句话好像是说:如果不把miniconda加入环境变量,输入的命令不会再miniconda文件夹里找,而conda在miniconda文件夹里,所以输入conda就没反应;而把miniconda加入环境变量,就会把miniconda文件夹列入搜索范围,所以conda成功运行(摘自算是某前辈吧)
bio06@VM-0-6-ubuntu:~$ source ~/.bashrc
命令行再输入conda,出现满屏的信息说明成功了
添加镜像
把下面的代码全部复制到命令行,粘贴、回车(不太理解代码的意思)
# 使用清华镜像
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
使用conda
查看当前服务器上安装的所有软件列表 conda list
bio06@VM-0-6-ubuntu:~$ conda list
# packages in environment at /home/bio06/miniconda3:
#
# Name Version Build Channel
_libgcc_mutex 0.1 main defaults
brotlipy 0.7.0 py38h27cfd23_1003 defaults
ca-certificates 2020.10.14 0 defaults
certifi 2020.6.20 pyhd3eb1b0_3 defaults
cffi 1.14.3 py38h261ae71_2 defaults
chardet 3.0.4 py38h06a4308_1003 defaults
conda 4.9.2 py38h06a4308_0 defaults
conda-package-handling 1.7.2 py38h03888b9_0 defaults
cryptography 3.2.1 py38h3c74f83_1 defaults
idna 2.10 py_0 defaults
ld_impl_linux-64 2.33.1 h53a641e_7 defaults
libedit 3.1.20191231 h14c3975_1 defaults
libffi 3.3 he6710b0_2 defaults
libgcc-ng 9.1.0 hdf63c60_0 defaults
libstdcxx-ng 9.1.0 hdf63c60_0 defaults
ncurses 6.2 he6710b0_1 defaults
openssl 1.1.1h h7b6447c_0 defaults
pip 20.2.4 py38h06a4308_0 defaults
pycosat 0.6.3 py38h7b6447c_1 defaults
pycparser 2.20 py_2 defaults
pyopenssl 19.1.0 pyhd3eb1b0_1 defaults
pysocks 1.7.1 py38h06a4308_0 defaults
python 3.8.5 h7579374_1 defaults
readline 8.0 h7b6447c_0 defaults
requests 2.24.0 py_0 defaults
ruamel_yaml 0.15.87 py38h7b6447c_1 defaults
setuptools 50.3.1 py38h06a4308_1 defaults
six 1.15.0 py38h06a4308_0 defaults
sqlite 3.33.0 h62c20be_0 defaults
tk 8.6.10 hbc83047_0 defaults
tqdm 4.51.0 pyhd3eb1b0_0 defaults
urllib3 1.25.11 py_0 defaults
wheel 0.35.1 pyhd3eb1b0_0 defaults
xz 5.2.5 h7b6447c_0 defaults
yaml 0.2.5 h7b6447c_0 defaults
zlib 1.2.11 h7b6447c_3 defaults
搜索conda软件 conda search fastqc (以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 hdfd78af_5 anaconda/cloud/bioconda
fastqc 0.11.5 pl5.22.0_2 anaconda/cloud/bioconda
fastqc 0.11.5 pl5.22.0_3 anaconda/cloud/bioconda
fastqc 0.11.6 2 anaconda/cloud/bioconda
fastqc 0.11.6 pl5.22.0_0 anaconda/cloud/bioconda
fastqc 0.11.6 pl5.22.0_1 anaconda/cloud/bioconda
fastqc 0.11.7 4 anaconda/cloud/bioconda
fastqc 0.11.7 5 anaconda/cloud/bioconda
fastqc 0.11.7 6 anaconda/cloud/bioconda
fastqc 0.11.7 hdfd78af_7 anaconda/cloud/bioconda
fastqc 0.11.7 pl5.22.0_0 anaconda/cloud/bioconda
fastqc 0.11.7 pl5.22.0_2 anaconda/cloud/bioconda
fastqc 0.11.8 0 anaconda/cloud/bioconda
fastqc 0.11.8 1 anaconda/cloud/bioconda
fastqc 0.11.8 2 anaconda/cloud/bioconda
fastqc 0.11.9 0 anaconda/cloud/bioconda
fastqc 0.11.9 hdfd78af_1 anaconda/cloud/bioconda
安装软件 conda install fastqc -y (-y是yes,过程中conda问你的问题全部回答yes)
bio06@VM-0-6-ubuntu:~$ conda install fastqc -y
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 4.9.2
latest version: 4.10.1
Please update conda by running
$ conda update -n base -c defaults conda
## Package Plan ##
environment location: /home/bio06/miniconda3
added / updated specs:
- fastqc
The following packages will be downloaded:
package | build
---------------------------|-----------------
ca-certificates-2020.12.5 | ha878542_0 137 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
certifi-2020.12.5 | py38h578d9bd_1 143 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
conda-4.10.1 | py38h578d9bd_0 3.1 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
fastqc-0.11.9 | hdfd78af_1 9.7 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda
font-ttf-dejavu-sans-mono-2.37| hab24e00_0 388 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
fontconfig-2.13.1 | h7e3eb15_1002 324 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
freetype-2.10.4 | h7ca028e_0 912 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
icu-67.1 | he1b5a44_0 12.9 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libiconv-1.16 | h516909a_0 1.4 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libpng-1.6.37 | h21135ba_2 306 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libuuid-2.32.1 | h14c3975_1000 26 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
libxml2-2.9.10 | h68273f3_2 1.3 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openjdk-10.0.2 | h14c3975_1015 189.2 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
openssl-1.1.1k | h27cfd23_0 2.5 MB defaults
perl-5.32.0 | h36c2ea0_0 16.8 MB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
python_abi-3.8 | 1_cp38 4 KB https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge
------------------------------------------------------------
Total: 239.0 MB
The following NEW packages will be INSTALLED:
fastqc anaconda/cloud/bioconda/noarch::fastqc-0.11.9-hdfd78af_1
font-ttf-dejavu-s~ anaconda/cloud/conda-forge/noarch::font-ttf-dejavu-sans-mono-2.37-hab24e00_0
fontconfig anaconda/cloud/conda-forge/linux-64::fontconfig-2.13.1-h7e3eb15_1002
freetype anaconda/cloud/conda-forge/linux-64::freetype-2.10.4-h7ca028e_0
icu anaconda/cloud/conda-forge/linux-64::icu-67.1-he1b5a44_0
libiconv anaconda/cloud/conda-forge/linux-64::libiconv-1.16-h516909a_0
libpng anaconda/cloud/conda-forge/linux-64::libpng-1.6.37-h21135ba_2
libuuid anaconda/cloud/conda-forge/linux-64::libuuid-2.32.1-h14c3975_1000
libxml2 anaconda/cloud/conda-forge/linux-64::libxml2-2.9.10-h68273f3_2
openjdk anaconda/cloud/conda-forge/linux-64::openjdk-10.0.2-h14c3975_1015
perl anaconda/cloud/conda-forge/linux-64::perl-5.32.0-h36c2ea0_0
python_abi anaconda/cloud/conda-forge/linux-64::python_abi-3.8-1_cp38
The following packages will be UPDATED:
ca-certificates pkgs/main::ca-certificates-2020.10.14~ --> anaconda/cloud/conda-forge::ca-certificates-2020.12.5-ha878542_0
certifi pkgs/main/noarch::certifi-2020.6.20-p~ --> anaconda/cloud/conda-forge/linux-64::certifi-2020.12.5-py38h578d9bd_1
conda pkgs/main::conda-4.9.2-py38h06a4308_0 --> anaconda/cloud/conda-forge::conda-4.10.1-py38h578d9bd_0
openssl 1.1.1h-h7b6447c_0 --> 1.1.1k-h27cfd23_0
Downloading and Extracting Packages
ca-certificates-2020 | 137 KB | ########################################################################################################################################################################################################### | 100%
font-ttf-dejavu-sans | 388 KB | ########################################################################################################################################################################################################### | 100%
openjdk-10.0.2 | 189.2 MB | ########################################################################################################################################################################################################### | 100%
conda-4.10.1 | 3.1 MB | ########################################################################################################################################################################################################### | 100%
libiconv-1.16 | 1.4 MB | ########################################################################################################################################################################################################### | 100%
python_abi-3.8 | 4 KB | ########################################################################################################################################################################################################### | 100%
libxml2-2.9.10 | 1.3 MB | ########################################################################################################################################################################################################### | 100%
perl-5.32.0 | 16.8 MB | ########################################################################################################################################################################################################### | 100%
freetype-2.10.4 | 912 KB | ########################################################################################################################################################################################################### | 100%
certifi-2020.12.5 | 143 KB | ########################################################################################################################################################################################################### | 100%
fontconfig-2.13.1 | 324 KB | ########################################################################################################################################################################################################### | 100%
openssl-1.1.1k | 2.5 MB | ########################################################################################################################################################################################################### | 100%
libpng-1.6.37 | 306 KB | ########################################################################################################################################################################################################### | 100%
fastqc-0.11.9 | 9.7 MB | ########################################################################################################################################################################################################### | 100%
icu-67.1 | 12.9 MB | ########################################################################################################################################################################################################### | 100%
libuuid-2.32.1 | 26 KB | ########################################################################################################################################################################################################### | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: done
卸载软件 conda remove fastqc -y
bio06@VM-0-6-ubuntu:~$ conda remove fastqc -y
Collecting package metadata (repodata.json): failed
# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<
Traceback (most recent call last):
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/exceptions.py", line 1079, in __call__
return func(*args, **kwargs)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/cli/main.py", line 84, in _main
exit_code = do_call(args, p)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/cli/conda_argparse.py", line 83, in do_call
return getattr(module, func_name)(args, parser)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/cli/main_remove.py", line 90, in execute
txn = solver.solve_for_transaction()
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/solve.py", line 114, in solve_for_transaction
unlink_precs, link_precs = self.solve_for_diff(update_modifier, deps_modifier,
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/solve.py", line 157, in solve_for_diff
final_precs = self.solve_final_state(update_modifier, deps_modifier, prune, ignore_pinned,
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/solve.py", line 262, in solve_final_state
ssc = self._collect_all_metadata(ssc)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/solve.py", line 425, in _collect_all_metadata
index, r = self._prepare(prepared_specs)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/solve.py", line 1020, in _prepare
reduced_index = get_reduced_index(self.prefix, self.channels,
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/index.py", line 288, in get_reduced_index
new_records = SubdirData.query_all(spec, channels=channels, subdirs=subdirs,
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 140, in query_all
result = tuple(concat(executor.map(subdir_query, channel_urls)))
File "/home/bio06/miniconda3/lib/python3.8/concurrent/futures/_base.py", line 611, in result_iterator
yield fs.pop().result()
File "/home/bio06/miniconda3/lib/python3.8/concurrent/futures/_base.py", line 439, in result
return self.__get_result()
File "/home/bio06/miniconda3/lib/python3.8/concurrent/futures/_base.py", line 388, in __get_result
raise self._exception
File "/home/bio06/miniconda3/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 132, in <lambda>
subdir_query = lambda url: tuple(SubdirData(Channel(url), repodata_fn=repodata_fn).query(
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 145, in query
self.load()
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 209, in load
_internal_state = self._load()
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 403, in _load
_internal_state = self._process_raw_repodata_str(raw_repodata_str)
File "/home/bio06/miniconda3/lib/python3.8/site-packages/conda/core/subdir_data.py", line 476, in _process_raw_repodata_str
json_obj = json.loads(raw_repodata_str or '{}')
File "/home/bio06/miniconda3/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/home/bio06/miniconda3/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/bio06/miniconda3/lib/python3.8/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Unterminated string starting at: line 645753 column 7 (char 19480398)
`$ /home/bio06/miniconda3/bin/conda remove fastqc -y`
environment variables:
CIO_TEST=<not set>
CONDA_ROOT=/home/bio06/miniconda3
CURL_CA_BUNDLE=<not set>
PATH=/home/bio06/miniconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/u
sr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
REQUESTS_CA_BUNDLE=<not set>
SSL_CERT_FILE=<not set>
active environment : None
user config file : /home/bio06/.condarc
populated config files : /home/bio06/.condarc
conda version : 4.10.1
conda-build version : not installed
python version : 3.8.5.final.0
virtual packages : __linux=4.15.0=0
__glibc=2.27=0
__unix=0=0
__archspec=1=x86_64
base environment : /home/bio06/miniconda3 (writable)
conda av data dir : /home/bio06/miniconda3/etc/conda
conda av metadata url : https://repo.anaconda.com/pkgs/main
channel URLs : https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/noarch
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/linux-64
https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/noarch
https://repo.anaconda.com/pkgs/main/linux-64
https://repo.anaconda.com/pkgs/main/noarch
https://repo.anaconda.com/pkgs/r/linux-64
https://repo.anaconda.com/pkgs/r/noarch
package cache : /home/bio06/miniconda3/pkgs
/home/bio06/.conda/pkgs
envs directories : /home/bio06/miniconda3/envs
/home/bio06/.conda/envs
platform : linux-64
user-agent : conda/4.10.1 requests/2.24.0 CPython/3.8.5 Linux/4.15.0-118-generic ubuntu/18.04.4 glibc/2.27
UID:GID : 1007:1007
netrc file : None
offline mode : False
An unexpected error has occurred. Conda has prepared the above report.
Upload successful.
课程进阶
进阶课程的学习还有点不太理解,再学习