Cp:can't create regular file`/bin/rar':per. denied

software development

#1

Hello , I have .rar files on my host that I want to unrar them ( some are password-protected ) …

when I’m trying to enable using the command unrar in my hosting … I used these commands ( through Putty ssh ) :

cd /tmp
wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
cp rar unrar /bin

but it returned me this error :
cp: cannot create regular file `/bin/rar’: Permission denied

some one has told me that you can enter as a super admin using su - , I tried my hosting password but it failed .
Any help ?


#2

You’re not root
so you can add a new binary to the Whole machine.

I instead try.
to make in my home a bin/
and put unrar there and also change the path to add your own binaries

Even faster.
mkdir tmp/ (on my home)
cd tmp/
wget http://www.rarlab.com/rar/rarlinux-3.6.0.tar.gz
tar -zxvf rarlinux-3.6.0.tar.gz
cd rar
./rar pathtoyourrarfile

Better ~/tmp/rar/rar filetounrar.rar

Regards.


use VICM3 for a full 97USD discount on your first year!


#3

Did that but returns me that error when tring to unrar :
unrar: error while loading shared libraries: libstdc++.so.6: cannot open shared object file: No such file or directory


#4

Ok, here is a solution…

get the deb package for rar (can be done searching on packages.debian.org) for fast you find this:
http://http.us.debian.org/debian/pool/non-free/u/unrar-nonfree/unrar_3.5.2-0.1_i386.deb

wget it

then deb packages can be extracted by issuing this command at the command line.

$dpkg-deb -x {deb-package name} {target directory}

so I used rar as target directory.

tmp/rar/usr/bin/rar
./unrar

UNRAR 3.50 beta 3 freeware Copyright © 1993-2005 Alexander Roshal

Usage: unrar -<switch 1> - <files…>
<@listfiles…> <path_to_extract>

I hope this fix your troubles.


use VICM3 for a full 97USD discount on your first year!


#5

Just FYI, the rar program is already installed on all (or at least most) of the DreamHost servers. Unless you need the absolute latest version for whatever reason, you shouldn’t have to install it at all.


Chips N Cheese - Custom PHP installs and the like!


#6

Fantastic , I tried the dreamhost rar archive extraction and it works definitely awesome !

Thanks for all who helped me out , vicm3 and Mousee … You rock guys