Linux系統rar和unrar命令的安裝

來源:互聯網
上載者:User


以3.8.0版本為例,如果是64位平台,執行以下命令,也可以去官方網站:)下載最新版:
wget http://www.rarlab.com/rar/rarlinux-x64-4.2.0.tar.gz
rar軟體不需要安裝,直接解壓到/usr/local下,以下操作需要有root許可權。
#tar zxvf rarlinux-x64-4.2.0.tar.gz -C /usr/local
此時,/usr/local/rar下就會有rar命令和unrar命令。可以在/usr/local/bin下建立連

#ln -s /usr/local/rar/rar /usr/local/bin/rar
#ln -s /usr/local/rar/unrar /usr/local/bin/unrar
使用方法: rar 命令使用方法
a 添加檔案到壓縮檔案
c 添加壓縮檔案注釋(注釋的大小最大不能超過62000位元組)
cf 添加檔案備忘( 當使用’v’參數時顯示檔案備忘,最大不能超過32767位元組)
ch 改變壓縮檔案參數
cw 向指定檔案寫入檔案備忘
d 從檔案中刪除檔案
e 解壓縮檔案到目前的目錄(不建立任何子目錄)
f 重新整理檔案中的檔案(更新這些檔案自它們被打包之後產生的變化,不在壓縮檔案中增加新的)
i[par]=<str> 在檔案中尋找特定字元
k 鎖定檔案(任何試圖改變壓縮檔案中內容的命令都會被忽略)
l[t,b] 列出檔案[technical, bare]
m[f] 移動到壓縮檔案中[只針對檔案]
p 列印檔案到標準輸出
r 修補壓縮檔案
rc 重建丟失的分卷
rn 重新命名壓縮檔案中的檔案
rr[N] 添加資料恢複記錄
rv[N] 建立恢複卷
s[name|-] 壓縮檔案與SFX(自解壓文檔)之間的轉換
t 測試壓縮檔案檔案
u 更新壓縮檔案中的檔案
v[t,b] 列出壓縮檔案的詳細資料[technical,bare]
x 解壓縮到完整路徑

例子: rar a anaconda-ks.cfg.rar anaconda-ks.cfg

解壓縮命令unrar的使用:

$unrar –help

用法: unrar <command> -<switch 1> -<switch N> <archive> <files…>
<@listfiles…> <path_to_extract\>

<命令>
e 解壓檔案到目前的目錄

l[t,b] 列出壓縮文檔資訊[technical, bare]
p 列印檔案到標準輸出

t 測試壓縮我俄當

v[t,b] 列出壓縮文檔的詳細資料[technical,bare]

x 解壓檔案到完整路徑

[root@localhost ~]# unrar e anaconda-ks.cfg.rar /home/


常用rar命令:
rar x centos.rar //解壓 centos.rar 到目前的目錄
rar centos.rar ./piaoyi.org/ //將 piaoyi.org 目錄打包為 centos.rar
但是飄易推薦大家使用zip壓縮和解壓,因為zip一般是linux系統內建:
1、zip
zip -r myfile.zip ./web

將目前的目錄裡的web下的所有檔案和檔案夾全部壓縮成myfile.zip檔案,-r 表示遞迴壓縮子目錄下所有檔案。
2、unzip
unzip -o -d /home/sunny myfile.zip

把myfile.zip檔案解壓到 /home/sunny/
-o:不提示的情況下覆蓋檔案;
-d:-d /home/sunny 指明將檔案解壓縮到/home/sunny目錄下;
常見錯誤原因分析:
1、如果在運行命令rar時,出現下面這個問題
rar: /lib/i686/nosegneg/libc.so.6: version `GLIBC_2.7' not found (required by rar)

解決辦法:
cp rar_static /usr/local/bin/rar
2、使用rar的時候出現錯誤
bash: /usr/local/bin/rar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

 因為64位系統中安裝了32位程式,解決方案:
yum install glibc.i686
3、重新安裝glibc.i686以後還有如下類似錯誤
error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

再繼續安裝包:
yum install libstdc++.so.6

 
補充國外源:
Install Rar/Unrar centos 6
for 64 bit
install unrar centos x64
#wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.x86_64.rpm
#rpm -Uvh unrar-4.0.7-1.el6.rf.x86_64.rpm
install rar centos x64
#wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.x86_64.rpm
#rpm -Uvh rar-3.8.0-1.el6.rf.x86_64.rpm

 
for 32 bit
install unrar centos 32
#wget http://pkgs.repoforge.org/unrar/unrar-4.0.7-1.el6.rf.i686.rpm
#rpm -Uvh unrar-4.0.7-1.el6.rf.i686.rpm

install rar centos 32
#wget http://pkgs.repoforge.org/rar/rar-3.8.0-1.el6.rf.i686.rpm
#rpm -Uvh rar-3.8.0-1.el6.rf.i686.rpm

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.