Apt-get install -f la gi

apt-get install và apt install – sự khác nhau bạn có biết

by SaKuRai · 20/11/2019

apt-get​​ install​​ và apt install - sự khác nhau bạn có biết

apt install

Khi cài sẽ lưu gói tin .deb vào​​ /var/cache/apt/archives​​ nhưng sau khi cài xong lập tức sẽ xoá luôn gói tin .deb

 

apt-get install thì ngược lại không xoá gói tin .deb trong​​ /var/cache/apt/archives

nếu cần bạn có thể lấy các gói tin .deb ra để sử dụng tiếp

Bài viết này giới thiệu với các bạn về cách dùng apt trên bản phân phối Debian/Ubuntu của hệ điều hành Linux qua các cách sử dụng lệnh

sudo apt install =
5 dưới đây giúp cho các bạn có thể tự cài đặt các gói mà các bạn cần từ đó giúp cho các bạn có thể tự tìm hiểu và tự học Linux cơ bản dễ dàng hơn.

1. Giới thiệu về lệnh apt

Lệnh

sudo apt install =
5 (Advanced Package Tool) là một công cụ được sử dụng để quản lý các gói phần mềm trên các bản phân phối Linux thuộc dòng Ubuntu/Debian. Chúng ta có thể sử dụng nó để tìm và cài đặt các gói mới, cập nhật và nâng cấp gói, loại bỏ các gói, theo dõi tất cả các phần mềm được cài đặt.

Trong hướng dẫn này, chúng ta sẽ tìm hiểu về cách sử dụng lệnh

sudo apt install =
5 trên bản phân phối Ubuntu.

2. Sử dụng lệnh apt

👉 Ví dụ 1: Cài đặt gói

Để cài đặt gói chúng ta sử dụng lệnh

sudo apt install =
8. Điều này sẽ xác định các phụ thuộc tự động và cài đặt chúng.

Ví dụ sau đây cài đặt gói nodejs.

blogd@ubuntuserver:~$ sudo apt install nodejs
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
  libc-ares2 libnode64 libuv1 nodejs-doc
Suggested packages:
  npm
The following NEW packages will be installed:
  libc-ares2 libnode64 libuv1 nodejs nodejs-doc
0 upgraded, 5 newly installed, 0 to remove and 29 not upgraded.
Need to get 6,489 kB of archives.
After this operation, 29.4 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 libc-ares2 amd64 1.14.0-1 [37.1 kB]
Get:2 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 libuv1 amd64 1.24.1-1 [69.5 kB]
Get:3 http://vn.archive.ubuntu.com/ubuntu disco/universe amd64 libnode64 amd64 10.15.2~dfsg-1 [5,397 kB]

Theo mặc định

sudo apt install =
9, sẽ nhắc chúng ta chấp nhận hoặc từ chối trước khi cài đặt các gói. Nếu bạn muốn
sudo apt install =
5 cài đặt tự động mà không hỏi xác nhận lại, hãy sử dụng tùy chọn
blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
1.

Trong ví dụ này chúng ta cài đặt gói apache2 tự động không hỏi xác nhận lại bằng tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
1:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...

Chúng ta có thể thực hiện cài đặt nhiều gói cùng một lúc với

sudo apt install =
5. Bạn có thể cài đặt nhiều gói cùng một lúc bằng cách cung cấp tất cả các tên gói cú pháp như bên dưới:

sudo apt install   

Bạn có thể cài đặt một gói mà không muốn nâng cấp. Trong trường hợp đó, bạn có thể sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
4 theo cú pháp sau:

sudo apt install  --no-upgrade

Khi cài đặt một gói thì theo mặt định thì phiên bản mới nhất có sẵn trong kho sẽ được cài đặt. Nếu chúng ta không muốn cài đặt phiên bản mới nhất, chúng ta có thể chỉ định số phiên bản.

sudo apt install =

Lưu ý: Bạn sẽ cần biết chính xác số phiên bản mà bạn muốn cài đặt.

👉 Ví dụ 2: Kiểm tra tất cả các phụ thuộc của một gói

