Lompat ke konten Lompat ke sidebar Lompat ke footer

DNF Paket Manager Centos 8

DNF Paket Manager Centos 8

Pada tutorial kali ini saya akan menjelaskan bagaimana cara menggunakan perintah DNF paket manager. DNF atau Dandified yum adalah generasi terbaru dari system pemaketan YUM yang dapat digunakan untuk menginstall, memperbarui, menghapus paket pada distribusi Linux berbasia RPM.

Meskipun pada system Centos 8 terbaru menggunakan system pemaketan DNF namun perintah YUM Masih dapat digunakan pada system Centos 8.

Management paket pada linux adalah kumpulan perangkat untuk mengotomatisasi proses instalasi, upgrade (perbaikan), konfigurasi, atau menghapus paket perangkat lunak dari sebuah komputer menggunakan cara tertentu.

Pada versi centos sebelumnya mungkin anda sudah famiar menggunakan YUM, YUM atau Yellowdog Updater merupakan salah satu manajemen paket open-source berbasis konsol/perintah teks pada sistem operasi Linux yang menggunakan RPM Package Manager. Namun di versi CentOS 8 ini paket manajer default untuk Centos diganti menggunakan DNF. 

Pada tutorial kali ini kita akan belajar bagaimana cara menggunakan DNF paket manager di Centos 8 Server. Oke Langsung saja ikuti step by step cara menggunakan perintah dnf paket managaer di Centos.

Perintah DNF Paket manager

Berikut beberapa perintah dasar dalam menggunakan DNF paket manager.

Menginstall Paket

Untuk cara menginstall paket jalankan perintah dnf install (nama paket) sebagai contoh dibawah ini menginstal paket nmap

[root@srv1 kris]# dnf install nmap
CentOS-8 - AppStream                            164 kB/s | 7.0 MB     00:43
CentOS-8 - Base                                 254 kB/s | 2.2 MB     00:08
CentOS-8 - Extras                               4.9 kB/s | 5.9 kB     00:01
Dependencies resolved.
================================================================================
 Package           Architecture   Version               Repository         Size
================================================================================
Installing:
 nmap              x86_64         2:7.70-5.el8          AppStream         5.8 M
Installing dependencies:
 nmap-ncat         x86_64         2:7.70-5.el8          AppStream         237 k

Transaction Summary
================================================================================
Install  2 Packages

Total download size: 6.1 M
Installed size: 25 M
Is this ok [y/N]: y

Mengupdate & Upgrade Paket

Untuk cara update system jalankan perintah dnf update
[root@srv1 kris]# dnf update
Last metadata expiration check: 0:15:00 ago on Thu 07 May 2020 11:07:10 AM WIB.
Dependencies resolved.
Nothing to do.
Complete!
Untuk cara update paket tertentu jalankan perintah dnf update (nama paket)
[root@srv1 kris]# dnf update nmap
Last metadata expiration check: 0:07:50 ago on Thu 07 May 2020 10:14:45 AM WIB.
Dependencies resolved.
Nothing to do.
Complete!
Untuk meng upgrade system jalankan perintah dnf upgrade
[root@srv1 kris]# dnf upgrade
Last metadata expiration check: 0:14:28 ago on Thu 07 May 2020 11:07:10 AM WIB.
Dependencies resolved.
Nothing to do.
Complete!

Menampilkan List Paket

Untuk menampilkan list paket, jalankan perintah dnf list (nama paket)
[root@srv1 kris]# dnf list nmap
Last metadata expiration check: 0:08:41 ago on Thu 07 May 2020 10:14:45 AM WIB.
Installed Packages
nmap.x86_64                       2:7.70-5.el8                        @AppStream

Baca Juga : Cara Install Centos 8 Minimal Server
Baca Juga : Cara Konfigurasi Network Interface di Centos 8 Server

Menampilkan Info Paket

