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 옵션으로 출력 ...

Adobe / Firefly / 소개

Adobe Firefly는 Adobe가 개발한 AI 기반의 창작 도구이다. Firefly는 주로 이미지 생성, 편집 및 다양한 크리에이티브 작업을 자동화하고 가속화하는 데 중점을 둔 인공지능 기능을 제공한다. 이 도구는 디자이너, 예술가 및 콘텐츠 제작자가 더 효율적으로 작업할 수 있도록 도와준다. 주요 특징 이미지 생성 및 변형 Adobe Firefly는 텍스트 설명을 기반으로 이미지를 생성할 수 있다. ...

아이피타임(ipTIME) 공유기 / 보안 문자(CAPTCHA) 비활성화 하는 방법

아이피타임(ipTIME) 공유기 / 보안 문자(CAPTCHA) 비활성화 하는 방법

ipTIME 공유기 관리자 페이지에 접속할 때 보안 문자(CAPTCHA)를 입력하게 되어 있다. 보안 상 사용하는 게 좋기는 한데, 역시 불편하다. 만약 이 기능을 끄고 싶다면 에서 변경할 수 있다. 의 값을 변경하면 되는데... 으로 설정하면 항상 보안 문자를 입력해야 하는 것이고... 으로 설정하면 보안 문자 ...

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu 20.04 Server / GUI 설치하는 방법

Ubuntu Server는 CLI(Command Line Interface) 환경으로 설치된다. 그런데 어떤 작업은 GUI(Graphical Uer Interface) 환경에서 하는 것이 편하다. 만약 GUI 환경이 필요하다면 설치하여 사용할 수 있다. GUI 패키지에는 kubuntu-desktop lubuntu-desktop ubuntu-desktop ubuntu-desktop-minimal xubuntu-desktop 등이 있다. 주로 ubuntu-desktop 또는 ubuntu-desktop-minimal을 사용하는 듯 하다. 예를 들어 ubuntu-desktop-minimal을 설치한다면, 다음과 같이 명령하면 된다. # apt install ubuntu-desktop-minimal Minimal임에도 불구하고 꽤 많은 저장소 공간이 필요하다. After ...

Ubuntu 22.04 Server / 백신 프로그램 ClamAV 설치 및 사용법

ClamAV ClamAV는 리눅스에서 사용할 수 있는 백신 프로그램이다. 우분투 패키지에 포함되어 있으므로 apt 명령으로 쉽게 설치하고 사용할 수 있다. 설치 # apt install clamav 사용법 데이터베이스 업데이트 clamav-freshclam 서비스를 중지한다. # systemctl stop clamav-freshclam freshclam 명령으로 업데이트한다. # freshclam clamav-freshclam 서비스를 시작한다. # systemctl start clamav-freshclam 검사 home 디렉토리와 그 하위 디렉토리를 검사한다. # clamscan -r /home 검사 결과는 다음처럼 나온다. ----------- SCAN SUMMARY ----------- Known viruses: ...

아이피타임(ipTIME) 공유기 / 관리자 아이디 비밀번호 변경하는 방법

아이피타임(ipTIME) 공유기 / 관리자 아이디 비밀번호 변경하는 방법

인터넷 공유기는 외부 네트워크와 내부 네트워크를 연결해주는 통로입니다. 따라서 보안은 당연히 중요합니다. 보안을 강화하는 좋은 방법 중의 하나는 관리자 계정 아이디와 비밀번호를 주기적으로 변경하는 것입니다. 아이피타임(ipTIME) 공유기의 관리자 아이디와 비밀번호를 어떻게 변경하는지 알아보겠습니다. 공유기 관리 페이지에 접속하고 로그인합니다. 설정을 변경하지 않았다면 URL은 192.168.0.1, 로그인 이름은 admin, 로그인 암호는 admin입니다. 를 클릭합니다. 왼쪽 메뉴에서 [고급 설정 - ...

워드프레스 / 메모

워드프레스 / 메모

functions.php 위젯 제목 출력되지 않게 하는 방법 위젯의 내용은 출력하지만, 위젯 제목은 출력하고 싶지 않다면, 다음 코드를 추가한다. function no_widget_title( $t ) { return null; } add_filter( 'widget_title', 'no_widget_title' ); 이메일 주소 변경 알림 메일 가지 않게 하는 방법 add_filter( 'send_email_change_email', '__return_false' ); 메타 태그 추가하는 방법 function cmsfactory_meta_tags() { echo '<meta ...>'; echo '<meta ...>'; } add_action( ...

경기지역화폐 / 유효 기간 연장하는 방법

경기지역화폐 / 유효 기간 연장하는 방법

경기지역화폐를 유용하게 사용하고 있습니다. 혜택이 많이 줄기는 했지만, 그래도 혜택이 있으니까요. 자주 방문하는 용인과 양주의 지역화폐를 만들고 사용하고 있는데요, 양주 지역화폐의 유효 기간이 끝나간다고 메시지가 왔습니다. 그래서 경기지역화폐 앱애 로그인했더니 버튼이 있더라구요. 그걸 눌렀더니... 유효 기간을 바로 연장할 수 있더라구요. 신용카드처럼 카드를 새로 발급 받는 건 아니었습니다. 앱에서 유효 기간을 연장하면, 카드에 ...

Rocky Linux 9 / hostname 변경하는 방법

Rocky Linux 9 / hostname 변경하는 방법

CLI 다음과 같이 명령하면 hostname을 출력한다. hostname 다음과 같이 명령하면 hostname을 rocky로 변경한다. hostnamectl set-hostname rocky GUI 의 Device Name에서 변경한다.

CPU / 코어(Core)

CPU(Central Processing Unit)에서 "Core(코어)"란 프로세서의 중앙 처리 장치를 구성하는 기본적인 처리 유닛을 의미합니다. 현대의 CPU는 다중 코어로 구성되어 있으며, 각 코어는 독립적으로 작업을 처리할 수 있습니다. 코어의 정의 코어는 CPU 내에서 실제로 명령을 처리하는 개별적인 처리 유닛입니다. 각 코어는 자체적인 연산 장치(ALU), 레지스터, 그리고 명령어 집합을 가지고 있으며, 독립적으로 작업을 수행할 수 ...