Ubuntu 18.04 Server / apt / 패키지 설치, 삭제, 업그레이드하는 명령어

Ubuntu에서 패키지를 관리하는 명령어는 여러 가지가 있습니다. 그 중 널리 사용되는 것은 apt-get과 apt입니다. 아래는 apt를 이용하여 패키지를 설치하고 삭제하고 업그레이드하는 방법입니다. 대부분의 경우 apt-get을 사용해도 작동합니다.

APT 사용법

  • 패키지 목록을 갱신합니다
# apt update
  • 모든 패키지를 최신 버전으로 업그레이드합니다.
# apt upgrade
  • abc 패키지를 설치합니다. 의존성있는 패키지도 함께 설치합니다.
# apt install abc
  • abc 패키지를 삭제합니다. 설정 파일 등은 삭제하지 않습니다.
# apt remove abc
  • 더 이상 필요 없는 패키지들을 삭제합니다.
# apt autoremove
  • 설정 파일 등도 포함하여 abc 패키지를 삭제합니다.
# apt purge abc
  • abc와 관련된 패키지를 검색합니다.
# apt search abc
  • abc 패키지의 정보를 출력합니다.
# apt show abc
  • 패키지 목록을 출력합니다.
# apt list
  • 설치된 패키지 목록을 출력합니다.
# apt list --installed
  • 업그레이드 가능한 패키지 목록을 출력합니다.
# apt list --upgradable
  • 도움말을 출력합니다.
# apt --help
apt 1.6.12 (amd64)
Usage: apt [options] command

apt is a commandline package manager and provides commands for
searching and managing as well as querying information about packages.
It provides the same functionality as the specialized APT tools,
like apt-get and apt-cache, but enables options more suitable for
interactive use by default.

Most used commands:
  list - list packages based on package names
  search - search in package descriptions
  show - show package details
  install - install packages
  remove - remove packages
  autoremove - Remove automatically all unused packages
  update - update list of available packages
  upgrade - upgrade the system by installing/upgrading packages
  full-upgrade - upgrade the system by removing/installing/upgrading packages
  edit-sources - edit the source information file

See apt(8) for more information about the available commands.
Configuration options and syntax is detailed in apt.conf(5).
Information about how to configure sources can be found in sources.list(5).
Package and version choices can be expressed via apt_preferences(5).
Security details are available in apt-secure(8).
                                        This APT has Super Cow Powers.

저장소 변경하는 방법

우분투에서 패키지를 업데이트 하거나 설치하면, 미러 서버에서 소프트웨어를 다운로드하여 설치합니다. 그런데, 그 미러 서버가 멀리 있거나 속도가 느리다면, 패키지를 다운로드하는데 많은 시간이 소요됩니다. 속도가 너무 느려서 불편하다면 저장소를 지정하여 속도를 빠르게 할 수 있습니다.

저장소 설정은 /etc/apt/sources.list에서 합니다. 파일을 텍스트 에디터로 열고

http://archive.ubuntu.com/ubuntu

를 모두 변경합니다. 만약 한국이라면

http://mirror.kakao.com/ubuntu

으로 바꿔보세요.

참고로, 지역별 우분투 미러 서버 리스트는 여기서 확인할 수 있습니다.

같은 카테고리의 다른 글

리눅스 / 명령어 / which, whereis, locate / 명령어 위치 찾기

