1) ๊ธฐ๋ณธ ํจํค์ง ๋ค์ด๋ก๋ ๋ฐ ์ค์
apt-get install apt-mirror apache2
systemctl restart apache2
systemctl enable apache2
2) apt-mirror ์์คํ์ผ ๋ณ๊ฒฝ
sudo cp /usr/bin/apt-mirror /usr/bin/apt-mirror.original
sudo chown root:root /usr/bin/apt-mirror && sudo chmod 755 /usr/bin/apt-mirror
apt Package๋ก ์ค์นํ apt-mirror๋ ํ์ฌ cnf ํ์ผ์ ์ ๋๋ก ๋ชป ๊ฐ์ ธ์ค๋ ์ด์๊ฐ ์์ด ์๋์ zipํ์ผ์ ๋ค์ด๋ก๋ ๋ฐ์ ํ์ apt-mirror ํ์ผ๋ง ์๋ฒ๋ก ์ ์กํ์ฌ ์์ ์ปค๋งจ๋๋ฅผ ์คํํ๋ฉด ๋๋ค.
3) apt-mirror Config ์ค์
cat > /etc/apt/mirror.list <<EOF
############# config ##################
#
# set base_path /var/spool/apt-mirror
#
# set mirror_path $base_path/mirror
# set skel_path $base_path/skel
# set var_path $base_path/var
# set cleanscript $var_path/clean.sh
# set defaultarch <running host architecture>
# set postmirror_script $var_path/postmirror.sh
# set run_postmirror 0
set nthreads 20
set _tilde 0
#
############# end config ##############
deb http://kr.archive.ubuntu.com/ubuntu focal main restricted
deb http://kr.archive.ubuntu.com/ubuntu focal-updates main restricted
deb http://kr.archive.ubuntu.com/ubuntu focal universe
deb http://kr.archive.ubuntu.com/ubuntu focal-updates universe
deb http://kr.archive.ubuntu.com/ubuntu focal multiverse
deb http://kr.archive.ubuntu.com/ubuntu focal-updates multiverse
deb http://kr.archive.ubuntu.com/ubuntu focal-backports main restricted universe multiverse
deb http://kr.archive.ubuntu.com/ubuntu focal-security main restricted
deb http://kr.archive.ubuntu.com/ubuntu focal-security universe
deb http://kr.archive.ubuntu.com/ubuntu focal-security multiverse
EOF
4) apt-mirror ์คํ
apt-mirror
5) ์ฌ๋ณผ๋ฆญ ๋งํฌ ์ค์ ๋ฐ ์๋น์ค ์ฌ์์
ln -s /var/spool/apt-mirror/mirror/kr.archive.ubuntu.com/ubuntu/ /var/www/html/ubuntu
service apache2 restart
6) Client ์ค์
cat > /etc/apt/sources.list <<EOF
deb http://192.168.100.101/ubuntu focal main restricted
deb http://192.168.100.101/ubuntu focal-updates main restricted
deb http://192.168.100.101/ubuntu focal universe
deb http://192.168.100.101/ubuntu focal-updates universe
deb http://192.168.100.101/ubuntu focal multiverse
deb http://192.168.100.101/ubuntu focal-updates multiverse
deb http://192.168.100.101/ubuntu focal-backports main restricted universe multiverse
deb http://192.168.100.101/ubuntu focal-security main restricted
deb http://192.168.100.101/ubuntu focal-security universe
deb http://192.168.100.101/ubuntu focal-security multiverse
deb http://192.168.100.101/docker focal stable
EOF
192.168.100.101 ๋์ ์ ์์ ์ ์๋ฒ IP๋ก ๋ฐ๊ฟ ์ค์ ํ๋ค.
7) ํ ์คํธ
apt-get update
๋ฐ์ํ
'๐ ๏ธ Devops > Linux' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[RHEL] Failed to set locale defaulting to c.utf-8 ์ค๋ฅ ํด๊ฒฐ (2) | 2024.06.04 |
---|---|
[Linux] ๋คํธ์ํฌ ๋๋ฐ์ด์ค๋ช ๋ณ๊ฒฝ (eth0) (0) | 2023.08.18 |
[CentOS 8, RHEL 8, Rocky 8] rc.local ์๋น์ค ํ์ฑํ (0) | 2023.05.10 |
[CentOS 7.9] PXE Server with KickStart ๊ตฌ์ถ (0) | 2022.07.22 |
[Ubuntu 20.04] Bonding ์ค์ (2) | 2022.05.04 |