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 Done
Building dependency tree
Reading Done
The following NEW packages will be installed:
unrar
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get113 kB of archives.
After this operation, 406 kB of additional disk space will be used.
Get:1 cn.archive.ubuntu/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) ...
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                                                    OK
All OK
root@PC1:/home/test2# ls  ## 解压成功
test.rar 
4、如何压缩为rar⽂件?
root@PC1:/home/test2# ls
<
root@PC1:/home/test2# rar a file.
-bash: /usr/bin/rar: No such file or directory
root@PC1:/home/test2# ls
<
5、安装rar
root@PC1:/home/test2# apt install rar
Reading Done
Building dependency tree
Reading Done
The following NEW packages will be installed:
rar
0 upgraded, 1 newly installed, 0 to remove and 98 not upgraded.
Need to get295 kB of archives.
After this operation, 799 kB of additional disk space will be used.
压缩文件怎么解压Get:1 cn.archive.ubuntu/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
<
root@PC1:/home/test2# rar a file.  ## 压缩为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                                                        OK
Done
root@PC1:/home/test2# ls    ## 压缩成功
file.rar