Yum Remove

CentOS & RedHat Linux menggunakan yum sebagai perintah untuk mengatur instalasi paket (package management tool). Saya baru tahu dari Wikipedia kalau yum itu sendiri adalah singkatan dari “Yellowdog Updater, Modified”. Sintaks pemakaiannya mirip dengan apt-get-nya Debian/Ubuntu Linux. Misalnya untuk menginstal paket dari repositori, saya bisa menggunakan perintah yum install, Misalnya saya ingin memasang paket Apache web server (httpd) :

[root@web01 ~]# yum install httpd
Loaded plugins: fastestmirror
Determining fastest mirrors
CDROM                                                                                                                                        | 4.0 kB     00:00 ... 
CDROM/primary_db                                                                                                                             | 4.4 MB     00:00 ... 
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be installed
--> Processing Dependency: httpd-tools = 2.2.15-29.el6.centos for package: httpd-2.2.15-29.el6.centos.x86_64
--> Processing Dependency: apr-util-ldap for package: httpd-2.2.15-29.el6.centos.x86_64
--> Processing Dependency: /etc/mime.types for package: httpd-2.2.15-29.el6.centos.x86_64
--> Processing Dependency: libaprutil-1.so.0()(64bit) for package: httpd-2.2.15-29.el6.centos.x86_64
--> Processing Dependency: libapr-1.so.0()(64bit) for package: httpd-2.2.15-29.el6.centos.x86_64
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be installed
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be installed
---> Package httpd-tools.x86_64 0:2.2.15-29.el6.centos will be installed
---> Package mailcap.noarch 0:2.1.31-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

====================================================================================================================================================================
 Package                                  Arch                              Version                                          Repository                        Size
====================================================================================================================================================================
Installing:
 httpd                                    x86_64                            2.2.15-29.el6.centos                             CDROM                            821 k
Installing for dependencies:
 apr                                      x86_64                            1.3.9-5.el6_2                                    CDROM                            123 k
 apr-util                                 x86_64                            1.3.9-3.el6_0.1                                  CDROM                             87 k
 apr-util-ldap                            x86_64                            1.3.9-3.el6_0.1                                  CDROM                             15 k
 httpd-tools                              x86_64                            2.2.15-29.el6.centos                             CDROM                             73 k
 mailcap                                  noarch                            2.1.31-2.el6                                     CDROM                             27 k

Transaction Summary
====================================================================================================================================================================
Install       6 Package(s)

Total download size: 1.1 M
Installed size: 3.6 M
Is this ok [y/N]: y
Downloading Packages:
--------------------------------------------------------------------------------------------------------------------------------------------------------------------
Total                                                                                                                                27 MB/s | 1.1 MB     00:00     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : apr-1.3.9-5.el6_2.x86_64                                                                                                                         1/6 
  Installing : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                                  2/6 
  Installing : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                                                                             3/6 
  Installing : httpd-tools-2.2.15-29.el6.centos.x86_64                                                                                                          4/6 
  Installing : mailcap-2.1.31-2.el6.noarch                                                                                                                      5/6 
  Installing : httpd-2.2.15-29.el6.centos.x86_64                                                                                                                6/6 
  Verifying  : httpd-2.2.15-29.el6.centos.x86_64                                                                                                                1/6 
  Verifying  : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                                                                             2/6 
  Verifying  : httpd-tools-2.2.15-29.el6.centos.x86_64                                                                                                          3/6 
  Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                                                                         4/6 
  Verifying  : mailcap-2.1.31-2.el6.noarch                                                                                                                      5/6 
  Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                                  6/6 

Installed:
  httpd.x86_64 0:2.2.15-29.el6.centos                                                                                                                               

Dependency Installed:
  apr.x86_64 0:1.3.9-5.el6_2        apr-util.x86_64 0:1.3.9-3.el6_0.1     apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1     httpd-tools.x86_64 0:2.2.15-29.el6.centos    
  mailcap.noarch 0:2.1.31-2.el6    

Complete!
[root@web01 ~]#

Dari contoh di atas, terlihat bahwa yum tidak hanya memasang paket httpd, yum juga memasang beberapa paket lain yang diperlukan oleh httpd (dependencies packages). Dalam contoh tadi ada 5 paket tambahan yang ikut terpasang secara otomatis.

Nah lucunya saat saya ingin membuang paket httpd, paket-paket lain tadi tidak ikut terbuang. Misalnya dengan yum remove berikut ini :

[root@web01 ~]# yum install httpd
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
CDROM                                                                                                                                                                                                                  | 4.0 kB     00:00 ... 
Setting up Install Process
Package httpd-2.2.15-29.el6.centos.x86_64 already installed and latest version
Nothing to do
[root@web01 ~]# vi /etc/yum.conf 
[root@web01 ~]# yum remove httpd
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be erased
--> Finished Dependency Resolution
CDROM                                                                                                                                                                                                                  | 4.0 kB     00:00 ... 

Dependencies Resolved

==============================================================================================================================================================================================================================================
 Package                                              Arch                                                  Version                                                               Repository                                             Size
==============================================================================================================================================================================================================================================
Removing:
 httpd                                                x86_64                                                2.2.15-29.el6.centos                                                  @CDROM                                                2.9 M

Transaction Summary
==============================================================================================================================================================================================================================================
Remove        1 Package(s)

