Why can't I extract a .rar archive?
First of all, don't use sudo
for this. This can cause permissions issues and, when used in combination with x
which extracts the archive with the full path, might result in inadvertently overwriting important system files. Instead, just use unrar x file.rar
.
Now, the error you are getting is most likley because you have saved the file in directory X but are running the command from directory Y. For example, you have saved the file in /home/superpajamarama/Downloads
and are running the command from /home/superpajamarama/
.
To avoid this kind of thing, always use tab completion for file names in the terminal. Start typing the name of the file, and then hit tab:
unrar x file<TAB>
That will give you the possible completions and will let you know that the file is there.
Anyway, you need to either move into the correct directory, for example:
cd /home/superpajamarama/Downloads
unrar x filename.rar
Or give the full path to the file:
unrar x /home/superpajamarama/Downloads/filename.rar
In your case, the problem is that your path has a space in it. You need to either escape that space with a \
or quote the path:
unrar x "~/Desktop/PS2 Games/Futurama.rar"
or
unrar x ~/Desktop/PS2\ Games/Futurama.rar
Related videos on Youtube
Superpajamarama
Updated on September 18, 2022Comments
-
Superpajamarama over 1 year
I have installed
unrar
and have been using the commandsudo unrar x filename.rar
in the terminal but it gives me this error:No such file or directory, No file to extract
I have looked through all the answers of other people's questions and none of them are working for me. Any ideas?
-
Avinash Raj about 10 yearswhere is the filename.rar located?
-
Takkat about 10 yearsWhy
sudo
? It's pretty dangerous tounrar x
with root permissions. -
Sadi about 10 yearsHave you tried unrar x '/Full/Path/Fiename.rar'?
-
Superpajamarama about 10 years@Sudheer :I have tried that and it says "an error occurred while extracting files".
-
Superpajamarama about 10 years@Takkat :I have limited knowledge of this. So why is it dangerous to unrar whith root permissions?
-
Takkat about 10 yearsTerdon wrote all about issues from sudo + unrar in his nice answer
-
-
Superpajamarama about 10 yearsThank you for the explanation. It still seems not to be working. I went into properties of the the file and copied the file location, still thinks it doesn't exist. Could there be something wrong with the file?
-
terdon about 10 years@Superpajamarama not with the message you receive, that just means your are looking in the wrong place. Where is the file? In which directory? What's the exact command you tried that failed? The one where you used the location from the properties.
-
Superpajamarama about 10 yearsIt's weird, It's just sitting in a folder on my desktop. I went and copied the file location from properties of the file. I also tried using TAB like you said to complete the file name but to avail...
-
terdon about 10 years@Superpajamarama if tab failed, you're not looking in the right place. Could you tell me the exact location of the file and the exact command you ran as I asked please? If your file is in a folder called
foo
in your desktop, you want to rununrar x ~/Desktop/foo/file.rar
. -
Superpajamarama about 10 years@tendon Oh yea sorry it's under /home/superpajamarama/Desktop/PS2 Games/Futurama.rar that is the full path I believe.
-
terdon about 10 years@Superpajamarama Aaaa! OK, you have spaces in the path! Next time, please include the exact command and the exact error message. Had you done so, I would have realized that your file is called
foo bar
but the error was aboutfoo
. Anyway, try this:unrar x "~/Desktop/PS2 Games/Futurama.rar"
orunrar x "~/Desktop/PS2<TAB>
and it will autocomplete orunrar x ~/Desktop/PS2\ Games/Futurama.rar
-
Superpajamarama about 10 yearsOh right sorry about that thanks for the advice :P. It did the auto complete perfectly. The only thing is now, it's saying /home/superpajamarama/Desktop/PS2 Games/Futurama.rar is not RAR archive No files to extract... So is it a problem with the file now?
-
Freedo almost 4 yearshow do to this recursive? unrar -e -r *.rar doesn't work and unrar x *.rar also doesn't work
-
terdon almost 4 years@Freedo please ask a new question. Explain what you mean by recursive, include an example of the directory structure you want to recurse into and tell us exactly what "doesn't work" means.