Untuk menampilkan informasi dari sebuat paket, jalankan perintah dnf info (nama paket)
[root@srv1 kris]# dnf info nmap
Last metadata expiration check: 0:09:29 ago on Thu 07 May 2020 10:14:45 AM WIB.
Installed Packages
Name         : nmap
Epoch        : 2
Version      : 7.70
Release      : 5.el8
Architecture : x86_64
Size         : 24 M
Source       : nmap-7.70-5.el8.src.rpm
Repository   : @System
From repo    : AppStream
Summary      : Network exploration tool and security scanner
URL          : http://nmap.org/
License      : Nmap
Description  : Nmap is a utility for network exploration or security auditing.
             : It supports ping scanning (determine which hosts are up), many
             : port scanning techniques (determine what services the hosts are
             : offering), and TCP/IP fingerprinting (remote host operating
             : system identification). Nmap also offers flexible target and port
             : specification, decoy scanning, determination of TCP sequence
             : predictability characteristics, reverse-identd scanning, and
             : more. In addition to the classic command-line nmap executable,
             : the Nmap suite includes a flexible data transfer, redirection,
             : and debugging tool (netcat utility ncat), a utility for comparing
             : scan results (ndiff), and a packet generation and response
             : analysis tool (nping).

Menghapus/Remove Paket

Untuk menghapus atau me remove paket yang sudah kita install jalankan perintah dnf remove (nama paket)
[root@srv1 kris]# dnf remove nmap
Dependencies resolved.
================================================================================
 Package           Architecture   Version              Repository          Size
================================================================================
Removing:
 nmap              x86_64         2:7.70-5.el8         @AppStream          24 M
Removing unused dependencies:
 nmap-ncat         x86_64         2:7.70-5.el8         @AppStream         681 k

Transaction Summary
================================================================================
Remove  2 Packages

Freed space: 25 M
Is this ok [y/N]: y
Running transaction check
Transaction check succeeded.
Running transaction test
Transaction test succeeded.
Running transaction
  Preparing        :                                                        1/1
  Erasing          : nmap-2:7.70-5.el8.x86_64                               1/2
  Erasing          : nmap-ncat-2:7.70-5.el8.x86_64                          2/2
  Running scriptlet: nmap-ncat-2:7.70-5.el8.x86_64                          2/2
  Verifying        : nmap-2:7.70-5.el8.x86_64                               1/2
  Verifying        : nmap-ncat-2:7.70-5.el8.x86_64                          2/2

Removed:
  nmap-2:7.70-5.el8.x86_64             nmap-ncat-2:7.70-5.el8.x86_64

Complete!

Mencari paket berdasarkan jenis atau nama paket

Untuk mencari paket berdasarkan jenis nama paket jalankan perintah dnf search (nama paket)
[root@srv1 kris]# dnf search text\ editor
Last metadata expiration check: 0:11:22 ago on Thu 07 May 2020 10:14:45 AM WIB.
========================= Summary Matched: text editor =========================
nano.x86_64 : A small text editor
nano.x86_64 : A small text editor
emacs.x86_64 : GNU Emacs text editor
sed.x86_64 : A GNU stream text editor
sed.x86_64 : A GNU stream text editor
gedit.x86_64 : Text editor for the GNOME desktop
emacs-nox.x86_64 : GNU Emacs text editor without X support
emacs-lucid.x86_64 : GNU Emacs text editor with LUCID toolkit X support

Menampilkan List semua paket yang telah terinstall