Installed size: 2.9 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : httpd-2.2.15-29.el6.centos.x86_64                                                                                                                                                                                          1/1 
  Verifying  : httpd-2.2.15-29.el6.centos.x86_64                                                                                                                                                                                          1/1 

Removed:
  httpd.x86_64 0:2.2.15-29.el6.centos                                                                                                                                                                                                         

Complete!
[root@web01 ~]#

yum hanya membuang paket httpd saja. Ada 5 paket lain yang tadi ikut terinstal tidak terbuang juga.

[root@web01 ~]# rpm -qa | egrep "apr|httpd|mailcap"
apr-util-1.3.9-3.el6_0.1.x86_64
httpd-tools-2.2.15-29.el6.centos.x86_64
apr-1.3.9-5.el6_2.x86_64
apr-util-ldap-1.3.9-3.el6_0.1.x86_64
mailcap-2.1.31-2.el6.noarch
[root@web01 ~]#

Di Debian, ada opsi untuk menggunakan apt-get autoremove untuk menghapus sisa paket dependensi yang sudah tidak dipakai. Saya juga baru tahu ternyata ada opsi untuk mengatur yum supaya menghapus semua paket dependensinya. Opsi ini perlu diaktifkan dulu di dalam berkas /etc/yum.conf seperti ini :

[root@web01 ~]# echo "clean_requirements_on_remove=1" >> /etc/yum.conf

Opsi clean_requirements_on_remove akan membuat yum membersihkan setiap paket dependensinya. Setelah penambahan opsi tersebut, contohnya seperti berikut ini :

[root@web01 ~]# yum remove httpd
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package httpd.x86_64 0:2.2.15-29.el6.centos will be erased
--> Finished Dependency Resolution
--> Finding unneeded leftover dependencies
---> Marking httpd-tools to be removed - no longer needed by httpd
---> Marking apr-util-ldap to be removed - no longer needed by httpd
---> Marking mailcap to be removed - no longer needed by httpd
---> Marking apr-util to be removed - no longer needed by httpd-tools
---> Marking apr to be removed - no longer needed by httpd-tools
Found and removing 5 unneeded dependencies
--> Running transaction check
---> Package apr.x86_64 0:1.3.9-5.el6_2 will be erased
---> Package apr-util.x86_64 0:1.3.9-3.el6_0.1 will be erased
---> Package apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1 will be erased
---> Package httpd-tools.x86_64 0:2.2.15-29.el6.centos will be erased
---> Package mailcap.noarch 0:2.1.31-2.el6 will be erased
--> Finished Dependency Resolution
CDROM                                                                                                                                                                                                                  | 4.0 kB     00:00 ... 

Dependencies Resolved

==============================================================================================================================================================================================================================================
 Package                                                    Arch                                                Version                                                             Repository                                           Size
==============================================================================================================================================================================================================================================
Removing:
 httpd                                                      x86_64                                              2.2.15-29.el6.centos                                                @CDROM                                              2.9 M
Removing for dependencies:
 apr                                                        x86_64                                              1.3.9-5.el6_2                                                       @CDROM                                              296 k
 apr-util                                                   x86_64                                              1.3.9-3.el6_0.1                                                     @CDROM                                              198 k
 apr-util-ldap                                              x86_64                                              1.3.9-3.el6_0.1                                                     @CDROM                                              9.3 k
 httpd-tools                                                x86_64                                              2.2.15-29.el6.centos                                                @CDROM                                              137 k
 mailcap                                                    noarch                                              2.1.31-2.el6                                                        @CDROM                                               52 k

Transaction Summary
==============================================================================================================================================================================================================================================
Remove        6 Package(s)

Installed size: 3.6 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Erasing    : httpd-2.2.15-29.el6.centos.x86_64                                                                                                                                                                                          1/6 
  Erasing    : httpd-tools-2.2.15-29.el6.centos.x86_64                                                                                                                                                                                    2/6 
  Erasing    : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                                                                                                                                                       3/6 
  Erasing    : mailcap-2.1.31-2.el6.noarch                                                                                                                                                                                                4/6 
  Erasing    : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                                                                                                            5/6 
  Erasing    : apr-1.3.9-5.el6_2.x86_64                                                                                                                                                                                                   6/6 
  Verifying  : httpd-2.2.15-29.el6.centos.x86_64                                                                                                                                                                                          1/6 
  Verifying  : apr-util-ldap-1.3.9-3.el6_0.1.x86_64                                                                                                                                                                                       2/6 
  Verifying  : httpd-tools-2.2.15-29.el6.centos.x86_64                                                                                                                                                                                    3/6 
  Verifying  : apr-1.3.9-5.el6_2.x86_64                                                                                                                                                                                                   4/6 
  Verifying  : mailcap-2.1.31-2.el6.noarch                                                                                                                                                                                                5/6 
  Verifying  : apr-util-1.3.9-3.el6_0.1.x86_64                                                                                                                                                                                            6/6 

Removed:
  httpd.x86_64 0:2.2.15-29.el6.centos                                                                                                                                                                                                         

Dependency Removed:
  apr.x86_64 0:1.3.9-5.el6_2              apr-util.x86_64 0:1.3.9-3.el6_0.1              apr-util-ldap.x86_64 0:1.3.9-3.el6_0.1              httpd-tools.x86_64 0:2.2.15-29.el6.centos              mailcap.noarch 0:2.1.31-2.el6             

Complete!
[root@web01 ~]#