Để có thể hiển thị tất cả thông tin về các phụ thuộc của một gói cụ thể chúng ta thực hiện như bên dưới:

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...

👉 Ví dụ 3: Tìm kiếm một gói

Chúng ta có thể sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
5 để có thể tìm kiếm một tên gói và hiển thị tất cả các gói phù hợp.

blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...

👉 Ví dụ 4: Xem thông tin về gói

Khi chúng ta cần biết thêm về một gói trước khi cài đặt hoặc gỡ bỏ nó, bạn có thể sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
6 để có thể hiển thị thông tin về một gói. Tùy chọn này sẽ giúp chúng ta hiển thị thông tin các gói đã cho như phụ thuộc, kích thước cài đặt và tải xuống của gói, các nguồn khác nhau mà gói có sẵn từ đó, mô tả nội dung của gói:

blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it

👉 Ví dụ 5: Trong quá trình cài đặt gói, chúng ta có thể gặp lỗi liên quan đến các phụ thuộc gói bị hỏng, để kiểm tra xem bạn không gặp phải các vấn đề này thực hiện lệnh bên dưới:

blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done

👉 Ví dụ 6: Cập nhật các gói hệ thống (System Packages)

Lệnh

sudo apt install =
5 hoạt động trên dữ liệu của các gói có sẵn. Nếu dữ liệu không được cập nhật, hệ thống sẽ không biết liệu có gói nào mới hơn không. Vì vậy việc cập nhật kho lưu trữ nên là điều quan trọng cần làm trong hệ thống Linux:

blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.

Trong đó đầu ra chúng ta thường sẽ bắt gặp 3 thông tin cơ bản:

  • blogd@ubuntuserver:~$ sudo apt depends apache2
    apache2
      PreDepends: dpkg (>= 1.17.14)
      Depends: apache2-bin (= 2.4.38-2ubuntu2)
      Depends: apache2-data (= 2.4.38-2ubuntu2)
      Depends: apache2-utils (= 2.4.38-2ubuntu2)
      Depends: lsb-base
      Depends: mime-support
      Depends: 
        perl
      Depends: procps
      Conflicts: 
      Conflicts: 
      Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
      Recommends: ssl-cert
      Suggests: apache2-doc
     |Suggests: apache2-suexec-pristine
      Suggests: apache2-suexec-custom
      Suggests: 
        dillo
        edbrowse
        hv3
        lynx
        netsurf
        netsurf-fb
        netsurf-gtk
        chromium-browser
        elinks
    ...
    
    8: Không có thay đổi trong phiên bản
  • blogd@ubuntuserver:~$ sudo apt depends apache2
    apache2
      PreDepends: dpkg (>= 1.17.14)
      Depends: apache2-bin (= 2.4.38-2ubuntu2)
      Depends: apache2-data (= 2.4.38-2ubuntu2)
      Depends: apache2-utils (= 2.4.38-2ubuntu2)
      Depends: lsb-base
      Depends: mime-support
      Depends: 
        perl
      Depends: procps
      Conflicts: 
      Conflicts: 
      Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
      Recommends: ssl-cert
      Suggests: apache2-doc
     |Suggests: apache2-suexec-pristine
      Suggests: apache2-suexec-custom
      Suggests: 
        dillo
        edbrowse
        hv3
        lynx
        netsurf
        netsurf-fb
        netsurf-gtk
        chromium-browser
        elinks
    ...
    
    9: Gói đang bị bỏ qua.
  • blogd@ubuntuserver:~$  sudo apt search apache2
    Sorting... Done
    Full Text Search... Done
    apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
      Apache HTTP Server
    
    apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
      Apache HTTP Server (modules and other binary files)
    
    apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
      Apache HTTP Server (common files)
    
    apache2-dev/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server (development headers)
    
    apache2-doc/disco 2.4.38-2ubuntu2 all
      Apache HTTP Server (on-site documentation)
    
    apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server (mod_ssl development headers)
    
    apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server configurable suexec program for mod_suexec
    
    apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server standard suexec program for mod_suexec
    
    apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
      Apache HTTP Server (utility programs for web servers)
    ...
    
    0: Có một phiên bản mới có sẵn. Nó sẽ tải thông tin về phiên bản. Bạn có thể thấy thông tin tải xuống kích thước tính bằng KB.

