반응형
우분투(Ubuntu)에서 apt 저장소(repository)를 변경하는 방법
1. apt 저장소 확인
현재 사용 중인 저장소 목록을 확인합니다.
vim /etc/apt/sources.list
sources.list
더보기
---
cat /etc/apt/sources.list
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy main restricted
## Major bug fix updates produced after the final release of the
## distribution.
deb http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates main restricted
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ jammy universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy universe
deb http://archive.ubuntu.com/ubuntu/ jammy-updates universe
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates universe
## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://archive.ubuntu.com/ubuntu/ jammy multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy multiverse
deb http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-updates multiverse
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
deb http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
# deb-src http://archive.ubuntu.com/ubuntu/ jammy-backports main restricted universe multiverse
deb http://security.ubuntu.com/ubuntu/ jammy-security main restricted
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security main restricted
deb http://security.ubuntu.com/ubuntu/ jammy-security universe
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security universe
deb http://security.ubuntu.com/ubuntu/ jammy-security multiverse
# deb-src http://security.ubuntu.com/ubuntu/ jammy-security multiverse
---
2. 기존 저장소 백업
저장소를 변경하기 전에 현재 설정을 백업해두는 것이 좋습니다.
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
3. 새 저장소 설정
새로운 저장소 정보를 설정하려면 /etc/apt/sources.list 파일을 수정합니다.
- vim 명령어로 apt 저장소 변경(vim의 치환 가능을 이용하여 변경)
:%s/kr.archive.ubuntu.com/mirror.kakao.com/g
- sed 명령어로 apt 저장소 변경
sed -i 's/kr.archive.ubuntu.com/mirror.kakao.com/g' /etc/apt/sources.list
728x90
4. apt 저장소 업데이트
저장소 설정을 변경했다면 아래 명령을 사용하여 저장소 정보를 업데이트합니다.
apt-get update
이 명령을 실행하면 새로운 저장소에서 사용 가능한 패키지 목록을 가져옵니다.
Ubuntu용 공식 아카이브 미러(Official Archive Mirrors for Ubuntu)
https://launchpad.net/ubuntu/+archivemirrors
- https://ftp.lanet.kr/ubuntu/
- https://mirror.yongbok.net/ubuntu/
- https://ftp.harukasan.org/ubuntu/
- https://mirror.misakamikoto.network/ubuntu-ports/
- https://ftp.lanet.kr/ubuntu-ports/
- https://mirror.misakamikoto.network/ubuntu/
- https://ftp.harukasan.org/ubuntu-ports/
- https://mirror.anigil.com/ubuntu/
- http://ftp.daum.net/ubuntu/
- https://mirror.kakao.com/ubuntu/
- http://archive.ubuntu.com/ubuntu/
5. 패키지 업그레이드 및 설치
저장소가 정상적으로 업데이트되었다면 패키지를 업그레이드하거나 새로운 패키지를 설치할 수 있습니다.
- 패키지 업그레이드
sudo apt upgrade
- 새로운 패키지 설치
sudo apt install 패키지이름
저장소 변경 후에는 새로운 패키지가 사용 가능하게 되고, 저장소가 제공하는 패키지를 설치, 업그레이드, 관리할 수 있습니다. 하지만 저장소를 변경할 때에는 신뢰할 수 있는 소스를 사용하도록 주의해야 합니다.
728x90
반응형
'리눅스' 카테고리의 다른 글
우분투(Ubuntu 22.04 LTS)에 OpenSSL(openssl-1.1.1)설치하기 (0) | 2022.04.28 |
---|---|
록키 리눅스 다운로드(Rocky Linux Download) (0) | 2022.04.22 |
Ubuntu Server 22.04 LTS를 설치하는 방법 (0) | 2022.04.21 |
Ubuntu Server 22.04 LTS (Jammy Jellyfish) (0) | 2022.04.21 |
[리눅스] 우분투 기본 설정 (0) | 2022.04.06 |