创建本地 apt 存储库以在 ubuntu 上安装 docker 时出现问题 [英] Issue while Creating a local apt repo for installing docker on ubuntu

查看:19
本文介绍了创建本地 apt 存储库以在 ubuntu 上安装 docker 时出现问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个要求,我必须制作一个本地存储库来安装包 docker.io、jq 和 nmap 而不是来自 ubuntu 系统上的公共存储库(Linux ip-172-31-29-180 4.15.0-1065-aws #69-Ubuntu SMP Thu Mar 26 02:17:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux).我已按照以下步骤操作

I have a requirement where i have to make a local repo for installing packages docker.io,jq and nmap instead of from public repo on ubuntu system(Linux ip-172-31-29-180 4.15.0-1065-aws #69-Ubuntu SMP Thu Mar 26 02:17:29 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux). I have followed following steps

1) 安装 apache 并在/var/www/html 中创建目录 debs 和 debs/amd64,配置本地 repo

1) installed apache and created directory debs and debs/amd64 in /var/www/html , configuring local repo

2) 从 https://下载的 deb 文件download.docker.com/linux/debian/dists/buster/pool/stable/amd64 因为我的 debian 版本是 buster(文件是 containerd.io_1.2.6-3_amd64.deb docker-ce-cli_19.03.8~3-0~debian-buster_amd64.deb docker.io_18.09.1+dfsg1-7.1+deb10u1_amd64.deb)

2) downloaded deb file from https://download.docker.com/linux/debian/dists/buster/pool/stable/amd64 as my debian verions is buster (files are containerd.io_1.2.6-3_amd64.deb docker-ce-cli_19.03.8~3-0~debian-buster_amd64.deb docker.io_18.09.1+dfsg1-7.1+deb10u1_amd64.deb)

3) 使本地存储库知道下载的包

3) making downloaded package known to local repo

  apt-install dpkg-dev -y
   cd /var/www/html/debs
   dpkg-scanpackages amd64 | gzip -9c > amd64/Packages.gz

4) 配置apt从本地主机下载

4) configuring apt to download from localhost repo

echo "deb http://localhost/debs/ amd64/" > /etc/apt/sources.list

5) apt install docker.io 报错

5) apt install docker.io gives error

E: Package 'docker.io' has no installation candidate

虽然当我做一个恰当的列表时|grep docker.io 它给出了下面的 o/p

although when i do a apt list| grep docker.io it gives below o/p

docker.io/now 19.03.6-0ubuntu1~18.04.1 amd64 [residual-config]

知道我做错了什么,所以我无法使用 deb 文件从本地存储库安装 docker.io

Any idea what i am doing wrong so i cannot install docker.io from local repo using deb files

推荐答案

在 sources.list 文件中添加 [trusted=yes] 后我能够解决这个问题 echo "deb [trusted=yes] localhost/debs amd64/" >/etc/apt/sources.list

I was able to solve the issue after adding [trusted=yes] inside the sources.list file echo "deb [trusted=yes] localhost/debs amd64/" > /etc/apt/sources.list

这篇关于创建本地 apt 存储库以在 ubuntu 上安装 docker 时出现问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