5

I have installed unrar and have been using the command sudo 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?

  • where is the filename.rar located? – Avinash Raj May 10 '14 at 13:52
  • If you have rar installed and you can see the files inside it with archive mounter by double clicking it then you can extract it by right clicking and extract here option – Sudheer May 10 '14 at 13:52
  • 1
    Why sudo? It's pretty dangerous to unrar x with root permissions. – Takkat May 10 '14 at 14:15
  • Have you tried unrar x '/Full/Path/Fiename.rar'? – Sadi May 10 '14 at 16:00
  • @Sudheer :I have tried that and it says "an error occurred while extracting files". – Superpajamarama May 10 '14 at 22:33
7

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
  • Thank 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? – Superpajamarama May 10 '14 at 22:30
  • @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. – terdon May 10 '14 at 22:47
  • It'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... – Superpajamarama May 10 '14 at 22:58
  • @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 run unrar x ~/Desktop/foo/file.rar. – terdon May 10 '14 at 23:00
  • @tendon Oh yea sorry it's under /home/superpajamarama/Desktop/PS2 Games/Futurama.rar that is the full path I believe. – Superpajamarama May 10 '14 at 23:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.