[Linux] E: Some index files failed to download. They have been ignored, or old ones used instead. 오류 해결

es.Seong·2025년 9월 18일
0

OS : Ubuntu 20.04

원래 잘돌아가던 컨테이너에서 갑자기 apt update나 apt-get update를 하면
Time out이 계속되면서 아래 오류를 출력하는 문제가 발생했다...

E: Some index files failed to download. They have been ignored, or old ones used instead.

기존에 잘 연결되던 저장소가 더이상 연결이 되지않거나, 교내 보안 조치 등으로 막힌듯하다...

우분투 20.04가 25년 5월에 보안지원종료된게 문제인것 같기도하다..

해결방법

sources.list 파일 수정

vi /etc/apt/sources.list

vi를 통해 확인해보니

# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ focal main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ focal-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ focal-updates main restricted

이런식으로
http://archive.ubuntu.com/ubuntu/ 여기서 패키지를 다운받는 것 같은데 이제 막힌듯하다.

해당 URL로 시작하는 모든 부분을 한국 저장소로 바꿔주면된다. 대표적으로 카이스트랑 다음카카오가 있었던 것 같은데 다음카카오 저장소로 바꿔보았다.

백업 파일 만들기

cp /etc/apt/sources.list /etc/apt/sources.list.bak

설정 파일 수정할 때는 꼭 백업 파일을 만들어줘야 합니다.

미러 서버 변경

sed -i 's#http://archive.ubuntu.com/ubuntu/#http://ftp.daumkakao.com/ubuntu/#g; s#http://security.ubuntu.com/ubuntu/#http://ftp.daumkakao.com/ubuntu/#g' /etc/apt/sources.list

이제 다시 apt update나 apt-get update를 실행하면 정상적으로 실행될겁니다~!

profile
Graduate student at Pusan National University, majoring in Artificial Intelligence

0개의 댓글