Scrivener 3.5.1 on Ubuntu Linux 22.04

Comments Off on Scrivener 3.5.1 on Ubuntu Linux 22.04

Scrivener seems like the best available option for epub production on Linux, so I decided to install it… There is a linked guide in the Scrivener forums (here) on which this is based, but Scrivener crashed twice during setup following it – several of the dialog boxes behaved very oddly – and when I got to the end of it I was presented with a black window that would, after a minute or so quit without doing anything. It took a bit of hunting around to work out why, and so here’s my version with the fixes I did.

So, I’m going to basically nick the nice guide’s commands (because last time I didn’t do that, the guides then disappeared) – I’m not going to bother explaining the nice way the original author did, because you can read his nice post. He also has screenshots, because he’s a fancy duck. I’m not going to do that or install a VM to recreate the experience (because honestly, I can’t be bothered). Oh, and this is assuming you have an x86 based linux box*.

I have presented this in more or less the order I did it – which is not the most efficient way to do this. I’ve tweaked it very slightly to avoid you running into Scrivener crashing during setup problem, but it’s pretty clear that you could fix skip installing the old version of Wine and hop straight to the new one. But since I didn’t test that I’m not going to put that as a “this works” set of instructions.

Oh, and you’re gonna need a terminal window and some comfort with typing in commands.

  1. Download Scrivener for Windows 64 bit version (3.5.1 is the version I have working).

Okay, fire up your terminal window and go to town:

  1. Enable i386 architecture

    sudo dpkg --add-architecture i386

  2. Update your sources

    sudo apt-get update

  3. Install Wine and some other dependencies

    sudo apt-get install winetricks wine64 wine32:i386 winbind -y


Okay… now here’s where I’m going to recommend that you do things slightly differently than I did. Because here I proceeded to “Installing Scrivener” and then ran into problems. I’m not willing uninstall it to test the theory that this order works better, nor do I want to spend the time to create a VM to test this theory. But I present to you the two options:

  • Following the semi-official instructions, go through the flaky – crashes multiple times – setup which worked for me after doing steps 5-7 to fix its not-working state. If you wanna do that, do steps 8-11 and then come back and do 5-7 if it doesn’t work.

Or

  • Do these steps 5-6 first, then install Scrivener. This should skip the crashing during setup issues I had, and the well this doesn’t work disappointment of the official instructions. I have not tested this option, but it’s what I’d do knowing what I do now. YMMV.

  1. Upgrade Wine – Wine in the Ubuntu repositories is ooold, and a more modern version seems to be required for Scrivener to work now. This requires a few steps:
    • Install more required packages to allow WineHQ’s own version to install. You could probably merge this with step 4.

      sudo apt install dirmngr ca-certificates software-properties-common apt-transport-https curl -y

    • Add the WineHQ repository to your list of approved places to get software from

      curl -s https://dl.winehq.org/wine-builds/winehq.key | sudo gpg --dearmor | sudo tee /usr/share/keyrings/winehq.gpg > /dev/null

    • Import that repository that you just added

      echo deb [signed-by=/usr/share/keyrings/winehq.gpg] http://dl.winehq.org/wine-builds/ubuntu/ jammy main | sudo tee /etc/apt/sources.list.d/winehq.list

    • Update your sources

      sudo apt-get update

    • Install the new shiny version of Wine over the top of your archaic one

      sudo apt install winehq-stable --install-recommends

    • You can check this worked with the command

      wine --version

      Which on my system today says Wine 9.0

  2. Upgrade Winetricks

    sudo winetricks --self-update

  3. Now while Scrivener will/should work on Windows 7, which is how Wine likes to present itself by default, it works better on Windows 10. It also requires dotnet to activate the licence, apparently. I’m still using the test version. BTW, Firing off this command will present you with a bunch of Windows installs to run through and should tell wine to identify itself as Windows 10.

    winetricks --force corefonts win10 dotnet48

Okay. Now you’ve put in all the prerequisites, you can install and setting up Scrivener:

  1. Run the Scrivener installer in Wine – Ryan recommends moving the default install location to C:/Scrivener for ease of use. And don’t let it install desktop icons (they won’t work).

    wine ~/Downloads/Scrivener-installer.exe

  2. Delete Scrivener’s own Text to speech. It’s broken and causes the application to hang in Wine.

    cd ~/.wine/drive_c/scrivener

    rm -rf texttospeech/

  3. Create a script in your home directory to fire up Scrivener so you don’t have to type out the long command each time (Ryan recommends using vi. I’m not going to do that to you; if you’re happy using vi go ahead, but it’s not exactly friendly to people who might be at the level of needing this guide).

    cd ~

    nano scriv.sh

    • Type this into the first line in your nice empty text file:

      cd ~/.wine/drive_c/scrivener && /usr/bin/wine Scrivener.exe

    • Hit [Ctrl+O] to save
    • Hit [Ctril+X] to exit
  4. Make your shiny new script executable (a thing you can run as a program)

    chmod 0700 scriv.sh

Now from your command line if you type ./scriv.sh you should have Scrivener working.

Feel free to tell me if you don’t. Don’t expect me to fix it…

* If you don’t know what x86 means, as long as it’s a ‘proper laptop’ and doesn’t have an apple logo on it you’re probably fine. If you’re trying to do this on a repurposed chromebook, ???? ????? (?Allah yahfazak). Theoretically, I think you could get this working on an ARM/apple silicon based linux box using QEMU. When my MNT Pocket Reform arrives I may do that, just for shits and giggles. If I do I’m sure I’ll do another high quality guide like this.

KateWE

Kate's allegedly a human (although increasingly right-wing bigots would say otherwise). She's definitely not a vampire, despite what some other people claim. She's also mostly built out of spite and overcoming oppositional-sexism, racism, and other random bullshit. So she's either a human or a lizard in disguise sent to destroy all of humanity. Either way, she's here to reassure that it's all fine.