EDIT: Putting this at the top because not everyone is seeing what I actually need. I can unpack the rar archive just fine. What I can’t do (on arm) is add to/update the files in the rar archive. I have unrar already installed. What I can’t install is the rar package to create/update rar archives.

So I’ve been banging my head against the wall for about half an hour trying to install the rar package from the multiverse repository on an Ubuntu 23.10 vm I have running on my m1 mac mini. I finally ended up on https://pkgs.org and searched up rar to see if I could download it directly instead of using apt.

And it was there I realized there’s no arm version of rar.

Side note, any recommendations for an arm utility that handles rar files? I already have unrar-free installed, but what I need is something to update/add files to existing rar files.

Worst case scenario I unrar them and then repackage them with tar or zip, but if I can just work with the rar archive, I’d prefer that.

Edit: I got excited for a second remembering that I’ve got rar installed via homebrew on that same m1 mac, but when I tried to install homebrew in the vm, I learned that homebrew doesn’t officially support arm.

    • @harsh3466OP
      link
      English
      910 months ago

      No idea. I didn’t choose rar. These are archives that I have to deal with.

      I’m doing a favor for a friend, and the files were given to me as rar archives. Obviously my first mistake was offering to help, though the reason I offered is because I’m learning scripting and regex. It’s a good challenge for me, and I’m learning stuff I didn’t know, so goal accomplished for me. Also none of this is paid or business/work related stuff. Just helping a friend out.

      Anyway, now that I’ve learned that rar is proprietary, I’m gonna see if they care if I convert them all to zip or tar. The scripting to convert them will be another good challenge and will avoid this rar problem.

      • Aatube
        link
        fedilink
        310 months ago

        If you’re gonna convert, probs convert to 7z.

      • Para_lyzed
        link
        2
        edit-2
        10 months ago

        The most compatible archive type is probably zip. Your friend is probably using WinRAR (why on Earth someone would use WinRAR in 2024 is beyond me), and it can handle standard .zip files just fine.

        Just do

        zip .zip    ...
        

        As an added bonus, you can list all the files in an unrar file (with unrar -l .rar), extract them to a specific directory, add them all into a zip file with the above command, and then empty the unzipped directory for the next .rar.

    • Atemu
      link
      fedilink
      410 months ago

      It can only do that with the unfree unrar plugin. Do not expect your distro to ship it by default due to that issue.

        • Atemu
          link
          fedilink
          110 months ago

          Damn rat files…

          I just opened a nix-shell with unrar in it on aarch64-linux and am able to execute it, so yes, it can be made to work.

    • @harsh3466OP
      link
      English
      410 months ago

      Thank you!! I will try that!!

  • bitwolf
    link
    fedilink
    710 months ago

    Can 7zip unrar? That’s my go-to form anything compression.

    • @harsh3466OP
      link
      English
      310 months ago

      Unrar isn’t the problem though. I’ve already installled unrar to read the file in the rar I need to modify.

      What I was looking for is rar so that I can modify the text in the file and update the rar archive.

    • @harsh3466OP
      link
      English
      310 months ago

      I do have unrar installed, but I’m not able to modify in place or add new files to the archive with it, which is the functionality I’m missing.

      • Atemu
        link
        fedilink
        410 months ago

        Indeed it won’t modify rar archives. What do you need those for?

        The typical flow for rar archives is to unpack them and then either leave the files on disk as plain files or put them into a better archive format such as 7z.

        • @harsh3466OP
          link
          English
          310 months ago

          My initial goal (before learning what a headache rar is) was to preserve the original file format. Now my plan is to convert them. I have to confer with my friend to see what format they’d prefer for the files. Probably end up using regular old zip.

  • @[email protected]
    link
    fedilink
    510 months ago

    You could install qemu-user and register it in binfmt in the vm, that lets you run programs for other architectures.

    • @harsh3466OP
      link
      English
      310 months ago

      This sounds interesting. I’m gonna look into it. Thank you!

  • @derphurr
    link
    410 months ago

    unar is the free version and should be in Ubuntu

    • @harsh3466OP
      link
      English
      210 months ago

      I’ve got unrar installed already, but what I want to be able to do is add/update files in the rar archives, which unrar can’t do.

      • Brownian Motion
        link
        210 months ago

        You need to enable non-free in sources, and install rar/unrar which are not the free version. (apt install unrar-nonfree)

        • @harsh3466OP
          link
          English
          110 months ago

          Thank you. I will try that.

  • 2xsaiko
    link
    fedilink
    4
    edit-2
    10 months ago

    the answer for “what can unpack this archive” is pretty much always: bsdtar from libarchive

    edit: sorry, I can’t read. libarchive unfortunately can’t write RAR archives.

  • Avid Amoeba
    link
    fedilink
    -2
    edit-2
    10 months ago

    As a last resort you could install docker from apt, build an image from a distro has rar in its arm repos, then run containers ephemerallly, mounting your work dir into the container where rar runs. Try the suggested methods of getting a binary first. 😅

    docker run --rm -v /your/work/dir:/destination/in/container your_image rar ...
    
    • @harsh3466OP
      link
      English
      310 months ago

      Haha. Definitely last resort. Having learned what a pain rar is due to its propriety nature, I’m going to see if they care if I convert them to tar or zip first.