树莓派4安装docker 失败

红煌流星 30cm2020-04-224744 次点击
根据 docker 官网推荐的脚本安装 https://docs.docker.com/engine/install/debian/#install-using-the-convenience-script
出现了如下的错误
```
sudo sh get-docker.sh
# Executing docker install script, commit: 442e66405c304fa92af8aadaa1d9b31bf4b0ad94
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
E: Essential packages were removed and -y was used without --allow-remove-essential.
使用阿里云的源也是
sudo sh get-docker.sh --mirror Aliyun
# Executing docker install script, commit: 442e66405c304fa92af8aadaa1d9b31bf4b0ad94
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
E: Essential packages were removed and -y was used without --allow-remove-essential.
```
收藏 ♥ 感谢
Spoony 小组长 2020-04-22 
Essential packages were removed and -y was used without --allow-remove-essential.

把脚本里面 sudo apt-get install -y xxx 改成 sudo apt-get install xxx
wherefrom 13.7m 2020-04-22  ♥ 1
Essential packages were removed 意思是你的脚本里面有一个包在源中被移除了,找不到。你可以按楼上说的找到对应的包,自己手动安装。或者不用脚本,自己一个个下下来也可以:https://shumeipai.nxez.com/2019/05/20/how-to-install-docker-on-your-raspberry-pi.html
红煌流星 30cm 2020-04-22 
这是 sh 的源代码
# Run setup for each distro accordingly
case "$lsb_dist" in
ubuntu|debian|raspbian)
pre_reqs="apt-transport-https ca-certificates curl"
if [ "$lsb_dist" = "debian" ]; then
# libseccomp2 does not exist for debian jessie main repos for aarch64
if [ "$(uname -m)" = "aarch64" ] && [ "$dist_version" = "jessie" ]; then
add_debian_backport_repo "$dist_version"
fi
fi

if ! command -v gpg > /dev/null; then
pre_reqs="$pre_reqs gnupg"
fi
apt_repo="deb [arch=$(dpkg --print-architecture)] $DOWNLOAD_URL/linux/$lsb_dist $dist_version $CHANNEL"
(
if ! is_dry_run; then
set -x
fi
$sh_c 'apt-get update -qq >/dev/null'
$sh_c "DEBIAN_FRONTEND=noninteractive apt-get -y install -qq $pre_reqs >/dev/null"
$sh_c "curl -fsSL \"$DOWNLOAD_URL/linux/$lsb_dist/gpg\" | apt-key add -qq - >/dev/null"
$sh_c "echo \"$apt_repo\" > /etc/apt/sources.list.d/docker.list"
$sh_c 'apt-get update -qq >/dev/null'
)
pkg_version=""
---------------
独立运行这两句都报同样的错:
chinhung@raspberrypi:~ $ sudo apt-get -y install -qq apt-transport-https ca-certificates curl
E: Essential packages were removed and -y was used without --allow-remove-essential.
chinhung@raspberrypi:~ $ sudo apt-get install -qq apt-transport-https ca-certificates curl
E: Essential packages were removed and -y was used without --allow-remove-essential.
红煌流星 30cm 2020-04-22 
curl ca-certificates 这两个包都没问题,apt-transport-https有问题
chinhung@raspberrypi:~ $ sudo apt-get install apt-transport-https
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
python-apt-common python3-apt python3-debconf
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
libapt-pkg4.12
The following packages will be REMOVED:
apt apt-listchanges apt-utils tasksel tasksel-data
The following NEW packages will be installed:
apt-transport-https libapt-pkg4.12
WARNING: The following essential packages will be removed.
This should NOT be done unless you know exactly what you are doing!
apt
0 upgraded, 2 newly installed, 5 to remove and 0 not upgraded.
Need to get 847 kB of archives.
After this operation, 3,112 kB disk space will be freed.
You are about to do something potentially harmful.
To continue type in the phrase 'Yes, do as I say!'
?]
mrliu 85cm 2020-04-27  ♥ 1
我的也是4b 用sudo curl -sSL https://get.docker.com | sh 这个脚本安装除了慢点还是挺稳的

登录注册 后可回复。




› 相关内容关注微信公众号