Dengan begitu sekarang tidak ada lagi paket dependensi yang tertinggal :

[root@web01 ~]# rpm -qa | egrep "apr|httpd|mailcap"
[root@web01 ~]#

Repositori Lokal DVD RHEL

Tiap kali menggunakan Ubuntu atau Debian, saya selalu menggunakan repositori online saat perlu memasang paket/aplikasi tertentu (software). Perintah apt-get atau aptitude akan otomatis mengunduh instaler paket dari repositori di Internet. Memang perlu koneksi internet tiap kali akan memasang paket. Dulu saat saya masih kesulitan mendapat akses internet, saya mengoleksi banyak CD/DVD repositori Ubuntu. Kalau tidak salah ingat dulu Ubuntu 7.04 punya 5 atau 6 CD repositori. Debian lebih fantastis lagi, jumlah CD repositorinya sampai puluhan. DVD Debian terbaru versi 7.4.0 jumlahnya sampai 9 buah. Sangat tidak praktis mengoleksi semua DVD repositori tadi. Menggunakan media CD/DVD tentu rentan hilang, rusak tidak bisa terbaca, dan repot karena harus menggonta-ganti CD/DVD saat memasang paket tertentu. Memang masih bisa diakali dengan menyimpan ISO image dari CD/DVD tadi, tapi ini juga tidak praktis karena membutuhkan ruang yang cukup besar dalam harddisk.

Dulu saya pernah tulis cara menjadikan DVD Ubuntu Linux sebagai sumber repositori lokal. Tadi saya kembali ingat hal ini saat menginstal Red Hat Linux. Tidak seperti Debian atau Ubuntu, Red Hat Enterprise Linux (RHEL) menyediakan online repositori hanya bagi pengguna yang membeli lisensinya. Namun demikian saya masih tetap bisa menggunakan DVD instalasi sebagai repositori lokal. Saya tidak tahu persisnya, aplikasi apa yang tidak tersedia dalam DVD & hanya bisa didapat dari online repositori resminya RHEL.

Tulisan ini akan jadi catatan saya untuk menjadikan DVD instalasi RHEL 6.4 sebagai repositori lokal.

Tadi saya menginstal virtual mesin dengan hostname redhat6, mesin ini menggunakan RHEL 6.4

[root@redhat6 ~]# uname -a
Linux redhat6 2.6.32-358.el6.x86_64 #1 SMP Tue Jan 29 11:47:41 EST 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@redhat6 ~]# 
[root@redhat6 ~]# cat /etc/redhat-release 
Red Hat Enterprise Linux Server release 6.4 (Santiago)
[root@redhat6 ~]#

Tanpa repositori lokal saya tidak bisa memasang paket nmap. Saat mencoba mencari paket nmap saya mendapati error seperti ini :

[root@redhat6 yum.repos.d]# yum search nmap
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Warning: No matches found for: nmap
No Matches found
[root@redhat6 yum.repos.d]#

RHEL menempatkan konfigurasi repositori dalam direktori /etc/yum.repos.d :

[root@redhat6 ~]# cd /etc/yum.repos.d/
[root@redhat6 yum.repos.d]# ls
rhel-source.repo
[root@redhat6 yum.repos.d]#

Ada 1 berkas konfigurasi bawaan proses instalasi OS seperti berikut ini :

[root@redhat6 yum.repos.d]# cat rhel-source.repo 
[rhel-source]
name=Red Hat Enterprise Linux $releasever - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/enterprise/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release

[rhel-source-beta]
name=Red Hat Enterprise Linux $releasever Beta - $basearch - Source
baseurl=ftp://ftp.redhat.com/pub/redhat/linux/beta/$releasever/en/os/SRPMS/
enabled=0
gpgcheck=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-beta,file:///etc/pki/rpm-gpg/RPM-GPG-KEY-redhat-release
[root@redhat6 yum.repos.d]#

Karena saya ingin menjadikan DVD instalasi RHEL sebagai repositori lokal, tentu langkah pertama adalah mengakses DVDnya terlebih dulu. Saya mount DVD RHEL 6.4 ke direktori /mnt:

[root@redhat6 yum.repos.d]# mount -o loop /dev/cdrom /mnt
[root@redhat6 yum.repos.d]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_redhat6-lv_root
                      5.5G  931M  4.3G  18% /
tmpfs                 499M     0  499M   0% /dev/shm
/dev/sda1             485M   33M  427M   8% /boot
/dev/sr0              3.5G  3.5G     0 100% /mnt
[root@redhat6 yum.repos.d]#

Langkah selanjutnya saya buat berkas konfigurasi baru, saya pilih nama iso-rhel6.repo. Tiap berkas konfigurasi repositori boleh menggunakan nama apa saja asalkan diakhiri dengan *.repo.

[root@redhat6 yum.repos.d]# vi iso-rhel6.repo 
[ISO_RHEL64]
name=ISO RHEL64_x86_64
baseurl=file:///mnt
enabled=1 
gpgcheck=0
[root@redhat6 yum.repos.d]#

Isi berkasnya paling tidak harus terdiri dari id, name & baseurl. ID dituliskan dalam tanda kurung kotak [ISO_RHEL64]. Sejauh yang saya tahu tidak ada aturan khusus untuk memilih ID repo tadi. Pada contoh di atas, baseurl saya arahkan untuk mengakses direktori /mnt (mountpoint DVD). Selanjutnya saya tinggal jalankan 2 perintah seperti berikut ini :