명령어의 위치를 찾을 때 사용할 수 있는 명령어에는 which, whereis, locate가 있다. 명령어의 위치만 찾을 때는 which를 사용하고, 관련된 파일들의 위치까지 찾을 때는 whereis나 locate를 사용한다. which 명령어로 find 명령어를 찾는다. # which find /usr/bin/find whereis 명령어로 find 명령어를 찾는다. # whereis find find: /usr/bin/find /usr/share/man/man1/find.1.gz locate 명령어로 find 명령어를 찾는다. # locate find /usr/bin/find /usr/bin/find2perl /usr/bin/findmnt /usr/bin/nl-link-ifindex2name /usr/bin/nl-link-name2ifindex /usr/bin/oldfind /usr/lib64/python2.7/modulefinder.py /usr/lib64/python2.7/modulefinder.pyc /usr/lib64/python2.7/modulefinder.pyo /usr/sbin/btrfs-find-root /usr/sbin/findfs /usr/share/bash-completion/completions/findmnt /usr/share/doc/findutils-4.5.11 /usr/share/doc/findutils-4.5.11/AUTHORS /usr/share/doc/findutils-4.5.11/COPYING /usr/share/doc/findutils-4.5.11/ChangeLog /usr/share/doc/findutils-4.5.11/NEWS /usr/share/doc/findutils-4.5.11/README /usr/share/doc/findutils-4.5.11/THANKS /usr/share/doc/findutils-4.5.11/TODO /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_find.py /usr/share/doc/wpa_supplicant-2.6/examples/p2p/p2p_stop_find.py /usr/share/info/find-maint.info.gz /usr/share/info/find.info.gz /usr/share/locale/be/LC_MESSAGES/findutils.mo /usr/share/locale/bg/LC_MESSAGES/findutils.mo /usr/share/locale/ca/LC_MESSAGES/findutils.mo /usr/share/locale/cs/LC_MESSAGES/findutils.mo /usr/share/locale/da/LC_MESSAGES/findutils.mo /usr/share/locale/de/LC_MESSAGES/findutils.mo /usr/share/locale/el/LC_MESSAGES/findutils.mo /usr/share/locale/eo/LC_MESSAGES/findutils.mo /usr/share/locale/es/LC_MESSAGES/findutils.mo /usr/share/locale/et/LC_MESSAGES/findutils.mo /usr/share/locale/fi/LC_MESSAGES/findutils.mo /usr/share/locale/fr/LC_MESSAGES/findutils.mo /usr/share/locale/ga/LC_MESSAGES/findutils.mo /usr/share/locale/gl/LC_MESSAGES/findutils.mo /usr/share/locale/hr/LC_MESSAGES/findutils.mo /usr/share/locale/hu/LC_MESSAGES/findutils.mo /usr/share/locale/id/LC_MESSAGES/findutils.mo /usr/share/locale/it/LC_MESSAGES/findutils.mo /usr/share/locale/ja/LC_MESSAGES/findutils.mo /usr/share/locale/ko/LC_MESSAGES/findutils.mo /usr/share/locale/lg/LC_MESSAGES/findutils.mo /usr/share/locale/lt/LC_MESSAGES/findutils.mo /usr/share/locale/ms/LC_MESSAGES/findutils.mo /usr/share/locale/nl/LC_MESSAGES/findutils.mo /usr/share/locale/pl/LC_MESSAGES/findutils.mo /usr/share/locale/pt/LC_MESSAGES/findutils.mo /usr/share/locale/pt_BR/LC_MESSAGES/findutils.mo /usr/share/locale/ro/LC_MESSAGES/findutils.mo /usr/share/locale/ru/LC_MESSAGES/findutils.mo /usr/share/locale/rw/LC_MESSAGES/findutils.mo /usr/share/locale/sk/LC_MESSAGES/findutils.mo /usr/share/locale/sl/LC_MESSAGES/findutils.mo /usr/share/locale/sr/LC_MESSAGES/findutils.mo /usr/share/locale/sv/LC_MESSAGES/findutils.mo /usr/share/locale/tr/LC_MESSAGES/findutils.mo /usr/share/locale/uk/LC_MESSAGES/findutils.mo /usr/share/locale/vi/LC_MESSAGES/findutils.mo /usr/share/locale/zh_CN/LC_MESSAGES/findutils.mo /usr/share/locale/zh_TW/LC_MESSAGES/findutils.mo /usr/share/man/man1/find.1.gz /usr/share/man/man1/find2perl.1.gz /usr/share/man/man1/oldfind.1.gz /usr/share/man/man8/btrfs-find-root.8.gz /usr/share/man/man8/findfs.8.gz /usr/share/man/man8/findmnt.8.gz locate 명령어는 -n 옵션으로 출력 ...

안드로이드 / 앱 / 원스토어 / 설치하는 방법

안드로이드 / 앱 / 원스토어 / 설치하는 방법

원스토어는 네이버와 통신 3사가 협력해서 만든 앱 장터입니다. 국내를 대상으로 하는 거라 사용이 편하고 이벤트도 많이 있습니다. 통신사를 통해 구입한 스마트폰에는 대부분 원스토어가 기본적으로 설치되어 있습니다. 하지만 제조사로부터 직접 구입한, 특히 외국에서 만든 스마트폰의 경우 원스토어가 설치되어 있지 않습니다. 만약 원스토어를 이용하고 싶다면 별도로 원스토어 앱을 설치해야 합니다. 다음은 크롬 웹브라우저에서 설치를 ...

리눅스 / 로그아웃 명령어, 재부팅 명령어, 종료 명령어

로그아웃 명령어 # logout # exit 재부팅 명령어 즉시 재부팅 # reboot # shutdown -r now # init 6 일정 시간 또는 일정 시간 후 재부팅 10분 후 재부팅 # shutdown -r 10 12시에 재부팅 # shutdown -r 12:00 취소 # shutdown -c 종료 명령어 즉시 종료 # poweroff # shutdown -h now # shutdown -P now # halt -p # init 0 일정 시간 또는 일정 시간 후에 종료 10분 후에 종료 # ...

안드로이드 / 앱 / 마이 케이티 / 장기혜택쿠폰 사용 또는 선물하는 방법

