Masalahnya
“Yum clean all” tidak menghapus informasi cache yum di /var/cache/yum untuk server orcle Linux yang menggunakan repositori yum publik Oracle atau repositori yum lokal.
# yum repolist Loaded plugins: refresh-packagekit, security, ulninfo public_ol6_UEK_latest | 1.2 kB 00:00 public_ol6_UEK_latest/primary | 26 MB 00:04 public_ol6_UEK_latest 554/554 public_ol6_latest | 1.4 kB 00:00 public_ol6_latest/primary | 58 MB 00:04 public_ol6_latest 36051/36051 repo id repo name status public_ol6_UEK_latest Latest Unbreakable Enterprise Kernel for Oracle Linux 6Ser 554 public_ol6_latest Oracle Linux 6Server Latest (x86_64) 36,051 repolist: 36,605
# du -sh /var/cache/yum/x86_64/6Server/* 864K /var/cache/yum/x86_64/6Server/ol6_addons 973M /var/cache/yum/x86_64/6Server/ol6_latest 367M /var/cache/yum/x86_64/6Server/ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_latest 8.0K /var/cache/yum/x86_64/6Server/public_ol6_UEK_latest 45MB /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest
# yum clean all Loaded plugins: refresh-packagekit, security, ulninfo Cleaning repos: public_ol6_UEK_latest public_ol6_latest Cleaning up Everything
# du -sh /var/cache/yum/x86_64/6Server/* 864K /var/cache/yum/x86_64/6Server/ol6_addons 973M /var/cache/yum/x86_64/6Server/ol6_latest 367M /var/cache/yum/x86_64/6Server/ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_latest 8.0K /var/cache/yum/x86_64/6Server/public_ol6_UEK_latest 45MB /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest
Solusinya
“yum clean” menghapus cache dari repositori yang diaktifkan di /etc/yum.repos.d/*.repo. Dari halaman manual yum:
# man yum .... CLEAN OPTIONS The following are the ways which you can invoke yum in clean mode. Note that "all files" in the commands below means "all files in currently enabled repositories". If you want to also clean any (temporarily) disabled repositories you need to use --enablerepo=’*’ option.
Ikuti langkah-langkah di bawah ini untuk memecahkan masalah:
1. Aktifkan repositori sementara untuk menghapus cache yum.
# yum clean all --enablerepo="repository_label"
atau
# vi /etc/yum.repos.d/[filename].repo ... enabled = 1 ### Add this for the respective repository.
Bagaimana jika, tidak ada informasi tentang repositori di file /etc/yum.repos.d/*.repo? Dalam skenario itu, entri sementara pada file repositori dengan nama label repositori, akan membantu mengosongkan cache.
Men-debug
Dalam contoh berikut, hanya dua repositori yang diaktifkan yaitu “public_ol6_UEK_latest, public_ol6_latest”, sedangkan informasi cache yum tersedia untuk beberapa repositori tambahan.
Anggaplah repositori “public_ol6_UEKR3_latest” dinonaktifkan dan “ol6_UEK_latest, ol6_latest” tidak memiliki entri di file /etc/yum.repos.d/*.repo.
# yum repolist Loaded plugins: refresh-packagekit, security, ulninfo public_ol6_UEK_latest | 1.2 kB 00:00 public_ol6_UEK_latest/primary | 26 MB 00:04 public_ol6_UEK_latest 554/554 public_ol6_latest | 1.4 kB 00:00 public_ol6_latest/primary | 58 MB 00:04 public_ol6_latest 36051/36051 repo id repo name status public_ol6_UEK_latest Latest Unbreakable Enterprise Kernel for Oracle Linux 6Ser 554 public_ol6_latest Oracle Linux 6Server Latest (x86_64) 36,051 repolist: 36,
# du -sh /var/cache/yum/x86_64/6Server/* 864K /var/cache/yum/x86_64/6Server/ol6_addons 973M /var/cache/yum/x86_64/6Server/ol6_latest 367M /var/cache/yum/x86_64/6Server/ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_latest 8.0K /var/cache/yum/x86_64/6Server/public_ol6_UEK_latest 45MB /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest
Hapus informasi cache dari repositori yang dinonaktifkan yang memiliki entri di file /etc/yum.repos.d/*.repo. yaitu public_ol6_UEKR3_latest:
# yum clean all --enablerepo="public_ol6_UEKR3_latest"
# du -sh /var/cache/yum/x86_64/6Server/* 864K /var/cache/yum/x86_64/6Server/ol6_addons 973M /var/cache/yum/x86_64/6Server/ol6_latest 367M /var/cache/yum/x86_64/6Server/ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_latest 8.0K /var/cache/yum/x86_64/6Server/public_ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest
Untuk menghapus cache dari dua repositori lain yang tidak memiliki entri di "/etc/yum.repos.d/*.repo", dapat dihapus secara manual atau menambahkan entri sementara pada file konfigurasi.
# rm -rf /var/cache/yum/x86_64/6Server/ol6_latest /var/cache/yum/x86_64/6Server/ol6_latest
Atau
# vi /etc/yum.repos.d/public.repo [ol6_latest] enabled = 1 [ol6_UEK_latest] enabled = 1
# yum clean all
# du -sh /var/cache/yum/x86_64/6Server/* 864K /var/cache/yum/x86_64/6Server/ol6_addons 12.0K /var/cache/yum/x86_64/6Server/ol6_latest 8.0K /var/cache/yum/x86_64/6Server/ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_latest 8.0K /var/cache/yum/x86_64/6Server/public_ol6_UEK_latest 12K /var/cache/yum/x86_64/6Server/public_ol6_UEKR3_latest