Extracting SFX files in Linux

32,827

Solution 1

Use unrar to extract files from RAR SFX archives.

Like this: unrar x filename.sfx

Solution 2

For Linux Ubuntu 12.04 the following works:

$ chmod +x some_file.part1.sfx
$ ./some_file.part1.sfx

Solution 3

I came across a similar issue and since it hasn't been mentioned I'd thought to share it here.

On Ubuntu 17.10, I've got the following file:

file file.rar 
file.rar: RAR archive data, v5

Trying to extract it with unrar x file.rar told me that this is a SFX file:

unrar 0.0.1  Copyright (C) 2004  Ben Asselstine, Jeroen Dekkers
unknown archive type, only plain RAR 2.0 supported(normal and solid archives), SFX and Volumes are NOT supported!

However using (the separate from unrar) rar command (apt-get install rar) did the trick for me:

rar x file.rar

Solution 4

In Nautilus (File Browser), rename the .sfx part to .rar, then right-click and extract. Or double-click for more options.

Share:
32,827

Related videos on Youtube

Aaron
Author by

Aaron

Passionate software engineer with strong knowledge and experience in Linux, security, and databases.

Updated on September 18, 2022

Comments

  • Aaron
    Aaron 9 months

    I am trying to extract an SFX file under Linux Mint 15 (64 bit) but it's not working. I've done chmod +x on the file and tried to run it like a script with no luck (it gives me an error that there's no such file or directory. What's interesting is that this worked for me when I was running Linux Mint 14 (64 bit). I found an article that mentions glibc support and how newer distributions have removed 32 bit glibc binaries but I'm not quite sure if this is accurate in my case since I'm not running RHEL.

    EDIT: I forgot to mention that I tried the solution posted on that article but it did not fix my problem.

    I've also tried using 7z, 7za, unzip, and unzipsfx with no success. unzipsfx gives me the error "unzipsfx: cannot find myself! [unzipsfx]" which I find rather strange.

    A quick note: The sfx relies on six other archives in the rar format. I'm not dealing with zip, 7z, or any other format like that.

    Am I doing something wrong? Something must have changed between distributions since extracting worked fine for me before...

    • Alex P.
      Alex P. almost 10 years
      since you are talking rar sfx, have you tried unrar? also check the format version of your archive. if it's the new RAR5 - this would be the reason why your old tricks did not work.
    • Admin
      Admin almost 10 years
      Thanks Alex. Your suggestion of trying unrar did the trick. Figures, the one binary I didn't try to extract it ends up working :)
    • Admin
      Admin almost 10 years
      By the way, how would I go about checking the format version of the archive? I want to see if the files are of the new format that you talked about...
    • Alex P.
      Alex P. almost 10 years
      list the archive contents with unrar l archive.rar and the format version would be in the rightmost column. 2.9 = RAR4, 5.0 = RAR5
    • Aaron
      Aaron almost 10 years
      Okay thank you. It is in fact 2.9 so it's not the new format.
  • Aaron
    Aaron almost 10 years
    Thanks to you and Alex. This worked fine. I don't know why I didn't try this first. I guess I was confused as to why my old way didn't work anymore.
  • Artur Barseghyan
    Artur Barseghyan over 9 years
    That's strange. I did use it that way in past and just did it couple of minutes ago. Ubuntu 12.04 LTS modern.ie/en-us/virtualization-tools#downloads Here I got the sfx files (choose Linux and the archives).
  • Anthon
    Anthon over 9 years
    It should be possible if the header of the file is correct (ie. some sort of shebang or binary). Your answer came up for review, I had not heard of that, Googled and found that reference on wikipedia.
  • Anthon
    Anthon over 9 years
    I downloaded one of the files, I can unrar -l it and it is an executable according to 'file', but it cannot be run under Windows. So it seems there are multiple formats and I don't think you can use your solution if you have SFX file created for Windows. BTW this uncompresses to something only 1% bigger than the SFX file...
  • Artur Barseghyan
    Artur Barseghyan over 9 years
    Well, from the title of this topic "Extracting SFX files in Linux" I understood that it's about extracting the SFX files in Linux. If I'm not mistaken, on Windows RAR splits files into parts having the first one to be an executable (exe). I haven't tried to create SFX files on Windows and then unpack them on Linux. But, at least for certain SFX archives, the method mentioned above works on Linux (at least Debian).
  • Anthon
    Anthon over 9 years
    I assume the file, if made executable, would extract the contents. I just did not want to risk running such a unknown executable for which I have not seen the source on my system.
  • Artur Barseghyan
    Artur Barseghyan about 9 years
    SFX is by definition executable. en.wikipedia.org/wiki/Self-extracting_archive A self-extracting archive (SFX) is a computer executable program which contains data in an archive file combined with machine-executable program instructions to extract this information.
  • Len Smith
    Len Smith about 9 years
    unrar -x {filename.sfx}
  • hughes
    hughes almost 9 years
    unrar x filename.sfx (no dash before the x)
  • drodbar
    drodbar over 8 years
    Just for the record, it also worked for me using the unrar 4.20 version installed through macports on OSX, Mavericks 10.9.5,