[root@redhat6 yum.repos.d]# yum clean all
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Cleaning repos: ISO_RHEL64
Cleaning up Everything
[root@redhat6 yum.repos.d]# yum repolist
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
ISO_RHEL64                                                                                                                                                | 3.9 kB     00:00 ... 
ISO_RHEL64/primary_db                                                                                                                                     | 3.1 MB     00:00 ... 
repo id                                                                           repo name                                                                                status
ISO_RHEL64                                                                        ISO RHEL64_x86_64                                                                        3,648
repolist: 3,648
[root@redhat6 yum.repos.d]#

Setelah sistem selesai membuat repositori lokal, saya bisa memeriksanya dengan perintah yum repolist seperti contoh berikut ini :

[root@redhat6 yum.repos.d]# yum repolist
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
repo id                                                                           repo name                                                                                status
ISO_RHEL64                                                                        ISO RHEL64_x86_64                                                                        3,648
repolist: 3,648
[root@redhat6 yum.repos.d]#

Artinya sekarang sistem sudah punya repositori lokal dengan nama “ISO RHEL64_x86_64”. Untungnya paket nmap tersedia dalam DVD ini :

[root@redhat6 yum.repos.d]# yum search nmap
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
=============================================================================== N/S Matched: nmap ===============================================================================
nmap.x86_64 : Network exploration tool and security scanner

  Name and summary matches only, use "search all" for everything.
[root@redhat6 yum.repos.d]#

Dengan begitu saya tinggal menggunakan perintah yum install untuk memasang nmap, yum akan mengambil berkas sumber nmap dari DVD bukan dari Internet :

[root@redhat6 yum.repos.d]# yum install nmap
Loaded plugins: product-id, security, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package nmap.x86_64 2:5.51-2.el6 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

=================================================================================================================================================================================
 Package                               Arch                                    Version                                         Repository                                   Size
=================================================================================================================================================================================
Installing:
 nmap                                  x86_64                                  2:5.51-2.el6                                    ISO_RHEL64                                  2.8 M

Transaction Summary
=================================================================================================================================================================================
Install       1 Package(s)

Total download size: 2.8 M
Installed size: 9.7 M
Is this ok [y/N]: y
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : 2:nmap-5.51-2.el6.x86_64                                                                                                                                      1/1 
ISO_RHEL64/productid                                                                                                                                      | 1.7 kB     00:00 ... 
  Verifying  : 2:nmap-5.51-2.el6.x86_64                                                                                                                                      1/1 

Installed:
  nmap.x86_64 2:5.51-2.el6                                                                                                                                                       

Complete!
[root@redhat6 yum.repos.d]#

CentOS sebagai salah satu varian open source Red Hat, langsung menyediakan repositori online sejak awal instalasi. Pada contoh di bawah ini terlihat CentOS langsung mendeteksi lokasi repositori online yang paling cepat diakses :

[root@centos ~]# uname -a
Linux centos 2.6.32-358.el6.x86_64 #1 SMP Fri Feb 22 00:31:26 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
[root@centos ~]# 
[root@centos ~]# cat /etc/redhat-release 
CentOS release 6.4 (Final)
[root@centos ~]# 
[root@centos ~]# yum repolist
Loaded plugins: fastestmirror, security
Determining fastest mirrors
 * base: mirror.axarva.co.id
 * extras: mirror.axarva.co.id
 * updates: mirror.axarva.co.id
base                                                                                                                                                      | 3.7 kB     00:00     
base/primary_db                                                                                                                                           | 4.4 MB     00:10     
extras                                                                                                                                                    | 3.4 kB     00:00     
extras/primary_db                                                                                                                                         |  19 kB     00:00     
updates                                                                                                                                                   | 3.4 kB     00:00     
updates/primary_db                                                                                                                                        | 2.5 MB     00:03     
repo id                                                                         repo name                                                                                  status
base                                                                            CentOS-6 - Base                                                                            6,367
extras                                                                          CentOS-6 - Extras                                                                             14
updates                                                                         CentOS-6 - Updates                                                                           718
repolist: 7,099
[root@centos ~]# 
[root@centos ~]# yum search nmap
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.axarva.co.id
 * extras: mirror.axarva.co.id
 * updates: mirror.axarva.co.id
=============================================================================== N/S Matched: nmap ===============================================================================
nmap-frontend.noarch : The GTK+ front end for nmap
nmap.x86_64 : Network exploration tool and security scanner

  Name and summary matches only, use "search all" for everything.
[root@centos ~]#

Saya juga bisa pakai cara yang sama untuk menjadikan DVD instalasi CentOS sebagai repositori lokal. Untuk testing, saya pindahkan dulu konfigurasi repositorinya CentOS ke dalam folder backup :

[root@centos ~]# mkdir /etc/yum.repos.d/backup
[root@centos ~]# mv /etc/yum.repos.d/*repo /etc/yum.repos.d/backup
[root@centos ~]#

Selanjutnya sama persis seperti sudah ditulis di atas :

[root@centos ~]# mount -o loop /dev/cdrom /mnt
    [root@centos ~]# df -h
Filesystem            Size  Used Avail Use% Mounted on
/dev/mapper/vg_centos-lv_root
                      3.6G  844M  2.6G  25% /
