Test Block Top

The Blog...
Articles, Tips & Trick and Other Interesting Information...
Tampilkan postingan dengan label RAR. Tampilkan semua postingan
Tampilkan postingan dengan label RAR. Tampilkan semua postingan
17 Mei 2012

RAR & Unrar CentOS Linux

Untuk extract atau buat archive RAR, jika anda pakai sistem operasi windows bisa dilakukan dengan terlebih dahulu install executable file (.exe) software RAR seperti WinRAR atau 7zip misalnya. Namun tidak demikian halnya dengan CentOS Linux, instalasi RAR & UNRAR dilakukan dengan mengetikkan command pada jendela terminal (bash).

Command: yum install rar & yum install unrar.


[root@linggih ~]# yum install rar
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
epel/metalink                                            | 4.1 kB     00:00
* base: centos.biz.net.id
* epel: epel.idrepo.or.id
* extras: centos.biz.net.id
* remi: rpms.famillecollet.com
* updates: centos.idrepo.or.id
base                                                     | 3.7 kB     00:00
extras                                                   | 3.5 kB     00:00
remi                                                     | 2.9 kB     00:00
updates                                                  | 3.5 kB     00:00
Setting up Install Process
No package rar available.
Error: Nothing to do
[root@linggih ~]#

Seperti yang terlihat di atas, RAR & UNRAR tidak tersedia pada yum repositories default CentOS Linux. Untuk install RAR & UNRAR via yum, rpmforge repo terlebih dahulu harus terinstall.

Install rpmforge Repo

Pertama, cek arsitektur CentOS (32-Bit atau 64-Bit). Cek command; uname -a atau uname -i

32-Bit CentOS Linux (i386)



[root@localhost ~]# uname -a
Linux localhost.localdomain 2.6.18-308.4.1.el5 #1 SMP Tue Apr 17 17:08:10 EDT 2012 i686 athlon i386 GNU/Linux
[root@localhost ~]# uname -i
i386
[root@localhost ~]#

64-Bit CentOS Linux (x86_64)



[root@linggih ~]# uname -a
Linux linggih.sytes.net 2.6.32-220.13.1.el6.x86_64 #1 SMP Tue Apr 17 23:56:34 BST 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@linggih ~]# uname -i
x86_64
[root@linggih ~]#

Install rpmforge 32-Bit System



[root@localhost ~]# rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Retrieving http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
warning: /var/tmp/rpm-xfer.j1iAgn: Header V3 DSA signature: NOKEY, key ID 6b8d79e6
Preparing...                ########################################### [100%]
1:rpmforge-release       ########################################### [100%]
[root@localhost ~]#

Install rpmforge 64-Bit System



[root@linggih ~]# rpm -Uhv http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
Retrieving http://packages.sw.be/rpmforge-release/rpmforge-release-0.5.2-2.el5.rf.x86_64.rpm
warning: /var/tmp/rpm-tmp.KfyCjc: Header V3 DSA/SHA1 Signature, key ID 6b8d79e6: NOKEY
Preparing...                ########################################### [100%]
1:rpmforge-release       ########################################### [100%]
[root@linggih ~]#

Command di atas akan install file rpmforge.repo pada direktori /etc/yum.repos.d dan rpm-gpg key pada direktori /etc/pki. Untuk disable rpmforge repo, edit rpmforge.repo pada direktori /etc/yum.repos.d dan set value enabled ke 0.

Install RAR

Setelah rpmforge repo terinstall, sekarang RAR dapat diinstall via yum.

Command install: yum install rar



[root@linggih ~]# yum install rar
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* epel: sulawesi.idrepo.or.id
* extras: centos.biz.net.id
* remi: remirpm.mirror.gymkl.ch
* rpmforge: mirror.oscc.org.my
* updates: centos.idrepo.or.id
rpmforge                                                 | 1.1 kB     00:00
rpmforge/primary                                         | 4.0 MB     00:18
rpmforge                                                            11165/11165
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package rar.x86_64 0:3.8.0-1.el5.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package      Arch            Version                   Repository         Size
================================================================================
Installing:
rar          x86_64          3.8.0-1.el5.rf            rpmforge          265 k

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

Total download size: 265 k
Installed size: 546 k
Is this ok [y/N]: y
Downloading Packages:
rar-3.8.0-1.el5.rf.x86_64.rpm                            | 265 kB     00:01
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Warning: RPMDB altered outside of yum.
Installing : rar-3.8.0-1.el5.rf.x86_64                                    1/1

Installed:
rar.x86_64 0:3.8.0-1.el5.rf

Complete!
[root@linggih ~]#

Install UNRAR


Command Install: yum install unrar



[root@linggih ~]# yum install unrar
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: centos.biz.net.id
* epel: mirror.nus.edu.sg
* extras: centos.biz.net.id
* remi: remirpm.mirror.gymkl.ch
* rpmforge: mirror.oscc.org.my
* updates: centos.idrepo.or.id
Setting up Install Process
Resolving Dependencies
--> Running transaction check
---> Package unrar.x86_64 0:4.1.4-1.el5.rf will be installed
--> Finished Dependency Resolution

