使用Hyperledger Fabric对pbft算法进行caliper压测,测试吞吐量及时延

该教程基于ubuntu 20.04, python 2.7,docker doker-compose
视频链接:
https://www.bilibili.com/video/BV1NG4y1i72C/?vd_source=4626f6d54b75eb4cf0022a6864f35f58

#安装相应环境,拉取fabric实例源码
sudo apt install gcc make python2.7 g++
git clone https://github.com/yezhem/fabric-sample
#工具包,用来部署fabric网络
git clone https://gitee.com/real__cool/fabric_install

#解压golang语言
wget https://golang.google.cn/dl/go1.18.4.linux-amd64.tar.gz
sudo tar -C /usr/local -xzf go1.18.4.linux-amd64.tar.gz

#设置go环境变量
mkdir go
export GOPATH=$HOME/go
export GOROOT=/usr/local/go
export PATH=$GOROOT/bin:$PATH

mkdir -p $GOPATH/src/github.com/hyperledger/
cd $GOPATH/src/github.com/hyperledger/
git clone https://github.com/hyperledger/fabric

#这里可能git可能会因为容量报错,要修改git容量
git config --global http.postBuffer 524288000  # 设置为500MB
cd fabric/
git checkout v1.4.4
#根据文件目录文件,修改行号与内容
#可以直接vi common/tools/configtxgen/localconfig/config.go进行打开编辑文件信息
common/tools/configtxgen/localconfig/config.go
388 case "pbft":
common/tools/configtxgen/encoder/encoder.go
39  ConsensusTypePbft = "pbft"
216 case ConsensusTypePbft:
orderer/common/server/main.go
50 "github.com/hyperledger/fabric/orderer/consensus/pbft"
650 consenters["pbft"] = pbft.New()


mkdir -p $GOPATH/src/golang.org/x
cd $GOPATH/src/golang.org/x
git clone https://github.com/golang/tools.git

#拷贝pbft源码到fabric源码
cd orderer/consensus/
cp -r ~/fabric-sample/pbft .
Cd ../..
#编译orderer镜像
make orderer-docker
#关闭GO111MODULE
export GO111MODULE=off
make configtxgen

Cd -
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
nvm install 8.15
nvm alias default 8.15
#设置淘宝源
npm config set registry https://registry.npm.taobao.org

cp fabric_install/bootstrap3.sh .
chmod +x bootstrap3.sh
./bootstrap3.sh 1.4.4 1.4.4


cd fabric-samples/bin
pwd
vim ~/.bashrc #添加环境变量
source ~/.bashrc
which peer
Cd ~


cd fabric-sampl
cd pbft-network
#该文件的59行,要修改的代码
59 docker-compose-cli.yaml
Cd base
#下方文件的4和17行均要修改为下方
4,17 peer-base.yaml


#添加python环境变量到.bashrc
export PYTHON=/usr/bin/python2.7

npm config set registry http://registry.cnpmjs.org
npm config set registry http://registry.npm.taobao.org 


#安装caliper-cli
npm install -g --only=prod @hyperledger/caliper-cli@0.3.2
#绑定sut,这里出错了就重试几次
caliper bind --caliper-bind-sut fabric:1.4.4 --caliper-bind-args=-g
#下载caliper-core
cd /home/test/fabric-sample/chaincode/demo/callback
npm install @hyperledger/caliper-core@0.3.2


cd ~/fabric-samples/bin
#制作好的二进制文件替换原来的,才可以识别pbft
cp ~/go/src/github.com/hyperledger/fabric/.build/bin/configtxgen .
#给新制作好的镜像打上标签latest,这里06bc1fdea693是刚做好的镜像
docker tag 6e614d03d42e hyperledger/fabric-orderer:latest
sudo ./scripts/utils.sh down
./scripts/gen.sh
./scripts/utils.sh up
#到这里就启动好pbft网络了

#caliper测试
sudo ./scripts/utils.sh down


sudo ./scripts/utils.sh down && npx caliper launch master --caliper-workspace ./ --caliper-benchconfig benchmarks/config.yaml --caliper-networkconfig benchmarks/network.yaml

输出的report.html 就是本次测试的报告,可以在浏览器中查看
下方为跑出来的实验报告,附截图:

在这里插入图片描述

该博客下还附着shell里面进行压测的所有日志记录:进行了资源绑定,可以查看,博客还附件ubuntu的安装该压测所需的环境日志:


测试不易,希望各位观众老爷们,点点关注!!!


