인프라

Server_chroot환경_apt_get(온라인 패키지 매니저) 에러시 대응법

하루이2222 2024. 7. 8. 16:50

1. /etc/apt/sources.list 파일 설정

chroot 환경 내의 /etc/apt/sources.list 파일이 올바르게 설정되어 있는지 확인합니다. 이 파일은 패키지 저장소를 지정.

sudo nano /home/woody/etc/apt/sources.list

다음 예제와 같이 sources.list 파일을 설정.

deb http://archive.ubuntu.com/ubuntu jammy main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jammy-updates main restricted universe multiverse
deb http://archive.ubuntu.com/ubuntu jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu jammy-security main restricted universe multiverse

2. DNS 설정

chroot 환경 내에서 인터넷에 접근할 수 있도록 DNS 설정을 복사.

sudo cp /etc/resolv.conf /home/woody/etc/resolv.conf

3. chroot 환경 내에서 업데이트 시도

이제 chroot 환경으로 진입하여 apt-get update 명령어가 실행되는지 확인.

sudo schroot -c woody

chroot 환경 내에서:

apt-get update

5. 네트워크 설정 확인

만약 여전히 문제가 발생한다면, 다음 명령어를 통해 networking을 확인.

sudo cp /etc/hosts /home/woody/etc/hosts

6. apt 패키지 설치

최소한의 설치 환경에서는 apt 패키지가 설치되어 있지 않을 수 있음.

sudo apt-get install apt