Dependencies Resolved

================================================================================
Package        Arch            Version                 Repository         Size
================================================================================
Installing:
unrar          x86_64          4.1.4-1.el5.rf          rpmforge          115 k

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

Total download size: 115 k
Installed size: 233 k
Is this ok [y/N]: y
Downloading Packages:
unrar-4.1.4-1.el5.rf.x86_64.rpm                          | 115 kB     00:00
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : unrar-4.1.4-1.el5.rf.x86_64                                  1/1

Installed:
unrar.x86_64 0:4.1.4-1.el5.rf

Complete!
[root@linggih ~]#

Contoh Penggunaan Command RAR & UNRAR

UNRAR

command: unrar x namafile.rar

Contoh:



[root@localhost plugins]# unrar x SyntaxHighlighter_1.5.1.rar

UNRAR 4.10 freeware      Copyright (c) 1993-2012 Alexander Roshal


Extracting from SyntaxHighlighter_1.5.1.rar

Creating    dp.SyntaxHighlighter                                      OK
Creating    dp.SyntaxHighlighter/Scripts                              OK
Extracting  dp.SyntaxHighlighter/Scripts/clipboard.swf                OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushCpp.js                OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushCSharp.js             OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushCss.js                OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushDelphi.js             OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushJava.js               OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushJScript.js            OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushPhp.js                OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushPython.js             OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushRuby.js               OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushSql.js                OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushVb.js                 OK
Extracting  dp.SyntaxHighlighter/Scripts/shBrushXml.js                OK
Extracting  dp.SyntaxHighlighter/Scripts/shCore.js                    OK
Creating    dp.SyntaxHighlighter/Styles                               OK
Extracting  dp.SyntaxHighlighter/Styles/SyntaxHighlighter.css         OK
Creating    dp.SyntaxHighlighter/Uncompressed                         OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushCpp.js           OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushCSharp.js        OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushCss.js           OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushDelphi.js        OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushJava.js          OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushJScript.js       OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushPhp.js           OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushPython.js        OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushRuby.js          OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushSql.js           OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushVb.js            OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shBrushXml.js           OK
Extracting  dp.SyntaxHighlighter/Uncompressed/shCore.js               OK
All OK
[root@localhost plugins]#

Buat archive RAR

Command: rar a target-rar.rar target-file



[root@localhost plugins]# rar a testing.rar testing.php

RAR 3.80   Copyright (c) 1993-2008 Alexander Roshal   16 Sep 2008
Shareware version         Type RAR -? for help

Evaluation copy. Please register.

Creating archive testing.rar

Adding    testing.php                                                 OK
Done
[root@localhost plugins]#

Buat archive split RAR

Menggunakan command RAR untuk compress dan split file menjadi beberapa bagian. Untuk file yang berukuran besar (tergantung spesifikasi mesin komputer), anda harus tunggu beberapa saat sampai proses split & compress selesai.

Contoh: Ukuran file kurang lebih 122 MB MySQL dump, target size per split 20 MB, hasil split 5 file berukuran 20 MB & 1 file berukuran 18 MB.

Command: rar a -v?????k target-rar.rar target-file



[root@localhost ~]# rar a -v20480k kompres-sql.rar gede_database.sql

RAR 3.80   Copyright (c) 1993-2008 Alexander Roshal   16 Sep 2008
Shareware version         Type RAR -? for help

Evaluation copy. Please register.

Creating archive kompres-sql.rar

Adding    gede_database.sql
Calculating the control sum

Creating archive kompres-sql.part2.rar

...       gede_database.sql
Calculating the control sum

Creating archive kompres-sql.part3.rar

...       gede_database.sql
Calculating the control sum

Creating archive kompres-sql.part4.rar

...       gede_database.sql
Calculating the control sum

Creating archive kompres-sql.part5.rar

...       gede_database.sql
Calculating the control sum

Creating archive kompres-sql.part6.rar

...       gede_database.sql                                           OK
Calculating the control sum
Done
You have new mail in /var/spool/mail/root
[root@localhost ~]#

Split RAR Linux

Split RAR Linux

Extract Multiple Split File RAR

untuk extract multiple split file RAR ketikkan command:

unrar x namafile.part1.rar



[root@localhost ~]# unrar x kompres-sql.part1.rar

UNRAR 4.10 freeware      Copyright (c) 1993-2012 Alexander Roshal


Extracting from kompres-sql.part1.rar

Extracting  gede_database.sql                                         17%

Extracting from kompres-sql.part2.rar

...         gede_database.sql                                         34%

Extracting from kompres-sql.part3.rar

...         gede_database.sql                                         51%

Extracting from kompres-sql.part4.rar

...         gede_database.sql                                         68%

Extracting from kompres-sql.part5.rar

...         gede_database.sql                                         85%

Extracting from kompres-sql.part6.rar

...         gede_database.sql                                         OK
All OK
[root@localhost ~]#

UNRAR Split RAR Linux

UNRAR Split RAR Linux

Loncat ke Atas ↑