Untuk menampilkan list paket yang sudah terinstall jalankan perintah berikut
[root@srv1 kris]# dnf list installed | less
Installed Packages
NetworkManager.x86_64                1:1.20.0-5.el8_1                 @anaconda
NetworkManager-libnm.x86_64          1:1.20.0-5.el8_1                 @anaconda
NetworkManager-team.x86_64           1:1.20.0-5.el8_1                 @anaconda
NetworkManager-tui.x86_64            1:1.20.0-5.el8_1                 @anaconda
acl.x86_64                           2.2.53-1.el8                     @anaconda
adcli.x86_64                         0.8.2-3.el8                      @anaconda
at.x86_64                            3.1.20-11.el8                    @anaconda
attr.x86_64                          2.4.48-3.el8                     @anaconda
audit.x86_64                         3.0-0.13.20190507gitf58ec40.el8  @anaconda
audit-libs.x86_64                    3.0-0.13.20190507gitf58ec40.el8  @anaconda
authselect.x86_64                    1.1-2.el8                        @anaconda
authselect-libs.x86_64               1.1-2.el8                        @anaconda
avahi-libs.x86_64                    0.7-19.el8                       @anaconda
basesystem.noarch                    11-5.el8                         @anaconda
bash.x86_64                          4.4.19-10.el8                    @anaconda
bash-completion.noarch               1:2.7-5.el8                      @anaconda
bc.x86_64                            1.07.1-5.el8                     @anaconda
bind.x86_64                          32:9.11.4-26.P2.el8              @AppStream
bind-export-libs.x86_64              32:9.11.4-26.P2.el8              @anaconda
bind-libs.x86_64                     32:9.11.4-26.P2.el8              @AppStream
bind-libs-lite.x86_64                32:9.11.4-26.P2.el8              @AppStream
bind-license.noarch                  32:9.11.4-26.P2.el8              @AppStream
:

Menampilkan List semua paket group yang tersedia

Untuk menampilkan list semua paket group jalankan perintah dnf grouplist
[root@srv1 kris]# dnf grouplist
Last metadata expiration check: 0:13:48 ago on Thu 07 May 2020 10:14:45 AM WIB.
Available Environment Groups:
   Server with GUI
   Server
   Workstation
   Virtualization Host
   Custom Operating System
Installed Environment Groups:
   Minimal Install
Available Groups:
   Container Management
   .NET Core Development
   RPM Development Tools
   Development Tools
   Graphical Administration Tools
   Headless Management
   Legacy UNIX Compatibility
   Network Servers
   Scientific Support
   Security Tools
   Smart Card Support
   System Tools

Menginstall group paket

Untuk menginstall paket group jalankan perintah dnf groupinstall (nama group)
[root@srv1 kris]# dnf groupinstall Server
Last metadata expiration check: 0:20:34 ago on Thu 07 May 2020 10:14:45 AM WIB.
no group 'dns-server' from environment 'server-product-environment'
No match for group package "insights-client"
No match for group package "centos-release-eula"
Dependencies resolved.
================================================================================
 Package                      Arch   Version                    Repo       Size
================================================================================
Installing group/module packages:
 PackageKit                   x86_64 1.1.12-3.el8               AppStream 601 k
 buildah                      x86_64 1.11.6-6.module_el8.1.0+298+41f9343a
                                                                AppStream 8.5 M
 cockpit-packagekit           noarch 197.3-1.el8                AppStream 334 k
 cockpit-podman               noarch 11-1.module_el8.1.0+298+41f9343a
                                                                AppStream 1.0 M
 cockpit-storaged             noarch 197.3-1.el8                AppStream 383 k
 containernetworking-plugins  x86_64 0.8.3-4.module_el8.1.0+298+41f9343a
                                                                AppStream  20 M
 dnf-plugin-spacewalk         noarch 2.8.5-11.module_el8.1.0+211+ad6c0bc7
                                                                AppStream  24 k
 fprintd-pam                  x86_64 0.8.1-2.el8                AppStream  22 k Installing Groups:
 Container Management
 Core
 Hardware Support
 Headless Management
 Server product core
 Standard

Transaction Summary
================================================================================
Install  116 Packages

Total download size: 64 M
Installed size: 248 M
Is this ok [y/N]: y

Memperbarui paket group

Untuk memperbaharui paket group jalankan perintah dnf groupupdate (nama group)
[root@srv1 kris]# dnf groupupdate Server
Last metadata expiration check: 0:24:12 ago on Thu 07 May 2020 10:14:45 AM WIB.
no group 'dns-server' from environment 'server-product-environment'
No match for group package "insights-client"
No match for group package "centos-release-eula"
Dependencies resolved.
================================================================================
 Package                      Arch   Version                    Repo       Size
