APT
The apt command is a powerful command-line tool, which works with Ubuntu's Advanced Packaging Tool (APT)
아카이브 변경
/etc/apt/sources.list 파일과 /etc/apt/sources.list.d 디렉토리 안에 있는 파일에 아카이브 주소들을 통해 패키지 인덱스를 동기화하고 다운로드한다.
/etc/apt/sources.list 파일 내용을 출력하여 Source 리스트를 확인한다.
$ cat /etc/apt/sources.list
#
# deb cdrom:[Ubuntu-Server 18.04.2 LTS _Bionic Beaver_ - Release amd64 (20190210)]/ bionic main restricted
#deb cdrom:[Ubuntu-Server 18.04.2 LTS _Bionic Beaver_ - Release amd64 (20190210)]/ bionic main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.
deb http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
# deb-src http://us.archive.ubuntu.com/ubuntu/ bionic main restricted
...
우분투 서버 설치 과정 중 지역을 미국으로 선택했다면 아카이브 Source가 http://us.archive.ubuntu.com/ubuntu/ 일 것이다. 미국에 있는 아카이브를 통해 소프트웨어를 다운받는 것보다 한국에 있는 아카이브를 통해 다운받으면 속도가 빠르기 때문에 카카오 에서 제공하는 우분투 미러 아카이브로 바꿔준다.
/etc/apt/sources.list 파일을 백업한다.
sed 명령어를 통해 us.archive.ubuntu.com 를 mirror.kakao.com로 치환한다.
/etc/apt/sources.list 파일을 출력하면 아래와 같이 mirror.kakao.com 로 바낀 것을 확인할 수 있다.
apt-get update 시 http://mirror.kakao.com/ubuntu 을 통해 업데이트 되는 것을 볼 수 있다.
패키지 업데이트
우분투 서버에 설치되어 있는 패키지를 최신으로 업그레이드하기 위해 먼저 apt-get update로 최신 패키지정보를 받아온다.
우분투 서버에 설치되어 있는 패키지들을 최신 버전으로 업그레이드를 한다.
Last updated
Was this helpful?