출처: https://idchowto.com/local-repo/
local-repo 만들기(ubuntu)
local-repo 만들기
local-repo 구성작업 전, repo로 받을 공간을 위한 추가디스크를 마운트 시켜서 구성하는것을 추천함
(아래의 작업에서는 /apt-mirror 에서 작업)
* local-repo를 구성하는 주된 이유는 외부와 통신이 되지 않는/않아야 하는 환경등 보안으로 인해 loca-repo를 구성합니다.
# 패키지 설치
apt install apt-mirror
git clone https://github.com/Stifler6996/apt-mirror
: repo가 변경되면 생기는 에러가 나지 않도록 git에 있는 apt-mirror를 가져온다.
(공식지원 마지막 커밋시점이 몇년전이기 때문에 git에 올라와있는 apt-mirror를 가져온다.)
mv /usr/bin/apt-mirror /usr/bin/apt-mirror.backup
: 원본 백업
cp apt-mirror/apt-mirror /usr/bin/apt-mirror
chmod 755 /usr/bin/apt-mirror
chown root:root /usr/bin/apt-mirror
: apt-mirror설치
apt install apache2
: apache2 패키지 설치
# mirror.list수정
############# config ################## # # set base_path /var/spool/apt-mirror set base_path /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 ############## # bionic 18.04 deb http://kr.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse deb http://kr.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://kr.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse # focal 20.04 deb http://vcore.clouds.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse deb http://vcore.clouds.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse deb http://vcore.clouds.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb http://security.ubuntu.com/ubuntu focal-security main restricted universe multiverse # jammy 22.04 deb http://mirror.kakao.com/ubuntu/ jammy main restricted universe multiverse deb http://mirror.kakao.com/ubuntu/ jammy-updates main restricted universe multiverse deb http://mirror.kakao.com/ubuntu/ jammy-backports main restricted universe multiverse deb http://mirror.kakao.com/ubuntu jammy-security main restricted universe multiverse clean http://archive.ubuntu.com/ubuntu |
# apt-mirror 실행
apt-mirror
# apache 설정 수정
mkdir /var/www/repo
chown www-data:www-data /var/www/repo/mirror
ln -s /apt-mirror/mirror /var/www/repo
/etc/apache2/site-enable/000-default.comf *documentroot /var/www/repo
service apache2 restart
# repo-client 설정
/etc/apt/sources.list
: repo를 위에서 설정한 local-repo 로 설정
# 18.04 deb http://[local-repo-IP]/mirror/kr.archive.ubuntu.com/ubuntu/ bionic main restricted universe multiverse deb http://[local-repo-IP]/mirror/kr.archive.ubuntu.com/ubuntu/ bionic-updates main restricted universe multiverse deb http://[local-repo-IP]/mirror/kr.archive.ubuntu.com/ubuntu/ bionic-backports main restricted universe multiverse deb http://[local-repo-IP]/mirror/security.ubuntu.com/ubuntu bionic-security main restricted universe multiverse # 20.04 deb http://[local-repo-IP]/mirror/vcore.clouds.archive.ubuntu.com/ubuntu/ focal main restricted universe multiverse deb http://[local-repo-IP]/mirror/vcore.clouds.archive.ubuntu.com/ubuntu/ focal-updates main restricted universe multiverse deb http://[local-repo-IP]/mirror/vcore.clouds.archive.ubuntu.com/ubuntu/ focal-backports main restricted universe multiverse deb http://[local-repo-IP]/mirror/security.ubuntu.com/ubuntu focal-security main restricted universe multiverse # 22.04 deb http://[local-repo-IP]/mirror/mirror.kakao.com/ubuntu/ jammy main restricted universe multiverse deb http://[local-repo-IP]/mirror/mirror.kakao.com/ubuntu/ jammy-updates main restricted universe multiverse deb http://[local-repo-IP]/mirror/mirror.kakao.com/ubuntu/ jammy-backports main restricted universe multiverse deb http://[local-repo-IP]/mirror/mirror.kakao.com/ubuntu jammy-security main restricted universe multiverse |
'컴퓨터 활용(한글, 오피스 등) > 50_2.운영체제_리눅스' 카테고리의 다른 글
Using Emacs on Windows 11 with WSL2 (0) | 2023.11.12 |
---|---|
apt 저장소 변경하기 (0) | 2023.11.12 |
Linux 명령어 (0) | 2023.10.19 |
파티션 및 설치 종류 선택 & LVM (1) | 2023.10.15 |
Linux(리눅스) 파일 시스템의 종류와 특징 (1) | 2023.10.15 |