================================================================================
Installing group/module packages:
 PackageKit                   x86_64 1.1.12-3.el8               AppStream 601 k
 buildah                      x86_64 1.11.6-6.module_el8.1.0+298+41f9343a
                                                                AppStream 8.5 M

Menampilkan Daftar Repository

Untuk menampilkan daftar repository jalankan perintah dnf repolist
[root@srv1 kris]# dnf repolist
Last metadata expiration check: 0:05:36 ago on Thu 07 May 2020 11:07:10 AM WIB.
repo id                        repo name                                  status
AppStream                      CentOS-8 - AppStream                       5,318
BaseOS                         CentOS-8 - Base                            1,661
extras                         CentOS-8 - Extras                             16

Menampilkan semua repository yang sedang digunakan

Untuk menampilkan semua repositori yang digunakan jalankan perintah dnf repolist all
[root@srv1 kris]# dnf repolist all
Last metadata expiration check: 0:06:14 ago on Thu 07 May 2020 11:07:10 AM WIB.
repo id            repo name                                      status
AppStream          CentOS-8 - AppStream                           enabled: 5,318
AppStream-source   CentOS-8 - AppStream Sources                   disabled
BaseOS             CentOS-8 - Base                                enabled: 1,661
BaseOS-source      CentOS-8 - BaseOS Sources                      disabled
Devel              CentOS-8 - Devel WARNING! FOR BUILDROOT USE ON disabled
HighAvailability   CentOS-8 - HA                                  disabled
PowerTools         CentOS-8 - PowerTools                          disabled
base-debuginfo     CentOS-8 - Debuginfo                           disabled
c8-media-AppStream CentOS-AppStream-8 - Media                     disabled
c8-media-BaseOS    CentOS-BaseOS-8 - Media                        disabled
centosplus         CentOS-8 - Plus                                disabled
centosplus-source  CentOS-8 - Plus Sources                        disabled
cr                 CentOS-8 - cr                                  disabled
extras             CentOS-8 - Extras                              enabled:    16
extras-source      CentOS-8 - Extras Sources                      disabled
fasttrack          CentOS-8 - fasttrack                           disabled

Reinstall paket

Untuk reinstall paket jalankan perintah dnf reinstall (nama paket)
[root@srv1 kris]# dnf reinstall nano
Last metadata expiration check: 0:10:08 ago on Thu 07 May 2020 11:07:10 AM WIB.
Dependencies resolved.
================================================================================
 Package        Architecture     Version                 Repository        Size
================================================================================
Reinstalling:
 nano           x86_64           2.9.8-1.el8             BaseOS           581 k

Transaction Summary
================================================================================

Total download size: 581 k
Installed size: 2.2 M
Is this ok [y/N]:

Menampilkan history 

Untuk menampilkan histori yang telah di lakukan jalankan perintah dnf history
[root@srv1 kris]# dnf history
ID     | Command line             | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
     7 | remove nmap              | 2020-05-07 10:25 | Removed        |    2
     6 | install nmap             | 2020-05-07 10:16 | Install        |    2
     5 | remove nmap              | 2020-05-07 09:56 | Removed        |    2
     4 | install nmap             | 2020-05-07 09:50 | Install        |    2
     3 | install -y bind bind-uti | 2020-05-05 10:03 | Install        |    7
     2 | install vim-enhanced     | 2020-05-02 00:52 | Install        |    4
     1 |                          | 2020-05-02 00:23 | Install        |  442 EE

Demikian kira-kira tutorial DNF Paket Manager Centos 8 ini saya buat. Semoga bermafaat untuk kita semua. Silahkan Share Jika sobat merasa postingan ini bermanfaat. Sekian & Terimakasih Salam.


Artikel Selanjutnya : Cara Menggunakan Text editor di Linux