如何在Fedora 30/29上安装Unrear

时间:2020-02-23 14:33:18  来源:igfitidea点击:

如何在Fedora 30/Fedora 29上安装UnRear。
Unrear是用于从RAR存档中提取文件的命令行工具。
出于不明原因的原因,Fedora在其存储库中没有未纳华套餐。

RPM融合存储库中提供了Unrear包。
RPM Fusion提供了Fedora项目或者Red Hat不想发货的软件。
对于所有当前的Fedora和Red Hat系统,该软件作为预编译RPM提供。

第1步:添加RPM Fusion存储库

在安装Unrear之前,我们需要手动将RPM Fusion存储库添加到系统。

Fedora 30:

sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-30.noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-30.noarch.rpm

Fedora 29:

sudo dnf install -y https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-29.noarch.rpm
sudo dnf install -y https://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-29.noarch.rpm

添加后,我们可以在Fedora上安装Unrear工具。

第2步:在Fedora上安装Unrear

使用DNF Packager Manager从RPM Fusion Repository将Fedora安装UnRear。

sudo dnf install -y unrar

在终端上执行Unsar以测试安装和检查使用页面。

$unrar        
UNRAR 5.71 beta 1 freeware      Copyright (c) 1993-2019 Alexander Roshal
Usage:     unrar <command> -<switch 1> -<switch N> <archive> <files...>
               <@listfiles...> <path_to_extract\>
<Commands>
  e             Extract files without archived paths
  l[t[a],b]     List archive contents [technical[all], bare]
  p             Print file to stdout
  t             Test archive files
  v[t[a],b]     Verbosely list archive contents [technical[all],bare]
  x             Extract files with full path
<Switches>
  -             Stop switches scanning
  @[+]          Disable [enable] file lists
  ad            Append archive name to destination path
  ag[format]    Generate archive name using the current date
  ai            Ignore file attributes
  ap<path>      Set path inside archive
  c-            Disable comments show
  cfg-          Disable read configuration
  cl            Convert names to lower case
  cu            Convert names to upper case
  dh            Open shared files
  ep            Exclude paths from names
  ep3           Expand paths to full including the drive letter
  f             Freshen files
  id[c,d,p,q]   Disable messages
  ierr          Send all messages to stderr
  inul          Disable all messages
  kb            Keep broken extracted files
  n<file>       Additionally filter included files
  Hyman@theitroad            Read additional filter masks from stdin
  Hyman@theitroad<list>      Read additional filter masks from list file
  o[+|-]        Set the overwrite mode
  ol[a]         Process symbolic links as the link [absolute paths]
  or            Rename files automatically
  ow            Save or restore file owner and group
  p[password]   Set password
  p-            Do not query password
  r             Recurse subdirectories
  sc<chr>[obj]  Specify the character set
  sl<size>      Process files with size less than specified
  sm<size>      Process files with size more than specified
  ta[mcao]<d>   Process files modified after <d> YYYYMMDDHHMMSS date
  tb[mcao]<d>   Process files modified before <d> YYYYMMDDHHMMSS date
  tn[mcao]<t>   Process files newer than <t> time
  to[mcao]<t>   Process files older than <t> time
  ts[m,c,a]     Save or restore file time (modification, creation, access)
  u             Update files
  v             List all volumes
  ver[n]        File version control
  vp            Pause before each volume
  x<file>       Exclude specified file
  Hyman@theitroad            Read file names to exclude from stdin
  Hyman@theitroad<list>      Exclude files listed in specified list file
  y             Assume Yes on all queries

用Unrear提取文件的完整性。

$unrar t myfile.rar
UNRAR 5.71 beta 1 freeware      Copyright (c) 1993-2019 Alexander Roshal

Testing archive myfile.rar
Testing     tut1.mp4                                                OK 
Testing     tut2.mp4                                                OK 
Testing     tut3.mp4                                                OK 
Testing     tut4.mp4                                                OK 
Testing     tut5.mp4                                                OK 
All OK

然后提取文件。

$unrar e myfile.rar 
UNRAR 5.71 beta 1 freeware      Copyright (c) 1993-2019 Alexander Roshal

Extracting from proxycerts.rar
Extracting  tut1.mp4                                                  OK 
Extracting  tut2.mp4                                                  OK 
Extracting  tut3.mp4                                                  OK 
Extracting  tut4.mp4                                                  OK 
Extracting  tut5.mp4                                                  OK 
All OK