Cara Remove Package CentOS dengan Mengabaikan Dependensi Terkait

Posted on

Halo halo, melanjutkan artikel saya sebelumnya yaitu Cara Memperbaiki YUM yang Error Ketika Update CentOS 6 EOL. Sekarang saya menemukan problem baru ketika mau remove/uninstall suatu package namun dependensi terkait package tersebut ikutan akan di remove/uninstall. Padahal saya maunya hanya hanya package terkait yang di remove/uninstall.

Dalam hal ini, saya mau coba remove/uninstall package postgresql postgresql-server postgresql-libs. Kalau dilihat pada “yum list postgres*” tampilannya akan seperti ini pada Installed Packages:

# yum list postgres*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Installed Packages
postgresql.x86_64                                                                                      8.4.20-8.el6_9                                                                            @C6.10-base
postgresql-libs.x86_64                                                                                 8.4.20-8.el6_9                                                                            @C6.10-base
postgresql-server.x86_64                                                                               8.4.20-8.el6_9                                                                            @C6.10-base
Available Packages
postgresql.i686                                                                                        8.4.20-8.el6_9                                                                            C6.10-base 
postgresql-contrib.x86_64                                                                              8.4.20-8.el6_9                                                                            C6.10-base 
postgresql-devel.i686                                                                                  8.4.20-8.el6_9                                                                            C6.10-base 
postgresql-devel.x86_64                                                                                8.4.20-8.el6_9                                                                            C6.10-base 

Berikut log ketika saya melakukan “yum remove” kurang lebih seperti ini:

# yum remove postgresql postgresql-server postgresql-libs
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package postgresql.x86_64 0:8.4.20-8.el6_9 will be erased
---> Package postgresql-libs.x86_64 0:8.4.20-8.el6_9 will be erased
--> Processing Dependency: libpq.so.5()(64bit) for package: rh-python36-python-psycopg2-2.6.2-1.el6.x86_64
---> Package postgresql-server.x86_64 0:8.4.20-8.el6_9 will be erased
--> Running transaction check
---> Package rh-python36-python-psycopg2.x86_64 0:2.6.2-1.el6 will be erased
--> Finished Dependency Resolution

Dependencies Resolved

============================================================================================================================================================================================================
 Package                                                     Arch                                   Version                                           Repository                                       Size
============================================================================================================================================================================================================
Removing:
 postgresql                                                  x86_64                                 8.4.20-8.el6_9                                    @C6.10-base                                      14 M
 postgresql-libs                                             x86_64                                 8.4.20-8.el6_9                                    @C6.10-base                                     625 k
 postgresql-server                                           x86_64                                 8.4.20-8.el6_9                                    @C6.10-base                                      15 M
Removing for dependencies:
 rh-python36-python-psycopg2                                 x86_64                                 2.6.2-1.el6                                       @centos-sclo-rh                                 505 k

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

Installed size: 29 M
Is this ok [y/N]: n
Exiting on user Command

Nah kalau kita mau remove/uninstall package tertentu saja sebenarnya caranya gampang sekali, cukup melakukan remove/uninstall menggunakan perintah rpm seperti ini:

# rpm -e --nodeps postgresql postgresql-server postgresql-libs

Setelah dijalankan, maka otomatis packages terkait sudah terhapus pada server. Silakan lakukan konfirmasi dengan menjalankan perintah:

# yum list postgres*
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
Available Packages
postgresql.i686                                                                                        8.4.20-8.el6_9                                                                            C6.10-base 
postgresql.x86_64                                                                                      8.4.20-8.el6_9                                                                            C6.10-base 
postgresql-contrib.x86_64                                                                              8.4.20-8.el6_9                                                                            C6.10-base 
postgresql-devel.i686                                                                                  8.4.20-8.el6_9                                                                            C6.10-base 
postgresql-devel.x86_64                                                                                8.4.20-8.el6_9                                                                            C6.10-base

Jika Installed Packages menghilang, maka packages terkait sudah dengan sempurna di remove/uninstall pada server tanpa menghilangkan dependensi terkait.

Semoga bermanfaat.

Gravatar Image
Seorang warga negara Indonesia biasa. Pengguna MAC dan develop server Ubuntu & CentOS. Contact : admin [at] nugi.biz

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.