안드로이드 / 앱 / 마이 케이티 / 장기혜택쿠폰 사용 또는 선물하는 방법

KT 핸드폰을 2년 이상 사용하면 매년 장기혜택쿠폰이 들어온다. 데이터, 무료통화, 알 등을 제공하는 것으로, 제한이 있는 저렴한 요금제라면 유용하게 사용할 수 있다. 만약 가족 결합이 되어 있다면 구성원에게 선물할 수도 있다. 장기혜택쿠폰 사용은 홈페이지에서도 가능한데, 아래는 안드로이드에 있는 마이 케이티 앱에서 사용하는 방법이다. 마이 케이티 앱을 열고 왼쪽 위의 아이콘을 눌러서 메뉴로 ...

Ubuntu 20.04 Server / hostname 확인하는 방법, 변경하는 방법

Ubuntu 20.04 Server / hostname 확인하는 방법, 변경하는 방법

hostname 확인하는 방법 방법 1 - 명령어로 확인하기 다음과 같이 명령하면 hostname을 출력한다. hostname 방법 2 - 설정 파일 열어서 확인하기 /etc/hostname 파일에 hostname이 있다. cat /etc/hostname hostname 변경하는 방법 방법 1 - 명령어로 변경하기 다음과 같이 명령하면 hostname이 abc로 바뀐다. hostnamectl set-hostname abc 방법 2 - 설정 파일 열어서 변경하기 텍스트 에디터로 /etc/hostname 파일을 열어서 내용을 abc로 바꾸면 hostname이 abc로 바뀐다. 재부팅 재부팅을 하면 변경사항이 ...

노트북 / HP 빅터스 / 15-FA0061TX 구입 후기

노트북 / HP 빅터스 / 15-FA0061TX 구입 후기

노트북을 구입하게 되었다. 용도는 그래픽과 동영상 편집용. 원활한 작업을 위해서는 다음의 사양이 필요했다. 외장 그래픽 카드 메모리 확장 또는 교체 가능 디스크 확장 또는 교체 가능 가격은 100만 원 대 초중반 색은 검정 또는 그레이 색에 신경 쓰는 이유는 변색 때문이다. 손 때 묻는 거야 닦으면 되지만, 하얀색 노트북은 누렇게 변색되는 경우가 많다. 이 조건으로 검색을 하니 ...

Ubuntu 22.04 Server / ZIP 압축 파일 푸는 방법

ZIP 파일을 압축 해제하기 위해서는 unzip 패키지가 필요하다. # apt install unzip xxx.zip 파일을 압축 해제하려면 다음과 같이 명령한다. # unzip xxx.zip 다음과 같이 명령하여 도움말을 볼 수 있다. # unzip -h 결과는 다음과 같다. UnZip 6.00 of 20 April 2009, by Debian. Original by Info-ZIP. Usage: unzip Default ...

리눅스 / 명령어 / cal / 달력을 출력하는 명령어

cal은 달력을 출력하는 명령어이다. 아무 옵션 없이 사용하면 현재 날짜가 속한 달의 달력을 출력한다. cal October 2022 Su Mo Tu We Th Fr Sa 1 2 3 4 5 ...

Microsoft Office 2016 / 마이크로소프트 계정에서 로그아웃하는 방법

Microsoft Office 2016 / 마이크로소프트 계정에서 로그아웃하는 방법

MS OFFICE 2016은 마이크로소프트 계정에 로그인되어 있지 않아도 사용할 수 있습니다. 어떻게 로그아웃하는지 알아보겠습니다. 오른쪽 위에 있는 계정 이름을 클릭하면 조그만 창이 나오는데, 제일 아래에 있는 을 클릭합니다. 을 클릭합니다. 계정 옆에 나오는 을 클릭합니다. 로그아웃할 때 발생하는 문제를 안내하는 창이 나옵니다. 를 클릭하면 로그아웃되고, 오른쪽 위에 계정 이름 대신 링크가 생깁니다.

안드로이드 / 앱 / 카카오톡 / 대화 내용 캡쳐하는 방법

안드로이드 / 앱 / 카카오톡 / 대화 내용 캡쳐하는 방법

스마트폰의 캡쳐 기능을 이용하면 화면을 이미지로 저장할 수 있다. 그런데 화면에 보이는 부분만 가능하다. 만약 특정 부분만 캡쳐하거나 화면을 벗어나는 부분도 캡쳐하고 싶다면 앱이 제공하는 기능을 사용한다. 카카오톡에도 캡쳐 기능이 있는데, 이를 이용하면 원하는 대화 내용을 캡쳐할 수 있고, 화면을 벗어나는 긴 대화도 캡쳐 가능하다. 대화방에서 + 아이콘을 누른다. 를 누른다. 화면이 어두워지는데... 캡쳐하려는 첫번째 ...