1。下载rarlinux-3.7.b1.tar.gz —— rar的Linux版本。
地址:https://img.ytdonghua.net/images/20221208/lhgrvdvc5j4.html
如果在Linux上可以使用wget下载文件。关于wget参看https://img.ytdonghua.net/images/20221208/m53lzlw5gpt.com
2。上传到Liux服务器。
3。解压安装包:
# tar xvfz rarlinux-3.7.b1.tar.gz
rar/
rar/file_id.diz
rar/license.txt
rar/Makefile
rar/order.htm
rar/rarfiles.lst
rar/rar.txt
rar/readme.txt
rar/technote.txt
rar/whatsnew.txt
rar/rar
rar/rar_static
rar/unrar
rar/default.sfx
# cd rar
# ls
Makefile file_id.diz order.htm rar.txt rarfiles.lst technote.txt whatsnew.txt
default.sfx license.txt rar rar_static readme.txt unrar
# ls -l
total 1636
-rw-r----- 1 root root 428 Jan 8 12:50 Makefile
-rwxr-xr-x 1 root root 56994 Jan 8 12:50 default.sfx
-rw-r----- 1 root root 217 Jan 8 12:50 file_id.diz
-rw-r----- 1 root root 4398 Jan 8 12:50 license.txt
-rw-r----- 1 root root 3183 Jan 8 12:50 order.htm
-rwxr-xr-x 1 root root 341152 Jan 8 12:50 rar
-rw-r----- 1 root root 70107 Jan 8 12:50 rar.txt
-rwxr-xr-x 1 root root 872804 Jan 8 12:50 rar_static
-rw-r----- 1 root root 1018 Jan 8 12:50 rarfiles.lst
-rw-r----- 1 root root 1050 Jan 8 12:50 readme.txt
-rw-r----- 1 root root 8957 Jan 8 12:50 technote.txt
-rwxr-xr-x 1 root root 196720 Jan 8 12:50 unrar
-rw-r----- 1 root root 6018 Jan 8 12:50 whatsnew.txt
#p#副标题#e#
4。安装:
# make install
mkdir -p /usr/local/bin
mkdir -p /usr/local/lib
cp rar unrar /usr/local/bin
cp rarfiles.lst /etc
cp default.sfx /usr/local/lib
5。解压文件:
# rar x cussbak.rar cussbak/
rar: /lib/tls/libc.so.6: version `GLIBC_2.4' not found (required by rar)
需要GLIBC_2.4。如果没有GLIBC_2.4可以,
# cp ./rar/rar_static /usr/local/bin/rar
rar_static 版是 static linking 版本,不会有 glibc 程式库版本不和的问题。
再次解压:
# rar x cuss.rar cussbak/
RAR 3.70 beta 1 Copyright (c) 1993-2007 Alexander Roshal 8 Jan 2007
Shareware version Type RAR -? for help
Extracting from cuss.rar
Extracting cussbak/cuss/accept/accuseApply_save.jsp 0% OK
Extracting cussbak/cuss/accept/adviceApply_save.jsp 0% OK
……
All OK
成功了。
如果解压的目标已经存在会有此时比如,第3次解压(已经有解压后的文件存在了)
# rar x cuss.rar cussbak/ >>log.txt
cussbak/cuss/accept/accuseApply_save.jsp already exists. Overwrite it ?
[Y]es, [N]o, [A]ll, n[E]ver, [R]ename, [Q]uit
程序会询问是否覆盖。
ps:rar命令参数可以参看windows下winrar的帮助