apt-get 更新期间本地 deb 文件存储库失败

apt-get 更新期间本地 deb 文件存储库失败

如同这个问题,我添加了一些 deb 文件并按照@Wowfunhappy 对这个问题的最新回答创建我自己的本地仓库。但是apt-get update我收到以下错误:

Could not open file /var/lib/apt/lists/partial/_usr_local_mydebs_._Packages - open (13: Permission denied)
Hit:7 http://security.ubuntu.com/ubuntu bionic-security InRelease              
Reading package lists... Done                      
N: Download is performed unsandboxed as root as file '/usr/local/mydebs/./InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
E: Failed to fetch store:/var/lib/apt/lists/partial/_usr_local_mydebs_._Packages  Could not open file /var/lib/apt/lists/partial/_usr_local_mydebs_._Packages - open (13: Permission denied)
E: Some index files failed to download. They have been ignored, or old ones used instead.

编辑: 我正在使用 docker 容器(Ubuntu 18.04)。

编辑2

我发现了一个这个问题的解决方法。但是我仍然收到此消息:

N: Download is performed unsandboxed as root as file '/usr/local/mydebs/./InRelease' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)

这是一个无害的错误,因为我可以继续安装软件包?我不清楚“N”是什么意思。

答案1

将该行添加到 apt-get update 即可修复该问题。

-o APT::Sandbox::User=root

完成apt-get update变为:

apt-get -o Acquire::GzipIndexes=false -o APT::Sandbox::User=root update

相关内容