Я пытаюсь создать локальный репозиторий Ubuntu в контейнере Docker на основе Ubuntu 16.04 xenial. Я следовал этому уроку:
https://help.ubuntu.com/community/Repositories/Personal
Вот шаги, выполняемые от имени пользователя root:
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/
Когда я запускаю apt-get update, у меня возникает следующая проблема:
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)
попытался исправить проблему, просто разархивировав /root/repo/amd_64/Packages.gz в / root / repo / amd_64 / Packages, проблема с файлом не найдена, но возникла другая ошибка:
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.
Я заметил, что все учебные материалы по этой теме в Интернете похожи на те, которые я связал, поэтому я полагаю, что это правильно, но, возможно, что-то нужно изменить, когда мы применим процедуру к контейнеру Docker.
Кто-нибудь может помочь?