👉 Ví dụ 7: Nâng cấp hệ thống

Bạn có thể nâng cấp các gói đã cài đặt sử dụng lệnh dưới đây:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
0

Qua lệnh này thì tất cả các gói sẽ được nâng cấp.

Ngoài ra chúng ta có thể nâng cấp tất cả các gói hoàn chỉnh bằng cách sử dụng lệnh dưới đây:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
1

👉 Ví dụ 8: Loại bỏ các gói không sử dụng

Khi chúng ta thực hiện cài đặt gói mới trên hệ thống của mình, phần phụ thuộc cũng được cài đặt và sử dụng một số thư viện hệ thống với các gói khác. Sau khi loại bỏ gói cụ thể thì các phụ thuộc của nó sẽ vẫn còn trên hệ thống, do đó để loại bỏ chúng hãy sử dụng chế độ tự động như sau:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
2

👉 Ví dụ 9: Để có thể xóa tất cả kho lưu trữ cũ của các gói đã tải xuống chúng ta chạy lệnh bên dưới:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
3

👉 Ví dụ 10: Loại bỏ các gói với tập tin cấu hình của nó

Khi chúng ta chạy lệnh

sudo apt install =
5 với tùy chọn
blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
2 thì nó chỉ xóa các tệp gói nhưng các tệp cấu hình vẫn còn trên hệ thống. Do đó, để xóa gói và tệp cấu hình của nó chúng ta cần sử dụng tùy chọn
blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
3 như bên dưới:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
4

👉 Ví dụ 11: Tìm trợ giúp khi sử dụng APT

Lệnh bên dưới sẽ liệt kê cho bạn tất cả các tùy chọn với mô tả về cách sử dụng lệnh

sudo apt install =
5 trên hệ thống của bạn.

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
53. Giới thiệu apt-cache

apt-cache là một công cụ được sử dụng để tìm kiếm các gói phần mềm, thu thập thông tin của các gói và cũng được sử dụng để tìm kiếm những gói có sẵn đã sẵn sàng để cài đặt trên các hệ thống dựa trên Debian hoặc Ubuntu. Ngoài ra, nó được sử dụng để có được thông tin của các gói phần mềm. Công cụ này sử dụng bộ đệm gói của apt (Advanced Packaging Tool) để tìm các gói và tên gói.

4. Sử dụng apt-cache

👉 Ví dụ 1: Để có thể liệt kê tất cả các gói có sẵn chúng ta chạy lệnh bên dưới:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
6

👉 Ví dụ 2: Tìm kiếm tên gói và mô tả của gói

Để tìm ra tên gói và với mô tả trước khi cài đặt chúng ta sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
5 kết hợp với lệnh
blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
6. Nó sẽ hiển thị danh sách các gói phù hợp với mô tả ngắn thực hiện như sau:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
7

👉 Ví dụ 3: Để tìm và liệt kê tất cả các gói bắt đầu bằng

blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
7 bạn có thể sử dụng lệnh sau:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
8

👉 Ví dụ 4: Chúng ta có thể kiểm tra thông tin của gói cùng với mô tả (phiên bản, kiểm tra tổng kích thước, kích thước cài đặt, danh mục,...). Sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
6 như bên dưới:

blogd@ubuntuserver:~$ sudo apt install -y apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  apache2-doc apache2-suexec-pristine | apache2-suexec-custom www-browser
The following NEW packages will be installed:
  apache2
