如何从本地 artifactory 服务器获取 Ubuntu 机器上的包

How to get packages on Ubuntu machine from local artifactory server

有什么问题

我已经设置了本地神器服务器来下载所有 debian/ubuntu 包。

这是我的远程仓库:

repo key : op.archive.ubuntu.com , URL : http://us.archive.ubuntu.com/ubuntu/
repo key : op.security.ubuntu.com, url : http://security.ubuntu.com/ubuntu

这映射到虚拟仓库:

https://<<url>>/artifactory/op-deb-debian-virtual

现在,在 ubuntu 机器中,这里是 /etc/apt/sources.list 文件的内容

deb https://<<url>>/artifactory/op-deb-debian-virtual/ stretch main contrib non-free
deb https://<<url>>/artifactory/op-deb-debian-virtual/ stretch-updates main contrib non-free

但是现在,当我执行 运行 apt-get update 命令时,它失败并出现以下错误。无法理解,是人工服务器的问题,sources.list 还是其他问题

什么错误

Err:5 https://<>/artifactory/op2-deb-debian-virtual stretch/main amd64 Packages 401 Unauthorized Ign:6 https://<>/artifactory/op2-deb-debian-virtual stretch/main i386 Packages Ign:7 https://<>/artifactory/op2-deb-debian-virtual stretch/main all Packages Ign:8 https://<>/artifactory/op2-deb-debian-virtual stretch/main Translation-en_US Ign:9 https://<>/artifactory/op2-deb-debian-virtual stretch/main Translation-en Ign:10 https://<>/artifactory/op2-deb-debian-virtual stretch/contrib amd64 Packages Ign:11 https://<>/artifactory/op2-deb-debian-virtual stretch/contrib i386 Packages Ign:12 https://<>/artifactory/op2-deb-debian-virtual stretch/contrib all Packages Ign:13 https://<>/artifactory/op2-deb-debian-virtual stretch/contrib Translation-en_US Ign:14 https://<>/artifactory/op2-deb-debian-virtual stretch/contrib Translation-en Ign:15 https://<>/artifactory/op2-deb-debian-virtual stretch/non-free amd64 Packages Err:20 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/main amd64 Packages 401 Unauthorized Ign:21 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/main i386 Packages Ign:22 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/main all Packages Ign:23 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/main Translation-en_US Ign:24 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/main Translation-en Ign:25 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/contrib amd64 Packages Ign:26 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/contrib i386 Packages Ign:27 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/contrib all Packages Ign:28 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/contrib Translation-en_US Ign:29 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/contrib Translation-en Ign:30 https://<>/artifactory/op2-deb-debian-virtual stretch-updates/non-free amd64 Packages Reading package lists... Done W: The repository 'https://<>/artifactory/op2-deb-debian-virtual stretch Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. W: The repository 'https://<>/artifactory/op2-deb-debian-virtual stretch-updates Release' does not have a Release file. N: Data from such a repository can't be authenticated and is therefore potentially dangerous to use. N: See apt-secure(8) manpage for repository creation and user configuration details. E: Failed to fetch https://<>/artifactory/op2-deb-debian-virtual/dists/stretch/main/binary-amd64/Packages 401 Unauthorized E: Failed to fetch https://<>/artifactory/op2-deb-debian-virtual/dists/stretch-updates/main/binary-amd64/Packages 401 Unauthorized E: Some index files failed to download. They have been ignored, or old ones used instead.

预期的结果

在 sources.list 中添加适当的工件 url 后,应该可以工作。那就是我所做的,仍然没有工作

请推荐

更新 1

之前的问题已解决。这是由于权限问题。我使用了用户名和密码(base 64 格式)并且有效。但现在问题是 403 forbidden

确切错误

E: Failed to fetch https://artifactory-na.honeywell.com/artifactory/op2-deb-debian-virtual/dists/xenial/main/binary-amd64/Packages  403  Forbidden
E: Failed to fetch https://artifactory-na.honeywell.com/artifactory/op2-deb-debian-virtual/dists/xenial-updates/main/binary-amd64/Packages  403  Forbidden
E: Failed to fetch https://artifactory-na.honeywell.com/artifactory/op2-deb-debian-virtual/dists/xenial-backports/main/binary-amd64/Packages  403  Forbidden
E: Failed to fetch https://artifactory-na.honeywell.com/artifactory/op2-deb-debian-virtual/dists/xenial-security/main/binary-amd64/Packages  403  Forbidden
E: Some index files failed to download. They have been ignored, or old ones used instead.

对我来说,

E: Some index files failed to download. They have been ignored, or old ones used instead

正在触发。 是不是有些镜子坏了??我怎样才能解决这个问题 ... ? 即使 mirror 挂了,我觉得 mirror 或 apt-get 应该注意这个问题??

请推荐

在这种情况下,出现 403 的最可能原因是 sources.list 中使用的用户对远程存储库(op.archive.ubuntu.com 和 op.security.ubuntu.com)

我收到 403 (Forbidden) 回复,因为我 运行 是 root。也许用户名被传递给了服务器,然后服务器要求输入密码,如果是root