Skip to main content
  1. Posts/

Extract RPM Package Files

1 min
centos centos
Table of Contents

Mengekstrak RPM file dapat membantu Anda jika mengalami case seperti, tidak sengaja menghapus file konfigurasi atau library, atau ingin membandingkan beberapa konfigurasi default pada package tersebut.

Berikut merupakan panduan singkat cara extract RPM file menggunakan rpm2cpio.

Syntax
#

rpm2cpio myrpmfile.rpm
rpm2cpio - < myrpmfile.rpm
rpm2cpio myrpmfile.rpm | cpio -dium

Examples
#

Buat folder test lalu download package RPM nginx

mkdir test
cd test
wget http://nginx.org/packages/centos/8/x86_64/RPMS/nginx-1.24.0-1.el8.ngx.x86_64.rpm

Extract dengan perintah berikut.

rpm2cpio nginx-1.24.0-1.el8.ngx.x86_64.rpm | cpio -dium

List file

# ll
total 836
drwxr-xr-x 4 root root     38 Oct 16 14:52 etc
-rw-r--r-- 1 root root 855792 Apr 12  2023 nginx-1.24.0-1.el8.ngx.x86_64.rpm
drwxr-xr-x 7 root root     70 Oct 16 14:52 usr
drwxr-xr-x 4 root root     30 Oct 16 14:52 var

Related

RPM-GPG-KEY-AlmaLinux Update Failure
1 min
centos centos almalinux
Configuring Networks on CentOS
1 min
centos centos
Create Bridges on Bonds with and without VLANs using NetworkManager
1 min
centos linux centos
Managing dnf Module Versions
1 min
centos centos
Configuring Network Teaming
2 mins
centos linux centos
Configuring Network Bonding
3 mins
centos linux centos