tmpfs                 939M     0  939M   0% /dev/shm
/dev/sda1             485M   37M  423M   8% /boot
/dev/sr0              4.1G  4.1G     0 100% /mnt
[root@centos ~]# 
[root@centos ~]# vi /etc/yum.repos.d/iso-centos64.repo
[ISO_CentOS64]
name=ISO CentOS64_x86_64
baseurl=file:///mnt
gpgcheck=0
[root@centos ~]# 
[root@centos ~]# yum repolist
Loaded plugins: fastestmirror, security
Determining fastest mirrors
ISO_CentOS64                                                                                                                                              | 4.0 kB     00:00 ... 
ISO_CentOS64/primary_db                                                                                                                                   | 4.4 MB     00:00 ... 
repo id                                                                           repo name                                                                                status
ISO_CentOS64                                                                      ISO CentOS64_x86_64                                                                      6,381
repolist: 6,381
[root@centos ~]# 
[root@centos ~]# yum install -q  nmap

=================================================================================================================================================================================
 Package                               Arch                                    Version                                       Repository                                     Size
=================================================================================================================================================================================
Installing:
 nmap                                  x86_64                                  2:5.51-2.el6                                  ISO_CentOS64                                  2.7 M

Transaction Summary
=================================================================================================================================================================================
Install       1 Package(s)

Is this ok [y/N]: y
[root@centos ~]#

Menyiapkan USB Bootable Mac OSX Mavericks

Sejak Mac OSX 10.9.1, kita bisa mendapatkan media instalasinya secara gratis di Apple App Store. Kalau tidak salah ingat, pada versi sebelumnya (Mountain Lion) dijual dengan harga USD$20. Beberapa hari yang lalu saya ingin melakukan instalasi ulang Mac Mini saya, maka hal pertama yang saya lakukan adalah mengunduh media instalasi Mac OSX 10.9.1 terlebih dahulu. Mac OSX 10.9.1 menggunakan nama kode Mavericks.

Ukuran installer Mac OSX ini sekitar 5,2GB. Perlu waktu cukup lama untuk dapat men-download-nya. Saat saya memilih untuk men-download Mavericks dari App Store, media instalasi tersebut otomatis tersimpan dalam folder /Application dengan nama Install OS X Mavericks.app. Setelah proses download selesai, saya cepat-cepat memindahkan media instalasi tersebut ke harddisk eksternal. Selanjutnya saya perlu menyiapkan USB sebagai media boot. Kemarin saya pakai USB 16GB untuk media boot-nya.

Pertama saya perlu siapkan USB flashdisk-nya dengan menggunakan Disk Utility. Tampilannya seperti berikut ini :

Proses ini sebenarnya sama saja dengan proses Format yang kita jumpai di Windows. Langkah-langkah cukup sederhana, penjelasan gambar di atas kira-kira seperti berikut ini :

  1. Klik perangkat USB yang ingin dijadikan media boot pada kolom sebelah kiri.
  2. Klik menu Erase.
  3. Pilih Mac OS Extended (Journaled) sebagai format filesystem-nya.
  4. Beri nama USB ini, langkah ini sifatnya opsional. Bila tidak diberi nama, USB ini akan diberi label “UNTITLED”. Pada contoh ini, saya pilih nama “OSX_MAVERICK” (kurang huruf S, harusnya OSX_MAVERICKS 😉 ).
  5. Akhiri dengan mengklik tombol Erase.
  6. Setelah proses format tadi selesai, Mac akan otomatis memasang (mount) USB tersebut pada /Volume/[nama_volume]. Pada contoh saya ini, mountpoint-nya adalah /Volume/OSX_MAVERICK.

Setelah itu saya tinggal menyalin installer yang sudah saya unduh tadi. Mac menyediakan tool untuk menyiapkan USB sebagai boot media, tool tersebut bernama createinstallmedia. Tool tadi berada dalam media instalasi OSX Mavericks, tepatnya pada direktori :

Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia

Kita harus menggunakan Terminal untuk menggunakan tool ini. createinstallmedia harus dijalankan dengan hak akses root, atau dengan menggunakan sudo. Perintah lengkapnya seperti berikut ini :

Install\ OS\ X\ Mavericks.app/Contents/Resources/createinstallmedia --volume [mountpoint_usb] --applicationpath [location_installer]

Pada contoh ini, USB saya terletak pada /Volume/OSX_MAVERICK dan media instalasi saya simpan dalam /Volume/DATA/ sehingga perintahnya terlihat seperti berikut ini :

Karena nama installer Mavericks ini menggunakan spasi, maka kita perlu menggunakan tanda \ (backslash) untuk merepresentasikan spasi. Jangan lupa juga untuk mencantumkan lokasi lengkap tempat installer OSX Mavericks berada. Perlu waktu cukup lama (sekitar 20 menitan) untuk menyelesaikan proses ini. Setelah selesai, USB saya siap digunakan sebagai boot media.

Membaca Exif Foto Digital

