unrar file.rar 解压rar 问题,找不到unrar 命令。安装rar unrar流程及bug处理

本文详细指导如何在Linux环境下遇到unrar报错时,通过安装和配置rar以及解决常见错误来确保解压操作顺利。涉及步骤包括切换用户权限、下载并安装rar、修复libstdc++.so.6等问题,以及针对不同错误类型的解决方案。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

在使用unrar e file.rar 解压时报错,需要安装rar

1.安装流程

1.1 用户

如果是root用户则不需要进行切换用户,否则 切换到root用户下【权限问题】

例如:$su root

1.2 下载

cd 指定路径,eg: cd /export/software
wget http://www.rarlab.com/rar/rarlinux-3.8.0.tar.gz

注:当我们使用 wget命令下载不安全的https 域名下的内容时会提示:

ERROR: cannot verify www.rarlab.com's certificate, issued by ‘/C=US/O=Let'sEncrypt/CN=R3’
 Issued certificate has expired. ... 

解决方法:sudo yum install -y ca-certificates,然后再重新wget下载 

1.3 安装

tar -zxvf rarlinux-3.8.0.tar.gz
cd rar
make
make install 

2.解决bug

2.1 报错1:

-bash: /usr/local/bin/unrar: /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory

是因为64位系统中安装了32位程序
解决方法:

yum install glibc.i686

 2.2 报错2 :

unrar: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory

 解决方法:

执行如下命令

yum install libstdc++.so.6

 2.3 报错3

在安装libstdc++.so.6时,会出现多版本问题。

Error:  Multilib version problems found. This often means that the root
       cause is something else and multilib version checking is just
       pointing out that there is a problem. Eg.:
       
         1. You have an upgrade for libstdc++ which is missing some
            dependency that another package requires. Yum is trying to
            solve this by installing an older version of libstdc++ of the
            different architecture. If you exclude the bad architecture
            yum will tell you what the root cause is (which package
            requires what). You can try redoing the upgrade with
            --exclude libstdc++.otherarch ... this should give you an error
            message showing the root cause of the problem.
       
         2. You have multiple architectures of libstdc++ installed, but
            yum can only see an upgrade for one of those architectures.
            If you don't want/need both architectures anymore then you
            can remove the one with the missing update and everything
            will work.
       
         3. You have duplicate versions of libstdc++ installed already.
            You can use "yum check" to get yum show these errors.
... ...

解决办法: 运行

yum install --setopt=protected_multilib=false libstdc++

 (最后的libstdc++可根据库的不同修改,如 libaio libgcc等)

最后,再次下载安装

yum install libstdc++.so.6 

3. 解决 rea.rar is not RAR archive 报错

[root@node1 python_scripts]# unrar e rea.rar 

UNRAR 3.80 freeware      Copyright (c) 1993-2008 Alexander Roshal

rea.rar is not RAR archive
No files to extract

经过检查是因为 unrar 的版本太低导致的,升级新版本后修复该问题

从这里下载最新版本到本地

WinRAR archiver, a powerful tool to process RAR and ZIP files

# 删掉原来的rar
cd /export/server
rm -rf rar

# 将下载的最新版本rar上传到linux上,解压安装
cd /export/software
tar -zxvf rarlinux-x64-611.tar.gz -C /export/server/

cd /export/server/rar
make 
make install

最后解决问题

评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值