0 upgraded, 1 newly installed, 0 to remove and 29 not upgraded.
Need to get 95.5 kB of archives.
After this operation, 539 kB of additional disk space will be used.
Get:1 http://vn.archive.ubuntu.com/ubuntu disco/main amd64 apache2 amd64 2.4.38-2ubuntu2 [95.5 kB]
Fetched 95.5 kB in 2s (50.3 kB/s)
Selecting previously unselected package apache2.
(Reading database ... 67970 files and directories currently installed.)
Preparing to unpack .../apache2_2.4.38-2ubuntu2_amd64.deb ...
Unpacking apache2 (2.4.38-2ubuntu2) ...
Setting up apache2 (2.4.38-2ubuntu2) ...
Processing triggers for systemd (240-6ubuntu5) ...
Processing triggers for man-db (2.8.5-2) ...
Processing triggers for ufw (0.36-1ubuntu1) ...
9

👉 Ví dụ 5: Chúng ta có thể kiểm tra các phụ thuộc cho các gói cụ thể bằng việc sử dụng tùy chọn

blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
9 để kiểm tra các phụ thuộc cho các gói phần mềm cụ thể cho dù các gói phụ thuộc được cài đặt hay không.

sudo apt install   
0

👉 Ví dụ 6: Để kiểm tra số liệu thống kê của bộ nhớ đệm chúng ta sử dụng tuỳ chọn

blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it
0 sẽ hiển thị số liệu thống kê tổng thể về bộ đệm.

sudo apt install   
15. Giới thiệu apt-get

apt-get là một tiện ích quản lý gói mạnh mẽ và miễn phí, được sử dụng để làm việc với thư viện Ubuntu APT (Advanced Packaging Tool) thực hiện cài đặt, tìm kiếm gói, cập nhật, loại bỏ các gói phần mềm hiện có, nâng cấp các gói phần mềm hiện tại và sử dụng để nâng cấp toàn bộ hệ điều hành.

apt-get yêu cầu các đặc quyền quản trị supperuser, vì nó liên quan đến các khía cạnh cốt lõi của hệ thống.

6. Sử dụng apt-get

👉 Ví dụ 1: Trước khi bắt đầu với

blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it
1 chúng ta cần cập nhật bản sao cơ sở dữ liệu cục bộ. Nếu như không được cập nhật thì hệ thống sẽ không biết các gói mới hơn có sẵn hay không. Để thực hiện cập nhật, hãy chạy lệnh bên dưới:

sudo apt install   
2

Trong đó đầu ra chúng ta thường sẽ bắt gặp 3 thông tin cơ bản:

  • blogd@ubuntuserver:~$ sudo apt depends apache2
    apache2
      PreDepends: dpkg (>= 1.17.14)
      Depends: apache2-bin (= 2.4.38-2ubuntu2)
      Depends: apache2-data (= 2.4.38-2ubuntu2)
      Depends: apache2-utils (= 2.4.38-2ubuntu2)
      Depends: lsb-base
      Depends: mime-support
      Depends: 
        perl
      Depends: procps
      Conflicts: 
      Conflicts: 
      Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
      Recommends: ssl-cert
      Suggests: apache2-doc
     |Suggests: apache2-suexec-pristine
      Suggests: apache2-suexec-custom
      Suggests: 
        dillo
        edbrowse
        hv3
        lynx
        netsurf
        netsurf-fb
        netsurf-gtk
        chromium-browser
        elinks
    ...
    
    8: Không có thay đổi trong phiên bản
  • blogd@ubuntuserver:~$ sudo apt depends apache2
    apache2
      PreDepends: dpkg (>= 1.17.14)
      Depends: apache2-bin (= 2.4.38-2ubuntu2)
      Depends: apache2-data (= 2.4.38-2ubuntu2)
      Depends: apache2-utils (= 2.4.38-2ubuntu2)
      Depends: lsb-base
      Depends: mime-support
      Depends: 
        perl
      Depends: procps
      Conflicts: 
      Conflicts: 
      Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
      Recommends: ssl-cert
      Suggests: apache2-doc
     |Suggests: apache2-suexec-pristine
      Suggests: apache2-suexec-custom
      Suggests: 
        dillo
        edbrowse
        hv3
        lynx
        netsurf
        netsurf-fb
        netsurf-gtk
        chromium-browser
        elinks
    ...
    
    9: Gói đang bị bỏ qua.
  • blogd@ubuntuserver:~$  sudo apt search apache2
    Sorting... Done
    Full Text Search... Done
    apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
      Apache HTTP Server
    
    apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
      Apache HTTP Server (modules and other binary files)
    
    apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
      Apache HTTP Server (common files)
    
    apache2-dev/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server (development headers)
    
    apache2-doc/disco 2.4.38-2ubuntu2 all
      Apache HTTP Server (on-site documentation)
    
    apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server (mod_ssl development headers)
    
    apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server configurable suexec program for mod_suexec
    
    apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
      Apache HTTP Server standard suexec program for mod_suexec
    
    apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
      Apache HTTP Server (utility programs for web servers)
    ...
    
    0: Có một phiên bản mới có sẵn. Nó sẽ tải thông tin về phiên bản. Bạn có thể thấy thông tin tải xuống kích thước tính bằng KB.

👉 Ví dụ 2: Khi cơ sở dữ liệu đã được cập nhật thì chúng ta có thể nâng cấp các gói đã được cài đặt trên máy. Nó sẽ cập nhật bất kỳ ứng dụng lên các phiên bản mới nhất hiện có.

sudo apt install   
3

Khi chúng ta cần nâng cấp một chương trình cụ thể thay vì toàn bộ hệ thống, hãy sử dụng lệnh bên dưới:

sudo apt install   
4

Chúng ta có thể kết hợp các lệnh lại với nhau, sao cho một lệnh có thể chạy nhiều chức năng. Để thực hiện cập nhật theo sau là nâng cấp, bạn có thể chạy lệnh này:

sudo apt install   
5

Khi thực hiện lệnh trên thì máy chạy bản cập nhật, sau đó chạy nâng cấp. Các tùy chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
1 giúp chúng ta tự động cập nhật và nâng cấp mà không hỏi xác nhận lại

👉 Ví dụ 3: Cài đặt gói

Để cài đặt gói chúng ta sử dụng lệnh

blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it
6. Điều này sẽ xác định các phụ thuộc tự động và cài đặt chúng.

Ví dụ sau đây cài đặt gói apache2.

sudo apt install   
6

👉 Ví dụ 4: Bạn cũng có thể cài đặt nhiều gói cùng một lúc bằng cách sử dụng lệnh bên dưới:

sudo apt install   
7

👉 Ví dụ 5: Để có thể cài đặt gói mà không cần nâng cấp chúng ta sử dụng tuỳ chọn

blogd@ubuntuserver:~$ sudo apt depends apache2
apache2
  PreDepends: dpkg (>= 1.17.14)
  Depends: apache2-bin (= 2.4.38-2ubuntu2)
  Depends: apache2-data (= 2.4.38-2ubuntu2)
  Depends: apache2-utils (= 2.4.38-2ubuntu2)
  Depends: lsb-base
  Depends: mime-support
  Depends: 
    perl
  Depends: procps
  Conflicts: 
  Conflicts: 
  Breaks: libapache2-mod-proxy-uwsgi (<< 2.4.33)
  Recommends: ssl-cert
  Suggests: apache2-doc
 |Suggests: apache2-suexec-pristine
  Suggests: apache2-suexec-custom
  Suggests: 
    dillo
    edbrowse
    hv3
    lynx
    netsurf
    netsurf-fb
    netsurf-gtk
    chromium-browser
    elinks
...
4 sẽ ngăn các gói đã cài đặt nâng cấp.

sudo apt install   
8

👉 Ví dụ 6: Tuỳ chọn

blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it
8 sẽ không cài đặt các gói mới mà chỉ nâng cấp các gói đã cài đặt và vô hiệu hóa cài đặt mới của các gói.

sudo apt install   
9

👉 Ví dụ 7: Khi chúng ta muốn cài đặt một phiên bản cụ thể của các gói thì chúng ta chỉ cần sử dụng

blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it
9 để nối tên gói với phiên bản mong muốn.

