当前位置: 首页 > 知识库问答 >
问题:

在Docker上创建本地Ubuntu存储库

裴育
2023-03-14
1. mkdir -p /root/repo/amd_64
2. copied all debian packages in /root/repo/amd_64
3. create the script /usr/bin/update-mydebs.sh with the following content:
#! /bin/bash
cd /root/repo/amd_64
dpkg-scanpackages . /dev/null | gzip -9c > Packages.gz
4. Run the script update-mydebs.sh (I verified the Packages.gz is 
correctly created under /root/repo/amd_64)
5. Added the line in /etc/apt/source.list
deb file:/root/repo amd_64/
Get:1 file:/root/repo amd_64/ InRelease
Ign:1 file:/root/repo amd_64/ InRelease
Get:2 file:/root/repo amd_64/ Release
Ign:2 file:/root/repo amd_64/ Release
Get:3 file:/root/repo amd_64/ Packages [54.3 kB]
Ign:3 file:/root/repo amd_64/ Packages
Get:3 file:/root/repo amd_64/ Packages
Ign:3 file:/root/repo amd_64/ Packages
Get:3 file:/root/repo amd_64/ Packages
Ign:3 file:/root/repo amd_64/ Packages
Get:3 file:/root/repo amd_64/ Packages
Ign:3 file:/root/repo amd_64/ Packages
Get:3 file:/root/repo amd_64/ Packages
Ign:3 file:/root/repo amd_64/ Packages
Get:3 file:/root/repo amd_64/ Packages
Err:3 file:/root/repo amd_64/ Packages
File not found - /root/repo/amd_64/Packages (2: No such file or 
directory)
Reading package lists... Done
N: Can't drop privileges for downloading as file 
'/root/repo/amd_64/InRelease' couldn't be accessed by user '_apt'. - 
pkgAcquire::Run (13: Permission denied)
W: The repository 'file:/root/repo amd_64/ 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 file:/root/repo/amd_64/Packages  File not found - 
/root/repo/amd_64/Packages (2: No such file or directory)
Get:3 file:/root/repo amd_64/ Packages [169 kB]
Err:3 file:/root/repo amd_64/ Packages
    Could not open file 
    /var/lib/apt/lists/partial/_root_repo_amd%5f64_Packages - open 
    (13: Permission denied)
Reading package lists... Done
N: Can't drop privileges for downloading as file 
'/root/repo/amd_64/InRelease' couldn't be accessed by user '_apt'. - 
pkgAcquire::Run (13: Permission denied)
W: The repository 'file:/root/repo amd_64/ 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 c 
configuration details.
E: Failed to fetch 
store:/var/lib/apt/lists/partial/_root_repo_amd%5f64_Packages  Could 
not open file /var/lib/apt/lists/partial/_root_repo_amd%5f64_Packages 
- open (13: Permission denied)
E: Some index files failed to download. They have been ignored, or old 
ones used instead.

共有1个答案

吕胤
2023-03-14

我也有这个问题。我花了很多时间搜索:https://github.com/radeno/polyfill-service-docker/blob/master/dockerfile

附注:

# work around the following APT issue by using "Acquire::GzipIndexes=false" (overriding "/etc/apt/apt.conf.d/docker-gzip-indexes")
#   Could not open file /var/lib/apt/lists/partial/_tmp_tmp.ODWljpQfkE_._Packages - open (13: Permission denied)
#   ...
#   E: Failed to fetch store:/var/lib/apt/lists/partial/_tmp_tmp.ODWljpQfkE_._Packages  Could not open file /var/lib/apt/lists/partial/_tmp_tmp.ODWljpQfkE_._Packages - open (13: Permission denied)

在作为update命令的一部分添加之后,这与本地存储库的预期效果一致。

 类似资料:
  • 问题内容: 我想创建本地Maven存储库。我做了以下步骤: 在中安装了Maven插件 在apache服务器中创建了一个文件夹localrepository,可使用访问 在我的项目中,我提供了 但这并没有解决上的jar 是否需要提供存储库? 问题答案: 使用具有默认配置的Web服务器来设置简单的存储库。关键是目录结构。该文档没有明确提及它,但其结构与本地存储库相同。 要建立一个内部存储库,只需要您有

  • 键入状态报告 消息 说明禁止访问指定的资源。

  • 在Teradata16上创建存储过程时sql出错,请问这个查询有什么问题? 替换过程tutorial_db.banks(out test Varchar(20))BEGIN select name from tutorial_db.banks end;

  • localStorage 本地存储 存储针对QQ帐号隔离 数据存储于本地文件中。游戏结束后不会被删除 函数 key( index) 获取对应索引的key 手q 版本7.8.5 参数 参数名 类型 说明 index number 索引值 返回值 类型 说明 string 说明 示例 var stringKey = BK.localStorage.key(0); getItem( key) 获取ke

  • 我在GitHub上看到过一些这样的问题和问题,但无法让它工作。我的设置是这样的:我在Ubuntu 16.04.3上本地有代码 docker-compose文件的内容如下: 并且无论我在应用程序运行时在目录中更改了什么,Gunicorn永远不会重新加载。 我正在使用python:3.6-alpine来构建我的图像。

  • 我的docker文件包含以下内容 用于构建映像的命令是:。 运行容器的命令用户为: 请帮帮忙。