-
ubuntu mirror server 구축Linux 2020. 9. 16. 12:07
How to create a Ubuntu repository server
* 전체 순서
1. apt-mirror 패키지 설치
2. 설정 파일 편집
3. apt-mirror 실행
4. apache 설정
5. Client 설정
1. apt-mirror 패키지 설치
# apt-get update # apt-get install apt-mirror
2. 설정 파일 편집
vi /etc/apt/mirror.list set base_path /apt-mirror set nthreads 20 set _tilde 0 #### 16.04LTS XENIAL #### deb-amd64 http://archive.ubuntu.com/ubuntu xenial main main/debian-installer restricted restricted/debian-installer universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu xenial main main/debian-installer restricted restricted/debian-installer universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu xenial-security main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu xenial-updates main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu xenial-proposed main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu xenial-backports main restricted universe multiverse #### 18.04LTS BIONIC #### deb-amd64 http://archive.ubuntu.com/ubuntu bionic main main/debian-installer restricted restricted/debian-installer universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu bionic-proposed main restricted universe multiverse deb-amd64 http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu bionic main main/debian-installer restricted restricted/debian-installer universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu bionic-security main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu bionic-updates main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu bionic-proposed main restricted universe multiverse deb-i386 http://archive.ubuntu.com/ubuntu bionic-backports main restricted universe multiverse #### 20.04LTS FOCAL #### deb http://archive.ubuntu.com/ubuntu Focal main main/debian-installer restricted restricted/debian-installer universe multiverse deb http://archive.ubuntu.com/ubuntu Focal-security main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu Focal-updates main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu Focal-proposed main restricted universe multiverse deb http://archive.ubuntu.com/ubuntu Focal-backports main restricted universe multiverse clean http://archive.ubuntu.com/ubuntu
<키워드 정리>
set base_path: 저장되는 디렉토리
deb-amd64: 64비트 패키지 다운로드
deb-i386: 32비트 패키지 다운로드
deb: 현재OS비트와 동일한 패키지만 다운로드
3. apt-mirror 실행
apt-mirror 명령어를 통해 패키지 다운로드 한다.
root@ubuntu-repo:/etc/apt# apt-mirror Downloading 48 index files using 20 threads... Begin time: Wed Dec 16 11:46:13 2020 [20]... [19]... [18]... [17]... [16]... [15]... [14]... [13]... [12]... [11]... [10]... [9]... [8]... [7]... [6]... [5]... [4]... [3]... [2]... [1]... [0]... End time: Wed Dec 18 23:55:48 2013 Proceed indexes: [PPP] 350.4 GiB will be downloaded into archive. Downloading 45006 archive files using 20 threads... Begin time: Wed Dec 16 11:46:13 2020 [20]...
4. apache 설정
아파치를 설치해준다.
apt-get -y install apache2
symbolic link를 생성한다.
ln -s /apt_mirror/mirror/archive.ubuntu.com/ubuntu /var/www/ubuntu
아파치 서버 시작
service apache2 restart
5. Client 설정
# vi /etc/apt/sources.list deb http://[방금만든 ubuntu-repo서버ip]/ubuntu Bionic main restricted universe multiverse deb http://[방금만든 ubuntu-repo서버ip]/ubuntu Bionic-updates main restricted universe multiverse deb http://[방금만든 ubuntu-repo서버ip]/ubuntu Bionic-security main restricted universe multiverse
이후 apt-get update를 진행한다.
'Linux' 카테고리의 다른 글
배포서버 구축 (2) (0) 2020.09.05 배포서버 구축 (1) (0) 2020.09.05 기존 디스크 확장하여 LVM 구성 (2) (0) 2020.09.05 디스크 추가하여 LVM 구성 (1) (0) 2020.09.05 SVN, HTTP, LDAP 모두 연동 (0) 2020.04.16