sudo apt install  --no-upgrade
0

👉 Ví dụ 8: Để gỡ cài đặt gói khỏi hệ thống của bạn mà không xóa các tệp cấu hình của chúng (để sau này sử dụng lại cùng cấu hình). Chúng ta sử dụng lệnh

blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
2 như được hiển thị:

sudo apt install  --no-upgrade
1

👉 Ví dụ 9: Lệnh trên sẽ loại bỏ gói nhưng giữ các tệp cấu hình vì vậy nếu bạn muốn xóa cả gói và các tệp cấu hình được liên kết, bạn có thể chạy lệnh này:

sudo apt install  --no-upgrade
2

👉 Ví dụ 10: Ngoài ra, bạn có thể kết hợp cả hai lệnh với nhau như hiển thị bên dưới.

sudo apt install  --no-upgrade
3

👉 Ví dụ 11: Để có thể dọn sạch không gian đĩa chúng ta sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
1 bằng cách làm sạch (download) .deb files (gói) từ kho lưu trữ.

sudo apt install  --no-upgrade
4

👉 Ví dụ 12: Khi chúng ta cần tải mã nguồn gói xuống với nguồn

sudo apt install =
5 trước hết chúng ta cần phải kích hoạt
blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
3 như bên dưới:

sudo apt install  --no-upgrade
5

Tiếp theo chúng ta cần cài đặt gói

blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
4 cho lệnh
blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
5.

sudo apt install  --no-upgrade
6

👉 Ví dụ 13: Để tải chỉ mã nguồn của gói đặc biệt sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
6 với
blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
7 như sau:

sudo apt install  --no-upgrade
7

👉 Ví dụ 14: Chúng ta có thể tải xuống và giải nén mã nguồn của gói vào một thư mục cụ thể, bằng lệnh bên dưới:

sudo apt install  --no-upgrade
8

👉 Ví dụ 15: Để có thể tải xuống, giải nén và biên dịch mã nguồn cùng một lúc, sử dụng tùy chọn

blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
8 như hiển thị bên dưới:

sudo apt install  --no-upgrade
9

👉 Ví dụ 16: Cách để kiểm tra nhật ký thay đổi của gói bạn hãy sử dụng tuỳ chọn

blogd@ubuntuserver:~$ sudo apt check firefox
Reading package lists... Done
Building dependency tree
Reading state information... Done
blogd@ubuntuserver:~$ sudo apt check apache2
Reading package lists... Done
Building dependency tree
Reading state information... Done
9 tải một change-log gói và hiển thị phiên bản gói được cài đặt.

sudo apt install =
0

👉 Ví dụ 17: Tuỳ chọn

blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
0 là một công cụ chẩn đoán. Nó được sử dụng để cập nhật bộ đệm gói và kiểm tra các phụ thuộc bị hỏng.

sudo apt install =
1

👉 Ví dụ 18: Sử dụng tuỳ chọn

blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
1 giúp chúng ta có thể tìm kiếm các kho lưu trữ cục bộ trong hệ thống và cài đặt các phụ thuộc xây dựng cho gói. Nếu gói không tồn tại trong kho lưu trữ cục bộ, nó sẽ trả về mã lỗi.

sudo apt install =
2

👉 Ví dụ 19: Để có thể tự động dọn dẹp xóa tất cả các tệp

blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
2 khỏi
blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
3 giải phóng dung lượng không gian đĩa chúng ta sử dụng tùy chọn
blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
4 như sau:

sudo apt install =
3

👉 Ví dụ 20: Tuỳ chọn

blogd@ubuntuserver:~$ sudo apt update
Hit:1 http://vn.archive.ubuntu.com/ubuntu disco InRelease
Get:2 http://vn.archive.ubuntu.com/ubuntu disco-updates InRelease [97.5 kB]
Hit:3 http://vn.archive.ubuntu.com/ubuntu disco-backports InRelease
Get:4 http://vn.archive.ubuntu.com/ubuntu disco-security InRelease [97.5 kB]
Get:5 http://vn.archive.ubuntu.com/ubuntu disco-security/main Translation-en [36.4 kB]
Fetched 231 kB in 3s (69.5 kB/s)
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
5 giúp chúng ta tự động loại bỏ các gói đã được cài đặt để đáp ứng các phụ thuộc cho các gói khác và giờ chúng không còn cần thiết nữa.

