ubuntu中如何解壓rar文件


1、問題

ubuntu中解壓rar文件, 如下:

root@PC1:/home/test2# ls
test.rar
root@PC1:/home/test2# unrar e test.rar -bash: /usr/bin/unrar: No such file or directory

 

2、解決方法, 安裝unrar

root@PC1:/home/test2# apt install unrar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  unrar
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get 113 kB of archives.
After this operation, 406 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/multiverse amd64 unrar amd64 1:5.6.6-2build1 [113 kB]
Fetched 113 kB in 5s (20.7 kB/s)
Selecting previously unselected package unrar.
(Reading database ... 219903 files and directories currently installed.)
Preparing to unpack .../unrar_1%3a5.6.6-2build1_amd64.deb ...
Unpacking unrar (1:5.6.6-2build1) ...
Setting up unrar (1:5.6.6-2build1) ...
update-alternatives: using /usr/bin/unrar-nonfree to provide /usr/bin/unrar (unrar) in auto mode
Processing triggers for man-db (2.9.1-1) ...

 

3、測試結果

root@PC1:/home/test2# ls
test.rar
root@PC1:/home/test2# unrar e test.rar ## unrar e rar文件 進行解壓rar文件

UNRAR 5.61 beta 1 freeware      Copyright (c) 1993-2018 Alexander Roshal


Extracting from test.rar

Extracting  test.txt                                                  OK
All OK
root@PC1:/home/test2# ls   ## 解壓成功
test.rar  test.txt

 

4、如何壓縮為rar文件?

root@PC1:/home/test2# ls
test.txt
root@PC1:/home/test2# rar a file.rar test.txt -bash: /usr/bin/rar: No such file or directory
root@PC1:/home/test2# ls
test.txt

 

5、安裝rar

root@PC1:/home/test2# apt install rar
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  rar
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get 295 kB of archives.
After this operation, 799 kB of additional disk space will be used.
Get:1 http://cn.archive.ubuntu.com/ubuntu focal/multiverse amd64 rar amd64 2:5.5.0-1build1 [295 kB]
Fetched 295 kB in 6s (46.9 kB/s)
Selecting previously unselected package rar.
(Reading database ... 219908 files and directories currently installed.)
Preparing to unpack .../rar_2%3a5.5.0-1build1_amd64.deb ...
Unpacking rar (2:5.5.0-1build1) ...
Setting up rar (2:5.5.0-1build1) ...
Processing triggers for man-db (2.9.1-1) ...

 

6、測試

root@PC1:/home/test2# ls
test.txt
root@PC1:/home/test2# rar a file.rar test.txt ## 壓縮為rar文件

RAR 5.50   Copyright (c) 1993-2017 Alexander Roshal   11 Aug 2017
Trial version             Type 'rar -?' for help

Evaluation copy. Please register.

Creating archive file.rar

Adding    test.txt                                                    OK
Done
root@PC1:/home/test2# ls    ## 壓縮成功
file.rar  test.txt

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM