·터미널 명령어

apt update

패키지·런타임

쓰는 꼴

sudo apt update

패키지 목록만 새로 받아 옵니다 — 이것만으로는 아무것도 설치되거나 올라가지 않아 apt upgrade가 뒤따라야 하고, 갓 만든 컨테이너는 목록이 비어 있어 이 명령이 첫걸음입니다.

자주 쓰는 옵션

옵션
apt upgradethe second half: actually install the newer versions
apt full-upgradeallow packages to be removed to finish the upgrade
apt list --upgradableshow what the refresh found
-qquieter output for logs and CI
--allow-releaseinfo-changeaccept a repository that renamed its suite

예시

sudo apt update

refreshes the package lists only

sudo apt update && sudo apt upgrade -y

refresh, then install the updates

apt list --upgradable

lists the packages that now have a newer version

무엇을 어디에 넣는지가 문제입니다. 프로젝트 안인지 시스템 전체인지 먼저 정하세요.

읽는 방법

  • 대괄호 [ ]는 넣어도 되고 안 넣어도 되는 자리입니다.
  • 점 셋 …은 여러 개를 이어 쓸 수 있다는 뜻입니다.
  • 옵션은 대소문자를 가립니다 — -r과 -R이 다른 명령도 있습니다.

자주 묻는 것

Q. apt update은 무엇을 하나요?

패키지 목록만 새로 받아 옵니다 — 이것만으로는 아무것도 설치되거나 올라가지 않아 apt upgrade가 뒤따라야 하고, 갓 만든 컨테이너는 목록이 비어 있어 이 명령이 첫걸음입니다.

Q. 어떻게 치나요?

sudo apt update — 대괄호는 생략할 수 있는 자리입니다.

Q. 옵션은 몇 개나 자주 쓰나요?

여기 정리한 것은 5개입니다. 전체 목록은 man apt에 있습니다. 이 명령은 패키지·런타임 갈래입니다.

같이 보는 명령

man 페이지: man apt-update