sudo apt install =
47. Lời kết

Qua bài trên, giúp cho chúng ta biết cách sử dụng các tính năng của lệnh

sudo apt install =
5
blogd@ubuntuserver:~$ sudo apt show firefox
Package: firefox
Version: 67.0+build2-0ubuntu0.19.04.1
Priority: optional
Section: web
Origin: Ubuntu
Maintainer: Ubuntu Mozilla Team 
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 183 MB
Provides: gnome-www-browser, iceweasel, www-browser
Depends: lsb-release, libatk1.0-0 (>= 1.12.4), libc6 (>= 2.29), libcairo-gobject2 (>= 1.10.0), libcairo2 (>= 1.10.0), libdbus-1-3 (>= 1.9.14), libdbus-glib-1-2 (>= 0.78), libfontconfig1 (>= 2.12.6), libfreetype6 (>= 2.3.5), libgcc1 (>= 1:4.2), libgdk-pixbuf2.0-0 (>= 2.22.0), libglib2.0-0 (>= 2.31.8), libgtk-3-0 (>= 3.4), libpango-1.0-0 (>= 1.22.0), libpangocairo-1.0-0 (>= 1.14.0), libstartup-notification0 (>= 0.8), libstdc++6 (>= 6), libx11-6, libx11-xcb1, libxcb-shm0, libxcb1, libxcomposite1 (>= 1:0.3-1), libxdamage1 (>= 1:1.1), libxext6, libxfixes3, libxrender1, libxt6
Recommends: xul-ext-ubufox, libcanberra0, libdbusmenu-glib4, libdbusmenu-gtk3-4
Suggests: fonts-lyx
Replaces: kubuntu-firefox-installer
Task: ubuntu-desktop-minimal, ubuntu-desktop, kubuntu-desktop, kubuntu-full, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, ubuntu-mate-desktop, ubuntu-budgie-desktop
Xul-Appid: {ec8030f7-c20a-464f-9b0e-13a3a9e97384}
Supported: 9m
Download-Size: 48.5 MB
APT-Sources: http://vn.archive.ubuntu.com/ubuntu disco-updates/main amd64 Packages
Description: Safe and easy web browser from Mozilla
 Firefox delivers safe, easy web browsing. A familiar user interface,
 enhanced security features including protection from online identity theft,
 and integrated search let you get the most out of the web.

N: There is 1 additional record. Please use the '-a' switch to see it
1 và
blogd@ubuntuserver:~$  sudo apt search apache2
Sorting... Done
Full Text Search... Done
apache2/disco,now 2.4.38-2ubuntu2 amd64 [installed]
  Apache HTTP Server

apache2-bin/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (modules and other binary files)

apache2-data/disco,now 2.4.38-2ubuntu2 all [installed,automatic]
  Apache HTTP Server (common files)

apache2-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (development headers)

apache2-doc/disco 2.4.38-2ubuntu2 all
  Apache HTTP Server (on-site documentation)

apache2-ssl-dev/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server (mod_ssl development headers)

apache2-suexec-custom/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server configurable suexec program for mod_suexec

apache2-suexec-pristine/disco 2.4.38-2ubuntu2 amd64
  Apache HTTP Server standard suexec program for mod_suexec

apache2-utils/disco,now 2.4.38-2ubuntu2 amd64 [installed,automatic]
  Apache HTTP Server (utility programs for web servers)
...
6 trên hệ điều hành Linux ở các bản phân phối như Debian, Ubuntu. Từ các ví dụ trên giúp cho chúng ta có thể cập nhật hệ thống, cài đặt các gói,... từ đây chúng ta có thể thao tác với các gói trên hệ thống của chúng ta cách dễ dàng hơn.