Tiap foto digital (sebelum modifikasi) membawa informasi teknis tentang proses pembuatan fotonya. Informasi tersebut antara lain tanggal foto tersebut dibuat, tipe kamera yang digunakan, kecepatan rana (shutter speed, aperture, kepekaan sensor (ISO), focal length lensa yang dipakai, ukuran file, dsb. Banyak juga kamera yang sudah memiliki kemampuan untuk menambahkan informasi nama pemilik kamera, copyright, atau bahkan koordinat lokasi foto tersebut diabadikan. Informasi teknis inilah yang kadang disebut sebagai metadata foto. Ada juga yang menyebutnya sebagai Exif Data.

Windows & Mac OSX sudah dilengkapi dengan fitur untuk membaca Exif data foto digital. Untuk menampilkan data Exif di Windows caranya sangat mudah, pada Windows Explorer cukup klik kanan pada foto yang ingin dilihat lalu klik Properties. Misalnya seperti pada contoh di bawah ini :

Contoh di atas diambil dari Windows 7, pada jendela Properties klik pada tab Details untuk melihat data Exif foto tersebut :

Sementara di Mac OSX Finder, caranya dengan klik kanan pada fotonya lalu klik Get Info. Caranya tadi bisa juga diganti dengan kombinasi tombol ⌘i .

Mac akan menampilkan jendela baru seperti tampilan di bawah ini :

Informasi Exif foto tersebut ada di bagian More Info. Sayangnya informasi yang muncul cukup terbatas. Alternatifnya kita juga bisa melihat informasi Exif foto dari aplikasi Preview. Bila kita sedang membuka foto menggunakan Mac Preview, kita bisa menggunakan kombinasi tombol yang sama (⌘i). Tampilan jendela yang muncul seperti di bawah ini :

Di Linux saya biasanya menggunakan perintah exiftool dari Terminal untuk membaca Exif data. Di Ubuntu Linux perintah exiftool ini tersedia dalam paket libimage-exiftool-perl. Cara pemakaiannya cukup mudah tinggal ketikkan exiftool lalu ikuti dengan nama file fotonya, misalnya seperti contoh di bawah ini :

ttirtawi@gbt733:~$ uname -a
Linux gbt733 3.5.0-17-generic #28-Ubuntu SMP Tue Oct 9 19:32:08 UTC 2012 i686 i686 i686 GNU/Linux
ttirtawi@gbt733:~$ exiftool DSCF0068.JPG 
ExifTool Version Number         : 8.60
File Name                       : DSCF0068.JPG
Directory                       : .
File Size                       : 1373 kB
File Modification Date/Time     : 2014:01:19 21:09:32+07:00
File Permissions                : rwxrwxr-x
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Profile CMM Type                : Lino
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 1998:02:09 06:49:00
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : IEC
Device Model                    : sRGB
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : HP
Profile ID                      : 0
Profile Copyright               : Copyright (c) 1998 Hewlett-Packard Company
Profile Description             : sRGB IEC61966-2.1
Media White Point               : 0.95045 1 1.08905
Media Black Point               : 0 0 0
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Device Mfg Desc                 : IEC http://www.iec.ch
Device Model Desc               : IEC 61966-2.1 Default RGB colour space - sRGB
Viewing Cond Desc               : Reference Viewing Condition in IEC61966-2.1
Viewing Cond Illuminant         : 19.6445 20.3718 16.8089
Viewing Cond Surround           : 3.92889 4.07439 3.36179
Viewing Cond Illuminant Type    : D50
Luminance                       : 76.03647 80 87.12462
Measurement Observer            : CIE 1931
Measurement Backing             : 0 0 0
Measurement Geometry            : Unknown (0)
Measurement Flare               : 0.999%
Measurement Illuminant          : D65
Technology                      : Cathode Ray Tube Display
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : FUJIFILM
Camera Model Name               : X100S
Orientation                     : Horizontal (normal)
X Resolution                    : 72
Y Resolution                    : 72
Resolution Unit                 : inches
Software                        : Digital Camera X100S Ver1.03
Modify Date                     : 2014:01:18 00:23:40
Copyright                       : 
Exposure Time                   : 1/40
F Number                        : 2.0
Exposure Program                : Aperture-priority AE
ISO                             : 1250
Sensitivity Type                : Standard Output Sensitivity
Exif Version                    : 0230
Date/Time Original              : 2014:01:18 00:23:40
Create Date                     : 2014:01:18 00:23:40
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 3.2
Shutter Speed Value             : 1/39
Aperture Value                  : 2.0
Brightness Value                : -1.83
Exposure Compensation           : -0.33
Max Aperture Value              : 2.0
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : Off, Did not fire
Focal Length                    : 23.0 mm
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 2104
Exif Image Height               : 2104
Focal Plane X Resolution        : 2092
Focal Plane Y Resolution        : 2092
Focal Plane Resolution Unit     : cm
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Custom Rendered                 : Normal
Exposure Mode                   : Auto
White Balance                   : Auto
Scene Capture Type              : Standard
Sharpness                       : Normal
Subject Distance Range          : Unknown
XMP Toolkit                     : XMP Core 5.4.0
Creator Tool                    : Digital Camera X100S Ver1.03
Date Created                    : 2014:01:18 00:23:40
Rights                          : 
Image Width                     : 2104
Image Height                    : 2104
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:2 (2 1)
Aperture                        : 2.0
Image Size                      : 2104x2104
Scale Factor To 35 mm Equivalent: 3.0
Shutter Speed                   : 1/40
Circle Of Confusion             : 0.010 mm
Field Of View                   : 28.9 deg
Focal Length                    : 23.0 mm (35 mm equivalent: 70.0 mm)
Hyperfocal Distance             : 26.78 m
Light Value                     : 3.7
ttirtawi@gbt733:~$

Aplikasi exiftool ini tersedia juga di Mac OSX, saya install exiftool di Mac melalui MacPorts. Saat ini yang tersedia di MacPorts adalah exiftool-5.16, nama paketnya adalah p5.16-image-exiftool. Ini contoh tampilan output exiftool di Mac OSX :

ttirtawi@macmini:oV5HwAWxTKubQFBq8dc7kw$ exiftool-5.16 DSC_1627.JPG 
ExifTool Version Number         : 9.06
File Name                       : DSC_1627.JPG
Directory                       : .
File Size                       : 1802 kB
File Modification Date/Time     : 2013:12:15 18:10:57+07:00
File Access Date/Time           : 2014:01:17 16:54:28+07:00
File Permissions                : rw-r--r--
File Type                       : JPEG
MIME Type                       : image/jpeg
JFIF Version                    : 1.01
Current IPTC Digest             : 5c2c0a36d65e204752971ce03e17cae2
Coded Character Set             : UTF8
Application Record Version      : 2
Special Instructions            : oV5HwAWxTKubQFBq8dc7kw
IPTC Digest                     : 5c2c0a36d65e204752971ce03e17cae2
Profile CMM Type                : Lino
Profile Version                 : 2.1.0
Profile Class                   : Display Device Profile
Color Space Data                : RGB
Profile Connection Space        : XYZ
Profile Date Time               : 1998:02:09 06:49:00
Profile File Signature          : acsp
Primary Platform                : Microsoft Corporation
CMM Flags                       : Not Embedded, Independent
Device Manufacturer             : IEC
Device Model                    : sRGB
Device Attributes               : Reflective, Glossy, Positive, Color
Rendering Intent                : Perceptual
Connection Space Illuminant     : 0.9642 1 0.82491
Profile Creator                 : HP
Profile ID                      : 0
Profile Copyright               : Copyright (c) 1998 Hewlett-Packard Company
Profile Description             : sRGB IEC61966-2.1
Media White Point               : 0.95045 1 1.08905
Media Black Point               : 0 0 0
Red Matrix Column               : 0.43607 0.22249 0.01392
Green Matrix Column             : 0.38515 0.71687 0.09708
Blue Matrix Column              : 0.14307 0.06061 0.7141
Device Mfg Desc                 : IEC http://www.iec.ch
Device Model Desc               : IEC 61966-2.1 Default RGB colour space - sRGB
Viewing Cond Desc               : Reference Viewing Condition in IEC61966-2.1
Viewing Cond Illuminant         : 19.6445 20.3718 16.8089
Viewing Cond Surround           : 3.92889 4.07439 3.36179
Viewing Cond Illuminant Type    : D50
Luminance                       : 76.03647 80 87.12462
Measurement Observer            : CIE 1931
Measurement Backing             : 0 0 0
Measurement Geometry            : Unknown (0)
Measurement Flare               : 0.999%
Measurement Illuminant          : D65
Technology                      : Cathode Ray Tube Display
Red Tone Reproduction Curve     : (Binary data 2060 bytes, use -b option to extract)
Green Tone Reproduction Curve   : (Binary data 2060 bytes, use -b option to extract)
Blue Tone Reproduction Curve    : (Binary data 2060 bytes, use -b option to extract)
Exif Byte Order                 : Big-endian (Motorola, MM)
Make                            : NIKON CORPORATION
Camera Model Name               : NIKON D7000
Orientation                     : Horizontal (normal)
X Resolution                    : 300
Y Resolution                    : 300
Resolution Unit                 : inches
Software                        : iPhoto 9.5.1
Modify Date                     : 2013:12:14 22:41:46
Artist                          : TEDY TIRTAWIDJAJA
Copyright                       : https://blog.tedytirta.info
Exposure Time                   : 1/160
F Number                        : 7.1
Exposure Program                : Manual
ISO                             : 250
Sensitivity Type                : Recommended Exposure Index
Exif Version                    : 0230
Date/Time Original              : 2013:12:14 22:41:46
Create Date                     : 2013:12:14 22:41:46
Components Configuration        : Y, Cb, Cr, -
Compressed Bits Per Pixel       : 4
Exposure Compensation           : 0
Max Aperture Value              : 1.7
Metering Mode                   : Multi-segment
Light Source                    : Unknown
Flash                           : On, Return detected
Focal Length                    : 35.0 mm
User Comment                    : 
Sub Sec Time                    : 10
Sub Sec Time Original           : 10
Sub Sec Time Digitized          : 10
Flashpix Version                : 0100
Color Space                     : sRGB
Exif Image Width                : 4916
Exif Image Height               : 1550
Sensing Method                  : One-chip color area
File Source                     : Digital Camera
Custom Rendered                 : Normal
Exposure Mode                   : Manual
White Balance                   : Auto
Digital Zoom Ratio              : 1
Focal Length In 35mm Format     : 52 mm
Scene Capture Type              : Standard
Gain Control                    : None
Contrast                        : Normal
Saturation                      : Normal
Sharpness                       : Normal
Subject Distance Range          : Unknown
XMP Toolkit                     : XMP Core 5.4.0
Lens Info                       : 35mm f/1.8
Image Number                    : 3698
Lens                            : AF-S DX Nikkor 35mm f/1.8G
Flash Compensation              : 0
Serial Number                   : 8187760
Creator                         : TEDY TIRTAWIDJAJA
Rights                          : https://blog.tedytirta.info
Instructions                    : oV5HwAWxTKubQFBq8dc7kw
Date Created                    : 2013:12:14 22:41:46
Creator Tool                    : iPhoto 9.5.1
Image Width                     : 4916
Image Height                    : 1550
Encoding Process                : Baseline DCT, Huffman coding
Bits Per Sample                 : 8
Color Components                : 3
Y Cb Cr Sub Sampling            : YCbCr4:2:0 (2 2)
Aperture                        : 7.1
Image Size                      : 4916x1550
Scale Factor To 35 mm Equivalent: 1.5
Shutter Speed                   : 1/160
Create Date                     : 2013:12:14 22:41:46.10
Date/Time Original              : 2013:12:14 22:41:46.10
Modify Date                     : 2013:12:14 22:41:46.10
Circle Of Confusion             : 0.020 mm
Field Of View                   : 38.2 deg
Focal Length                    : 35.0 mm (35 mm equivalent: 52.0 mm)
Hyperfocal Distance             : 8.53 m
Lens ID                         : Unknown (-2147483648) 35mm
Light Value                     : 11.7
ttirtawi@macmini:oV5HwAWxTKubQFBq8dc7kw$

Solaris 10 : Unique Instance Error Pkgadd

Untuk menginstal paket di Solaris 10, saya biasanya menggunakan perintah pkgadd. Misalnya saya punya paket Wireshark yang saya dapat dari Internet. Untuk menginstalnya saya gunakan perintah seperti berikut ini :

root@testbed:/tmp# pkgadd -d wireshark-1.6.8-sol10-sparc-local 

The following packages are available:
  1  SMCwires     wireshark
                  (sparc) 1.6.8

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <SMCwires> from </tmp/wireshark-1.6.8-sol10-sparc-local>

wireshark(sparc) 1.6.8

Current administration requires that a unique instance of the
<SMCwires> package be created.  However, the maximum number of
instances of the package which may be supported at one time on the
same system has already been met.

No changes were made to the system.
root@testbed:/tmp# 

Ternyata muncul error seperti di atas, pkgadd menolak untuk menginstal Wireshark versi 1.6.8 karena sudah ada Wireshark versi lain. “Current administration requires that a unique instance”, itu tandanya saya perlu membuang dulu Wireshark versi lamanya. Membuang paket (uninstall) di Solaris 10, saya perlu menggunakan perintah pkgrm seperti contoh di bawah ini :

root@testbed:/tmp# pkgrm SMCwires

The following package is currently installed:
   SMCwires  wireshark
             (sparc) 1.6.4

Do you want to remove this package? [y,n,?,q] y

## Removing installed package instance <SMCwires>
## Verifying package <SMCwires> dependencies in global zone
## Processing package information.
## Removing pathnames in class <none>
/usr/local/share/wireshark/ws.css
/usr/local/share/wireshark/wireshark.html
/usr/local/share/wireshark/wireshark-filter.html
/usr/local/share/wireshark/wimaxasncp/dictionary.xml
/usr/local/share/wireshark/wimaxasncp/dictionary.dtd
/usr/local/share/wireshark/wimaxasncp
...
...
...
/usr/local/bin/wireshark
/usr/local/bin/tshark
/usr/local/bin/text2pcap
/usr/local/bin/rawshark
/usr/local/bin/randpkt
/usr/local/bin/mergecap
/usr/local/bin/idl2wrs
/usr/local/bin/editcap
/usr/local/bin/dumpcap
/usr/local/bin/dftest
/usr/local/bin/capinfos
/usr/local/bin <shared pathname not removed>
## Updating system information.

Removal of <SMCwires> was successful.
root@testbed:/tmp# 

Setelah Wireshark versi 1.6.4 tadi sukses di-uninstall, barulah Solaris mengijinkan saya menginstal Wireshark versi 1.6.8.

root@testbed:/tmp# pkgadd -d wireshark-1.6.8-sol10-sparc-local 
The following packages are available:
  1  SMCwires     wireshark
                  (sparc) 1.6.8

Select package(s) you wish to process (or 'all' to process
all packages). (default: all) [?,??,q]: 1

Processing package instance <SMCwires> from </tmp/wireshark-1.6.8-sol10-sparc-local>

wireshark(sparc) 1.6.8
Gerald Combs et al
Using </usr/local> as the package base directory.
## Processing package information.
## Processing system information.
   7 package pathnames are already properly installed.
## Verifying disk space requirements.
## Checking for conflicts with packages already installed.
## Checking for setuid/setgid programs.

Installing wireshark as <SMCwires>

## Installing part 1 of 1.
/usr/local/bin/capinfos
/usr/local/bin/dftest
/usr/local/bin/dumpcap
/usr/local/bin/editcap
/usr/local/bin/idl2wrs
/usr/local/bin/mergecap
/usr/local/bin/randpkt
/usr/local/bin/rawshark
/usr/local/bin/text2pcap
/usr/local/bin/tshark
/usr/local/bin/wireshark
...
...
...
/usr/local/share/wireshark/tshark.html
/usr/local/share/wireshark/wimaxasncp/dictionary.dtd
/usr/local/share/wireshark/wimaxasncp/dictionary.xml
/usr/local/share/wireshark/wireshark-filter.html
/usr/local/share/wireshark/wireshark.html
/usr/local/share/wireshark/ws.css
[ verifying class <none> ]

Installation of <SMCwires> was successful.
root@testbed:/tmp#