apt-cacher-ng
저는 노트북에 설정했어요
cat /etc/apt/apt.conf.d/02proxy
Acquire::http { Proxy "http://localhost:3142"; };
패키지를 설치하고, 인터넷을 끄고, 패키지를 삭제하고 다시 설치할 수 있습니다.
find /var/cache/apt-cacher-ng -name "*komp*"
/var/cache/apt-cacher-ng/uburep/pool/universe/k/komparator
/var/cache/apt-cacher-ng/uburep/pool/universe/k/komparator/komparator_1.0-3_amd64.deb.head
/var/cache/apt-cacher-ng/uburep/pool/universe/k/komparator/komparator_1.0-3_amd64.deb
그러나 chroot에서는 인터넷이 다운되면 동일한 패키지를 설치할 수 없습니다.
다음과 같이 chroot를 만듭니다.
mkdir work
cd work
#This is a backup of a previous bootstrapped using --foreign
cp ../deboot.tgz .
sudo tar -xf deboot.tgz
sudo DEBOOTSTRAP_DIR=deboot/debootstrap/ debootstrap --second-stage --second-stage-target $(readlink -f deboot)
#Set locale settings in chroot
sudo chroot deboot locale-gen "en_US.UTF-8"
sudo chroot deboot dpkg-reconfigure --frontend=noninteractive locales
#Set apt cache proxy in chroot
echo 'Acquire::http { Proxy "http://127.0.0.1:3142"; };' | sudo tee deboot/etc/apt/apt.conf.d/00aptproxy
# mount the /proc filesystem in the chroot (required for managing processes)
sudo mount -o bind /proc deboot/proc
sudo chroot deboot
이제 chroot에서 다음을 수행합니다.
cat etc/apt/apt.conf.d/00aptproxy
Acquire::http { Proxy "http://127.0.0.1:3142"; };
root@myhostname:/# apt-get install komparator
Reading package lists... Done
Building dependency tree... Done
E: Unable to locate package komparator
chroot에서 이 작업을 수행 하면 apt-get update
다음을 얻습니다.
root@myhostname:/# apt-get update
Ign:1 http://archive.ubuntu.com/ubuntu zesty InRelease
Err:2 http://archive.ubuntu.com/ubuntu zesty Release
500 Connection failure: Network is unreachable
Reading package lists... Done
E: The repository 'http://archive.ubuntu.com/ubuntu zesty Release' does no longer have a Release file.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
apt-cacher-ng를 사용하여 호스트에 chroot 설치 패키지를 만드는 방법은 무엇입니까?