ubuntu 20.04, python 2.7,docker doker-compose

Xshell 7 (Build 0151)
Copyright © 2020 NetSarang Computer, Inc. All rights reserved.

Type `help’ to learn how to use Xshell prompt.
[C:~]$

Connecting to 192.168.37.137:22…
Could not connect to ‘192.168.37.137’ (port 22): Connection failed.

Type `help’ to learn how to use Xshell prompt.
[C:~]$

Connecting to 192.168.37.137:22…
Connection established.
To escape to local shell, press ‘Ctrl+Alt+]’.

Welcome to Ubuntu Focal Fossa (development branch) (GNU/Linux 5.4.0-176-generic x86_64)

  • Documentation: https://help.ubuntu.com
  • Management: https://landscape.canonical.com
  • Support: https://ubuntu.com/advantage

724 updates can be installed immediately.
426 of these updates are security updates.
To see these additional updates run: apt list --upgradable

The programs included with the Ubuntu system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Ubuntu comes with ABSOLUTELY NO WARRANTY, to the extent permitted by
applicable law.

/usr/bin/xauth: file /home/test/.Xauthority does not exist
test@ubuntu:~$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
[sudo] password for test:
test@ubuntu:~$ sudo apt-update
sudo: apt-update: command not found
test@ubuntu:~$ sudo vi /etc/apt/sources.list
test@ubuntu:~$ sudo vi /etc/apt/sources.list
test@ubuntu:~$ sudo apt-update
sudo: apt-update: command not found
test@ubuntu:~$ sudo apt update
Get:1 https://mirrors.bfsu.edu.cn/ubuntu focal InRelease [265 kB]
Get:2 https://mirrors.bfsu.edu.cn/ubuntu focal-updates InRelease [114 kB]
Get:3 https://mirrors.bfsu.edu.cn/ubuntu focal-backports InRelease [108 kB]
Get:4 https://mirrors.bfsu.edu.cn/ubuntu focal/main i386 Packages [718 kB]
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Get:6 https://mirrors.bfsu.edu.cn/ubuntu focal/main amd64 Packages [970 kB]
Get:7 https://mirrors.bfsu.edu.cn/ubuntu focal/main Translation-en [506 kB]
Get:8 https://mirrors.bfsu.edu.cn/ubuntu focal/main amd64 c-n-f Metadata [29.5 kB]
Get:9 https://mirrors.bfsu.edu.cn/ubuntu focal/restricted i386 Packages [8,112 B]
Get:10 https://mirrors.bfsu.edu.cn/ubuntu focal/restricted amd64 Packages [22.0 kB]
Get:11 https://mirrors.bfsu.edu.cn/ubuntu focal/restricted Translation-en [6,212 B]
Get:12 https://mirrors.bfsu.edu.cn/ubuntu focal/restricted amd64 c-n-f Metadata [392 B]
Get:13 https://mirrors.bfsu.edu.cn/ubuntu focal/universe i386 Packages [4,642 kB]
Hit:14 http://us.archive.ubuntu.com/ubuntu focal InRelease
Get:15 https://mirrors.bfsu.edu.cn/ubuntu focal/universe amd64 Packages [8,628 kB]
Hit:16 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Get:17 https://mirrors.bfsu.edu.cn/ubuntu focal/universe Translation-en [5,124 kB]
Get:18 https://mirrors.bfsu.edu.cn/ubuntu focal/universe amd64 c-n-f Metadata [265 kB]
Get:19 https://mirrors.bfsu.edu.cn/ubuntu focal/multiverse amd64 Packages [144 kB]
Get:20 https://mirrors.bfsu.edu.cn/ubuntu focal/multiverse i386 Packages [74.7 kB]
Get:21 https://mirrors.bfsu.edu.cn/ubuntu focal/multiverse Translation-en [104 kB]
Get:22 https://mirrors.bfsu.edu.cn/ubuntu focal/multiverse amd64 c-n-f Metadata [9,136 B]
Get:23 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/main amd64 Packages [3,247 kB]
Get:24 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/main i386 Packages [959 kB]
Hit:25 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Get:26 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/main Translation-en [513 kB]
Get:27 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/main amd64 c-n-f Metadata [17.2 kB]
Get:28 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/restricted amd64 Packages [2,842 kB]
Get:29 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/restricted i386 Packages [37.2 kB]
Get:30 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/restricted Translation-en [397 kB]
Get:31 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/restricted amd64 c-n-f Metadata [552 B]
Get:32 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/universe i386 Packages [781 kB]
Get:33 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/universe amd64 Packages [1,177 kB]
Get:34 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/universe Translation-en [282 kB]
Get:35 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/universe amd64 c-n-f Metadata [25.7 kB]
Get:36 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/multiverse amd64 Packages [26.2 kB]
Get:37 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/multiverse i386 Packages [8,444 B]
Get:38 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/multiverse Translation-en [7,880 B]
Get:39 https://mirrors.bfsu.edu.cn/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [620 B]
Get:40 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/main i386 Packages [36.1 kB]
Get:41 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/main amd64 Packages [45.7 kB]
Get:42 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/main Translation-en [16.3 kB]
Get:43 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/main amd64 c-n-f Metadata [1,420 B]
Get:44 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B]
Get:45 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/universe i386 Packages [13.8 kB]
Get:46 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/universe amd64 Packages [25.0 kB]
Get:47 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/universe Translation-en [16.3 kB]
Get:48 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/universe amd64 c-n-f Metadata [880 B]
Get:49 https://mirrors.bfsu.edu.cn/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B]
Fetched 32.2 MB in 3s (9,339 kB/s)
Reading package lists… Done
Building dependency tree
Reading state information… Done
692 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
test@ubuntu:~$ sudo vi /etc/apt/sources.list
test@ubuntu:~$ sudo apt update
Hit:1 http://mirrors.bfsu.edu.cn/ubuntu focal InRelease
Hit:2 http://mirrors.bfsu.edu.cn/ubuntu focal-updates InRelease
Hit:3 http://mirrors.bfsu.edu.cn/ubuntu focal-backports InRelease
Hit:4 http://us.archive.ubuntu.com/ubuntu focal InRelease
Hit:5 http://security.ubuntu.com/ubuntu focal-security InRelease
Hit:6 http://us.archive.ubuntu.com/ubuntu focal-updates InRelease
Hit:7 http://us.archive.ubuntu.com/ubuntu focal-backports InRelease
Reading package lists… Done
Building dependency tree
Reading state information… Done
692 packages can be upgraded. Run ‘apt list --upgradable’ to see them.
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
test@ubuntu:~$ sudo apt install vim curl git wget
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following package was automatically installed and is no longer required:
linux-modules-5.4.0-1002-oem
Use ‘sudo apt autoremove’ to remove it.
The following additional packages will be installed:
git-man libcurl4 liberror-perl vim-common vim-runtime vim-tiny
Suggested packages:
git-daemon-run | git-daemon-sysvinit git-doc git-el git-email git-gui gitk
gitweb git-cvs git-mediawiki git-svn ctags vim-doc vim-scripts indent
The following NEW packages will be installed:
curl git git-man libcurl4 liberror-perl vim vim-runtime
The following packages will be upgraded:
vim-common vim-tiny wget
3 upgraded, 7 newly installed, 0 to remove and 689 not upgraded.
Need to get 14.1 MB of archives.
After this operation, 74.5 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim-tiny amd64 2:8.1.2269-1ubuntu5.22 [582 kB]
Get:2 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim-common all 2:8.1.2269-1ubuntu5.22 [88.2 kB]
Get:3 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 wget amd64 1.20.3-1ubuntu2 [348 kB]
Get:4 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 libcurl4 amd64 7.68.0-1ubuntu2.22 [235 kB]
Get:5 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 curl amd64 7.68.0-1ubuntu2.22 [161 kB]
Get:6 http://us.archive.ubuntu.com/ubuntu focal/main amd64 liberror-perl all 0.17029-1 [26.5 kB]
Get:7 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 git-man all 1:2.25.1-1ubuntu3.11 [887 kB]
Get:8 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 git amd64 1:2.25.1-1ubuntu3.11 [4,605 kB]
Get:9 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim-runtime all 2:8.1.2269-1ubuntu5.22 [5,877 kB]
Get:10 http://us.archive.ubuntu.com/ubuntu focal-updates/main amd64 vim amd64 2:8.1.2269-1ubuntu5.22 [1,243 kB]
Fetched 14.1 MB in 5s (2,652 kB/s)
(Reading database … 166127 files and directories currently installed.)
Preparing to unpack …/0-vim-tiny_2%3a8.1.2269-1ubuntu5.22_amd64.deb …
Unpacking vim-tiny (2:8.1.2269-1ubuntu5.22) over (2:8.1.2269-1ubuntu4) …
Preparing to unpack …/1-vim-common_2%3a8.1.2269-1ubuntu5.22_all.deb …
Unpacking vim-common (2:8.1.2269-1ubuntu5.22) over (2:8.1.2269-1ubuntu4) …
Preparing to unpack …/2-wget_1.20.3-1ubuntu2_amd64.deb …
Unpacking wget (1.20.3-1ubuntu2) over (1.20.3-1ubuntu1) …
Selecting previously unselected package libcurl4:amd64.
Preparing to unpack …/3-libcurl4_7.68.0-1ubuntu2.22_amd64.deb …
Unpacking libcurl4:amd64 (7.68.0-1ubuntu2.22) …
Selecting previously unselected package curl.
Preparing to unpack …/4-curl_7.68.0-1ubuntu2.22_amd64.deb …
Unpacking curl (7.68.0-1ubuntu2.22) …
Selecting previously unselected package liberror-perl.
Preparing to unpack …/5-liberror-perl_0.17029-1_all.deb …
Unpacking liberror-perl (0.17029-1) …
Selecting previously unselected package git-man.
Preparing to unpack …/6-git-man_1%3a2.25.1-1ubuntu3.11_all.deb …
Unpacking git-man (1:2.25.1-1ubuntu3.11) …
Selecting previously unselected package git.
Preparing to unpack …/7-git_1%3a2.25.1-1ubuntu3.11_amd64.deb …
Unpacking git (1:2.25.1-1ubuntu3.11) …
Selecting previously unselected package vim-runtime.
Preparing to unpack …/8-vim-runtime_2%3a8.1.2269-1ubuntu5.22_all.deb …
Adding ‘diversion of /usr/share/vim/vim81/doc/help.txt to /usr/share/vim/vim81/doc/help.txt.vim-tiny by vim-runtime’
Adding ‘diversion of /usr/share/vim/vim81/doc/tags to /usr/share/vim/vim81/doc/tags.vim-tiny by vim-runtime’
Unpacking vim-runtime (2:8.1.2269-1ubuntu5.22) …
Selecting previously unselected package vim.
Preparing to unpack …/9-vim_2%3a8.1.2269-1ubuntu5.22_amd64.deb …
Unpacking vim (2:8.1.2269-1ubuntu5.22) …
Setting up wget (1.20.3-1ubuntu2) …
Setting up liberror-perl (0.17029-1) …
Setting up vim-common (2:8.1.2269-1ubuntu5.22) …
Setting up libcurl4:amd64 (7.68.0-1ubuntu2.22) …
Setting up git-man (1:2.25.1-1ubuntu3.11) …
Setting up curl (7.68.0-1ubuntu2.22) …
Setting up vim-runtime (2:8.1.2269-1ubuntu5.22) …
Setting up vim (2:8.1.2269-1ubuntu5.22) …
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vim (vim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vimdiff (vimdiff) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rvim (rvim) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/rview (rview) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/vi (vi) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/view (view) in auto mode
update-alternatives: using /usr/bin/vim.basic to provide /usr/bin/ex (ex) in auto mode
Setting up vim-tiny (2:8.1.2269-1ubuntu5.22) …
Setting up git (1:2.25.1-1ubuntu3.11) …
Processing triggers for desktop-file-utils (0.24-1ubuntu2) …
Processing triggers for mime-support (3.64ubuntu1) …
Processing triggers for hicolor-icon-theme (0.17-2) …
Processing triggers for gnome-menus (3.36.0-1ubuntu1) …
Processing triggers for libc-bin (2.31-0ubuntu6) …
Processing triggers for man-db (2.9.1-1) …
Processing triggers for install-info (6.7.0.dfsg.2-5) …
test@ubuntu:~$ deb https://mirrors.bfsu.edu.cn/ubuntu/ focal main restricted universe multiverse
rse

deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

Ԥ Դ

deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

# deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse

Command ‘deb’ not found, did you mean:

command ‘den’ from snap den (1.2.0-0)
command ‘dub’ from snap dub (1.19.0)
command ‘debi’ from deb devscripts (2.20.2ubuntu2)
command ‘dub’ from deb dub (1.19.0-1build2.1)
command ‘edb’ from deb edb-debugger (1.0.0-1build3)
command ‘debc’ from deb devscripts (2.20.2ubuntu2)
command ‘dex’ from deb dex (0.8.0-2)
command ‘dab’ from deb bsdgames (2.17-28build1)
command ‘derb’ from deb icu-devtools (66.1-2ubuntu2.1)
command ‘deb3’ from deb quilt (0.65-3)
command ‘dep’ from deb go-dep (0.5.4-3ubuntu0.1)

See ‘snap info ’ for additional versions.

test@ubuntu:~$ # deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal main restricted universe multiverse
test@ubuntu:~$ deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse

Command ‘deb’ not found, did you mean:

command ‘dub’ from snap dub (1.19.0)
command ‘den’ from snap den (1.2.0-0)
command ‘dex’ from deb dex (0.8.0-2)
command ‘debi’ from deb devscripts (2.20.2ubuntu2)
command ‘edb’ from deb edb-debugger (1.0.0-1build3)
command ‘derb’ from deb icu-devtools (66.1-2ubuntu2.1)
command ‘deb3’ from deb quilt (0.65-3)
command ‘dub’ from deb dub (1.19.0-1build2.1)
command ‘dab’ from deb bsdgames (2.17-28build1)
command ‘debc’ from deb devscripts (2.20.2ubuntu2)
command ‘dep’ from deb go-dep (0.5.4-3ubuntu0.1)

See ‘snap info ’ for additional versions.

test@ubuntu:~$ # deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-updates main restricted universe multiverse
test@ubuntu:~$ deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse

Command ‘deb’ not found, did you mean:

command ‘dub’ from snap dub (1.19.0)
command ‘den’ from snap den (1.2.0-0)
command ‘dub’ from deb dub (1.19.0-1build2.1)
command ‘derb’ from deb icu-devtools (66.1-2ubuntu2.1)
command ‘dep’ from deb go-dep (0.5.4-3ubuntu0.1)
command ‘deb3’ from deb quilt (0.65-3)
command ‘dab’ from deb bsdgames (2.17-28build1)
command ‘dex’ from deb dex (0.8.0-2)
command ‘edb’ from deb edb-debugger (1.0.0-1build3)
command ‘debc’ from deb devscripts (2.20.2ubuntu2)
command ‘debi’ from deb devscripts (2.20.2ubuntu2)

See ‘snap info ’ for additional versions.

test@ubuntu:~$ # deb-src https://mirrors.bfsu.edu.cn/ubuntu/ focal-backports main restricted universe multiverse
test@ubuntu:~$
test@ubuntu:~$ deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse

Command ‘deb’ not found, did you mean:

command ‘den’ from snap den (1.2.0-0)
command ‘dub’ from snap dub (1.19.0)
command ‘dep’ from deb go-dep (0.5.4-3ubuntu0.1)
command ‘dab’ from deb bsdgames (2.17-28build1)
command ‘debc’ from deb devscripts (2.20.2ubuntu2)
command ‘derb’ from deb icu-devtools (66.1-2ubuntu2.1)
command ‘debi’ from deb devscripts (2.20.2ubuntu2)
command ‘dex’ from deb dex (0.8.0-2)
command ‘dub’ from deb dub (1.19.0-1build2.1)
command ‘edb’ from deb edb-debugger (1.0.0-1build3)
command ‘deb3’ from deb quilt (0.65-3)

See ‘snap info ’ for additional versions.

test@ubuntu:~$ # deb-src http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
test@ubuntu:~$
test@ubuntu:~$ # Ԥ Դ
test@ubuntu:~$ # deb https://mirrors.bfsu.edu.cn/ubuntu/ focal-proposed main restricted universe multiverse
test@ubuntu:~$ curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun

Executing docker install script, commit: e5543d473431b782227f8908005543bb4389b8de

  • sudo -E sh -c ‘apt-get update -qq >/dev/null’
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
  • sudo -E sh -c ‘DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null’
  • sudo -E sh -c ‘install -m 0755 -d /etc/apt/keyrings’
  • sudo -E sh -c ‘curl -fsSL “https://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg” | gpg --dearmor --yes -o /etc/apt/keyrings/docker.gpg’
    gpg: WARNING: unsafe ownership on homedir ‘/home/test/.gnupg’
  • sudo -E sh -c ‘chmod a+r /etc/apt/keyrings/docker.gpg’
  • sudo -E sh -c ‘echo “deb [arch=amd64 signed-by=/etc/apt/keyrings/docker.gpg] https://mirrors.aliyun.com/docker-ce/linux/ubuntu focal stable” > /etc/apt/sources.list.d/docker.list’
  • sudo -E sh -c ‘apt-get update -qq >/dev/null’
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (main/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (restricted/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Translations (restricted/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target CNF (restricted/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:46 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (universe/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Translations (universe/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target CNF (universe/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:48 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-i386/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Packages (multiverse/binary-all/Packages) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target Translations (multiverse/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-amd64) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
    W: Target CNF (multiverse/cnf/Commands-all) is configured multiple times in /etc/apt/sources.list:50 and /etc/apt/sources.list:64
  • sudo -E sh -c ‘DEBIAN_FRONTEND=noninteractive apt-get install -y -qq docker-ce docker-ce-cli containerd.io docker-compose-plugin docker-ce-rootless-extras docker-buildx-plugin >/dev/null’
  • sudo -E sh -c ‘docker version’
    Client: Docker Engine - Community
    Version: 26.0.0
    API version: 1.45
    Go version: go1.21.8
    Git commit: 2ae903e
    Built: Wed Mar 20 15:17:51 2024
    OS/Arch: linux/amd64
    Context: default

Server: Docker Engine - Community
Engine:
Version: 26.0.0
API version: 1.45 (minimum version 1.24)
Go version: go1.21.8
Git commit: 8b79278
Built: Wed Mar 20 15:17:51 2024
OS/Arch: linux/amd64
Experimental: false
containerd:
Version: 1.6.28
GitCommit: ae07eda36dd25f8a1b98dfbf587313b99c0190bb
runc:
Version: 1.1.12
GitCommit: v1.1.12-0-g51d5e94
docker-init:
Version: 0.19.0
GitCommit: de40ad0

================================================================================

To run Docker as a non-privileged user, consider setting up the
Docker daemon in rootless mode for your user:

dockerd-rootless-setuptool.sh install

Visit https://docs.docker.com/go/rootless/ to learn about rootless mode.

To run the Docker daemon as a fully privileged service, but granting non-root
users access, refer to https://docs.docker.com/go/daemon-access/

WARNING: Access to the remote API on a privileged Docker daemon is equivalent
to root access on the host. Refer to the ‘Docker daemon attack surface’
documentation for details: https://docs.docker.com/go/attack-surface/

================================================================================

test@ubuntu:~$ sudo usermod -aG docker U S E R t e s t @ u b u n t u :   USER test@ubuntu:~ USERtest@ubuntu:  newgrp docker
test@ubuntu:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
test@ubuntu:~$ sudo curl -L “https://github.com/docker/compose/releases/download/v2.2.2/docker-compose- ( u n a m e − s ) − (uname -s)- (unames)(uname -m)” -o /usr/local/bin/docker-compose
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:–:-- 0:00:01 --:–:-- 0
100 23.5M 100 23.5M 0 0 761k 0 0:00:31 0:00:31 --:–:-- 470k
test@ubuntu:~$ sudo chmod +x /usr/local/bin/docker-compose
test@ubuntu:~$ docker-compose

Usage: docker compose [OPTIONS] COMMAND

Docker Compose

Options:
–ansi string Control when to print ANSI control characters (“never”|“always”|“auto”)
(default “auto”)
–compatibility Run compose in backward compatibility mode
–env-file string Specify an alternate environment file.
-f, --file stringArray Compose configuration files
–profile stringArray Specify a profile to enable
–project-directory string Specify an alternate working directory
(default: the path of the Compose file)
-p, --project-name string Project name

Commands:
build Build or rebuild services
convert Converts the compose file to platform’s canonical format
cp Copy files/folders between a service container and the local filesystem
create Creates containers for a service.
down Stop and remove containers, networks
events Receive real time events from containers.
exec Execute a command in a running container.
images List images used by the created containers
kill Force stop service containers.
logs View output from containers
ls List running compose projects
pause Pause services
port Print the public port for a port binding.
ps List containers
pull Pull service images
push Push service images
restart Restart containers
rm Removes stopped service containers
run Run a one-off command on a service.
start Start services
stop Stop services
top Display the running processes
unpause Unpause services
up Create and start containers
version Show the Docker Compose version information

Run ‘docker compose COMMAND --help’ for more information on a command.
test@ubuntu:~$ sudo vim /etc/docker/daemon.json
test@ubuntu:~$ docker pull busybox
Using default tag: latest
latest: Pulling from library/busybox
7b2699543f22: Pull complete
Digest: sha256:c3839dd800b9eb7603340509769c43e146a74c63dca3045a8e7dc8ee07e53966
Status: Downloaded newer image for busybox:latest
docker.io/library/busybox:latest
test@ubuntu:~$ sudo systemctl restart docker
test@ubuntu:~$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
test@ubuntu:~$

  • 16
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值