Mengetahui riwayat aktivitas yum

Yum adalah program manajemen aplikasi yang ada pada distro Linux berbasis Red Hat, yang paling terkenal adalah CentOS dan Fedora. Untuk urusan instalasi paket aplikasi di Linux memang kita sangat dimudahkan, bahkan sering sekali saya cuma menjalankan perintah yum update dan sudah percaya akan berlangsung normal dan dalam servernya akan otomatis menggunakan versi terbaru yang ada dalam repository.

Nah… karena kemudahan ini kadang kita cuma yes yes saja tidak melihat apa yang sebenarnya ditambahkan, diganti atau dihapuskan dari sistem operasi. Kadang kita ingin tahu riwayat penggunaan yum kan?

Solusinya mudah kok, tinggal ketikkan perintah berikut untuk melihat sejarah aktivitas yum:

yum history

Maka akan muncul daftar riwayatnya dari sejak pertama kali hidup VPSnya:

Loaded plugins: fastestmirror
ID     | Login user               | Date and time    | Action(s)      | Altered
-------------------------------------------------------------------------------
    15 | root <root>              | 2016-02-02 17:03 | I, U           |    7 ##
    14 | root <root>              | 2016-01-12 16:45 | O, U           |   15 EE
    13 | root <root>              | 2016-01-06 20:32 | Install        |    1   
    12 | root <root>              | 2015-12-31 13:12 | Install        |    4   
    11 | root <root>              | 2015-12-31 13:02 | Update         |    2   
    10 | root <root>              | 2015-12-19 15:00 | Install        |    1   
     9 | root <root>              | 2015-12-19 14:58 | Update         |   11 EE
     8 | root <root>              | 2015-12-03 19:39 | O, U           |   10   
     7 | root <root>              | 2015-11-20 16:08 | Install        |    1  <
     6 | root <root>              | 2015-11-19 18:51 | Install        |    1 > 
     5 | root <root>              | 2015-11-19 18:12 | Install        |   10 EE
     4 | root <root>              | 2015-11-19 18:05 | Install        |   23   
     3 | root <root>              | 2015-11-19 18:02 | Install        |    5   
     2 | root <root>              | 2015-11-19 18:00 | Install        |    1  <
     1 | root <root>              | 2015-11-19 17:56 | I, U           |   73 >E
history list

Tapi kalau membaca hasil diatas maka kita cuma akan tahu user yang menjalankan, kapan terjadinya, aksi apa yang telah diterapkan, dan berapa paket aplikasi yang telah berubah. Bagaimana kalau kita ingin tahu detail prosesnya?

Tentu saja ada caranya. 🙂 Kali ini eksekusi saja perintah berikut:

yum history info

Akan muncul informasi proses yum terakhir yang telah dijalankan:

Loaded plugins: fastestmirror
Transaction ID : 15
Begin time     : Tue Feb  2 17:03:30 2016
Begin rpmdb    : 202:86dbe4f0e9976a4da95f25441695db8794293f4d
End time       :            17:03:37 2016 (7 seconds)
End rpmdb      : 205:f8774e498f75d92fbf013b6be2efa220f56f15b7
User           : root <root>
Return-Code    : Failure: 1
Command Line   : update
Transaction performed with:
    Installed     rpm-4.8.0-47.el6.i686                         @base
    Installed     yum-3.2.29-69.el6.centos.noarch               @base
    Installed     yum-metadata-parser-1.1.2-16.el6.i686         installed
    Installed     yum-plugin-fastestmirror-1.1.30-30.el6.noarch installed
Packages Altered:
 ** Updated     MariaDB-client-5.5.47-1.el6.i686  @mariadb
    Update                     10.1.11-1.el6.i686 @mariadb
 ** Updated     MariaDB-common-5.5.47-1.el6.i686  @mariadb
    Update                     10.1.11-1.el6.i686 @mariadb
 ** Updated     MariaDB-compat-5.5.47-1.el6.i686  @mariadb
    Update                     10.1.11-1.el6.i686 @mariadb
 ** Updated     MariaDB-server-5.5.47-1.el6.i686  @mariadb
Loading mirror speeds from cached hostfile
epel/metalink                                                          |  13 kB     00:00     
 * base: mirror.san.fastserv.com
 * epel: mirrors.kernel.org
 * extras: mirror.lax.hugeserver.com
 * updates: mirror.raystedman.net
base                                                                   | 3.7 kB     00:00     
epel                                                                   | 4.3 kB     00:00     
epel/primary_db                                                        | 4.9 MB     00:00     
extras                                                                 | 3.4 kB     00:00     
litespeed                                                              | 2.9 kB     00:00     
litespeed-update                                                       | 2.9 kB     00:00     
mariadb                                                                | 2.9 kB     00:00     
newrelic                                                               |  951 B     00:00     
updates                                                                | 3.4 kB     00:00     
vz-base                                                                |  951 B     00:00     
vz-updates                                                             |  951 B     00:00     
 ** Update                     10.1.11-1.el6.i686 @?mariadb
    Dep-Install galera-25.3.12-1.rhel6.el6.i686   @mariadb
    Dep-Install jemalloc-3.6.0-1.el6.i686         @epel
    Dep-Install rsync-3.0.6-12.el6.i686           @base
Scriptlet output:
   1 
   2 ******************************************************************
   3 A MySQL or MariaDB server package (MariaDB-server-5.5.47-1.el6.i686) is installed.
   4 
   5 Upgrading directly from MySQL 5.5 to MariaDB 10.1 may not
   6 be safe in all cases.  A manual dump and restore using mysqldump is
   7 recommended.  It is important to review the MariaDB manual's Upgrading
   8 section for version-specific incompatibilities.
   9 
  10 A manual upgrade is required.
  11 
  12 - Ensure that you have a complete, working backup of your data and my.cnf
  13   files
  14 - Shut down the MySQL server cleanly
  15 - Remove the existing MySQL packages.  Usually this command will
  16   list the packages you should remove:
  17   rpm -qa | grep -i '^mysql-'
  18 
  19   You may choose to use 'rpm --nodeps -ev <package-name>' to remove
  20   the package which contains the mysqlclient shared library.  The
  21   library will be reinstalled by the MariaDB-shared package.
  22 - Install the new MariaDB packages supplied by Monty Program AB
  23 - Ensure that the MariaDB server is started
  24 - Run the 'mysql_upgrade' program
  25 
  26 This is a brief description of the upgrade process.  Important details
  27 can be found in the MariaDB manual, in the Upgrading section.
  28 ******************************************************************
  29 error: %pre(MariaDB-server-10.1.11-1.el6.i686) scriptlet failed, exit status 1
  30 error:   install: %pre scriptlet failed (2), skipping MariaDB-server-10.1.11-1.el6
history info

Dan ternyata saya baru tahu kalau pada proses upgrade MariaDB dari 5.5 ke 10.1 saya tidak selancar yang saya kira. Mungkin anda bertanya selanjutnya bagaimana kita tahu catatan (log) yum yang lebih lama lagi? Nah… informasi daftar aktivitas yum bisa anda perhatikan akan ada angka – angka urutannya di samping kiri, ini bisa dimanfaatkan. Contoh saya ingin melihat yang nomor 8, maka jalankan:

yum history info 8

Maka riwayat yum pada urutan kedelapan akan muncul, tampilannya masih mirip – mirip kok dengan yang diatas.

Semoga bermnafaat. 🙂

Tinggalkan Balasan

Alamat email Anda tidak akan dipublikasikan. Ruas yang wajib ditandai *