如何使用 puppet 从私有仓库下载软件包?

如何使用 puppet 从私有仓库下载软件包?

我已经建立了自己的 apt 存储库来.deb通过 LAN 提供一些软件包,并且已经设置了我的 puppet 配置来安装这些软件包。

如果我使用apt-get install它下载包,它可以正常工作,但是当我运行我的 puppet 清单时,它会在尝试安装时引发此错误:

Error: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install cuda-repo-l4t-r19.2' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  cuda-repo-l4t-r19.2
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 0 B/424 MB of archives.
After this operation, 426 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  cuda-repo-l4t-r19.2
E: There are problems and -y was used without --force-yes

Error: /Stage[main]/Main/Package[cuda-repo-l4t-r19.2]/ensure: change from absent to present failed: Execution of '/usr/bin/apt-get -q -y -o DPkg::Options::=--force-confold install cuda-repo-l4t-r19.2' returned 100: Reading package lists...
Building dependency tree...
Reading state information...
The following NEW packages will be installed:
  cuda-repo-l4t-r19.2
0 upgraded, 1 newly installed, 0 to remove and 7 not upgraded.
Need to get 0 B/424 MB of archives.
After this operation, 426 MB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  cuda-repo-l4t-r19.2
E: There are problems and -y was used without --force-yes

我不确定问题到底出在哪里;puppet?我的存储库?还是其他什么?

答案1

看起来是因为我的存储库未经过身份验证。我通过添加允许 apt 从未经身份验证的存储库下载来解决这个问题,并通过使用 puppet 创建以下文件来实现这一点:

  file { "/etc/apt/apt.conf.d/99auth":       
    owner     => root,
    group     => root,
    content   => "APT::Get::AllowUnauthenticated yes;",
    mode      => 644;
  }

相关内容