A Mostly Complete Guide to Installing Scrivener on Linux

A Mostly Complete Guide to Installing on Linux

This was originally posted by: Steven Saus (uriel1998) from Alliteration Ink http://www.alliterationink.com
Steven is, in his own words, an Author, Publisher, eBook Converter (and some other stuff too)

It was so good I wanted to post it here in a prominent position for all to benefit from Steven’s helpful post. Here’s the post:

Disclaimer: I’m not affiliated with L&L. They can change things at any time. I bear no responsibility for anything that happens when you follow these instructions, unless it is TOTALLY KEWL. That said, I’ve followed these instructions myself (Ubuntu 10.04|Openbox/Gnome 2) for both the tarball and the debian package.

These instructions should:

  1. Install Scrivener on your Linux box.
  2. Provide a launcher on your desktop or where a launcher like Kupfer/Gnome-Do/Launchy can get to it.
  3. Provide an (unofficial) icon that I mocked up a while back with Tux on it.

Check for the latest install (while we’re still in beta) from the top forum post here.

If you’re using a tarball, read the quoted section below:

If you’re installing from a .deb, .rpm, etc, read the quoted section below.

Save the attached icon to /home/(your username)/.icons/Scrivener_Logo.png
Scrivener_Logo.png

Then create the file below. Edit the Exec name to match the location of your binary.

NOTE: You could instead have this file as
/home/(your username)/.local/share/applications/Scrivener.desktop
which won’t show up on your desktop, but will let most launcher applications easily find it. Or, if you installed from the .deb (I presume the .rpm is the same), the installed launcher is located at
/usr/share/applications/Scrivener.desktop
and you can edit that file with whatever text editor you like.

/home/(your username)/Desktop/Scrivener.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Encoding=UTF-8
Name=Scrivener
Type=Application
Icon=/home/(your username)/.icons/Scrivener_Logo.png
Exec=/usr/bin/Scrivener %U
Terminal=false
Categories=Application;Office;

Some folks had problems on KDE running as a normal user. TRY RUNNING WITHOUT ROOT ACCESS FIRST. Running with root permissions is A Bad Idea (see http://www.psychocats.net/ubuntu/graphicalsudo for why this can end up borking your system.) Honestly, if you find that you’re having to run something like Scrivener as root, there’s a deeper problem with file permissions on your system. Seriously. (Or library variables, which might be why the KDE folks are having issues. Still…)

But… if you find that you will need root access, add gksudo (for Gnome) or kdesudo (for KDE) to the “Exec” line in the launcher above. Example:

FOR KDE:
Exec=kdesudo /usr/bin/Scrivener %U

FOR GNOME:
Exec=gksudo /usr/bin/Scrivener %U

Still having problems? Check the forums for help. There’s a wide variety of folks running a wide variety of flavors of linux, and if you manage to make it work, share what you did.

Revisions:

  • Added link to top of forums
  • Added note about gdebi-gtk
  • Added location of installed .desktop from .deb

I ran into a little problem running trying to run Scrivener on Ubuntu 12.04.01 LTS (Precise Pangolin), so I thought I’d post the solution here.

When trying to run scrivener.sh (as given above), I got this message:

Scrivener: no such file or directory

even though I could clearly see the file in folder view and when using the ls command.

With a little digging I found the solution to this similar problem, which explains why it wasn’t able to recognize the file: it is a 32-bit executable and I’m trying to use it on a 64-bit machine. The solution was to install ia32-libs (available through the Ubuntu Software Center). After doing that, Scrivener opened just as it should.

Hope this helps others!

Attempting to run Scrivener on an Acer Aspire One 722 under Peppermint Three.

Tried 1.2.6 and the latest beta - both appear to install, icon shows under Office apps, but nothing happens when I click it. Nada. Zilch.

I have successfully run Scrivener under Windows and various other Linux flavours.

I found a couple of other things I could not install under Peppermint, so as I am on a deadline, I gave up and installed WattOS over it - and now have a fully working Scrivener installation, thanks to the latest beta and GDebi.

So here is just a very basic question. I have installed Ubuntu on my brand new Chromebook and have been trying to install Scrivener. I have been unsuccessful so far, and in reading the posts here, I noticed one message that Scrivener will not work on an ARM-based Chromebook. I am writing just to confirm this. Is true that I should not bother any more trying to get it work? If so, is there any possibility of being able to use Scrivener via Ubuntu on a Chromebook? Thanks.

Linux Mint 14.1 64 Cinnamon 1.6 (Both to become Mint 15 and Cinnamon 1.8 when released).
PC died, stuck with Win 8, moved to Mint, lost writing program = newbie looking at Scrivener.
I realize that Scrivener is a beta. Beta plus newbie is not good. Yet, I see others have installed it.
Direction (kindergartner) would be appreciated.

Thanks,
Mist
Newbies get better.

It won’t install at all on Mint 14. Package manager just freezes.

GDebi Package Installer may help in manual installation of *.deb packages. If there is a freeze you will at least get a report.

Hi,

No report, unfortunately. It just freezes. The graphical front-end appears, then nothing else. Is there a way of just downloading the package?

Update - found the download link - literatureandlatte.com/scriv … 1-beta.deb
and downloaded the package. I had assumed that the package would be downloaded automatically :confused:

Clicking on the package installed it using gdebi - no problems. Now running well.

Running nicely on Dell 1545 under Mint 15, and on Travelmate 4230 also under Mint 15 (fast becoming my favourite distro) but why does it STILL say on the installation notes, “Beta - expires. Jul 31, 2012” ?

up and running

Acer C7
Ubuntu 12.04 LTS
beta

It did help, Kona, thanks, but it didn’t go all the way. One has to reinstall the deb file with the parameter --force-architecture. See other posts in this forum.

I’d like to add my notes for getting a complete (for my purposes) install of Scrivener on 64-bit Linux.

bash$ lsb_release -d Description: Ubuntu 12.04.2 LTS bash$ uname -r -m 3.5.0-18-generic x86_64

A. Kindlegen

Download the utility from http://www.amazon.com/gp/feature.html?docId=1000765211 (the 32-bit version for 2.x kernels is fine).

Unpack the tarball and copy the utility wherever you like, but make sure it is named kindlegen.bin instead of kindlegen (the Scrivener File-Select dialog box has a mask that requires a file extension). It is convenient to make a symlink named ‘kindlegen’ for Linux-specific applications that might use this.

cd /tmp tar -zxf ~/downloads/kindlegen_linux_2.6_i386_v2_9.tar.gz sudo cp kindlegen/kindlegen /usr/local/bin/kindlegen.bin sudo ln -s /usr/local/bin/kindlegen.bin /usr/local/bin/kindlegen

B. Multimarkdown

Attempting to compile a Multimarkdown document results in an error message stating that the multimarkdown utility is not installed, and that you should run sudo apt-get install libtext-multimarkdown-perl in order to install it.

This multimarkdown utility, however, is incompatible with the command-line invocation performed by Scrivener. You will get an error dialog saying “Unknown error”, and the following message on the command line (you did run Scrivener from the command line for debugging purposes, didn’t you?) :

The fix? Uninstall the libtext-multimarkdown-perl package (if you indeed installed it), and instead install the multimarkdown utility from https://github.com/fletcher/peg-multimarkdown . This utility supports the options that Scrivener expects.

The commands (run in your home directory):

git clone git://github.com/fletcher/peg-multimarkdown.git cd peg-multimarkdown ./update_submodules.sh git submodule update make sudo cp multimarkdown /usr/local/bin cd .. rm -r peg-multimarkdown

Assuming you have git installed, this should “just work”: Latex files can now be generated.

C. GNOME-Keyring

On LTS systems (such as mine), the following error message may appear on the console when Scrivener starts up:

This is a fairly harmless message, and most users can ignore it. To get rid of the message, download the 32-bit package for gnome-keyring, unpack it, and copy the missing library to the expected location.

The 32-bit .deb package for gnome-keyring can be downloaded from the Ubuntu repositories at https://launchpad.net/ubuntu/precise/i386/gnome-keyring/3.2.2-2ubuntu4.1 .

cd /tmp mkdir gnome-keyring cd gnome-keyring dpkg -x ~/downloads/gnome-keyring_3.2.2-2ubuntu4.1_i386.deb . sudo cp -r usr/lib/i386-linux-gnu/pkcs11/ /usr/lib/i386-linux-gnu/ cd .. rm -r gnome-keyring

Note that this is a brute-force installation of the library, and does not perform any of the apt or dpkg dependency checks (which fail due to an “uninstallable” libgcr-3-common:i386 package). It seems to work fine at runtime.

D. Spelling

A local copy of a 32-bit aspell can be installed in the LiteratureAndLatte directory tree, and configured to run locally.

Download the .deb files for the following packages:
aspell:i386 http://packages.ubuntu.com/precise/i386/aspell/download
libaspell15:i386 http://packages.ubuntu.com/precise/i386/libaspell15/download

  1. Unpack aspell and libaspell15.
cd /tmp
mkdir aspell libaspell
dpkg -x ~downloads/aspell*_i386.deb aspell
dpkg -x ~downloads/libaspell15*_i386.deb libaspell
  1. Seed the lib/aspell directory with a copy of the one in /usr/lib/aspell
sudo cp -r /usr/lib/aspell /usr/local/LiteratureAndLatte/lib
  1. Copy aspell and libaspell into the LiteratureAndLatte directory tree.
sudo cp -i aspell/usr/bin/* /usr/local/LiteratureAndLatte/bin/
sudo cp -r libaspell/usr/lib/aspell/* /usr/local/LiteratureAndLatte/lib/aspell/
sudo cp libaspell/usr/lib/libaspell.so.15.2.0 libaspell/usr/lib/libpspell.so.15.2.0 /usr/local/LiteratureAndLatte/lib
  1. Create symlinks so all the tools work properly
sudo ln -s /usr/local/LiteratureAndLatte/lib/libaspell.so.15.2.0 /usr/local/LiteratureAndLatte/lib/libaspell.so
sudo ln -s /usr/local/LiteratureAndLatte/lib/libaspell.so.15.2.0 /usr/local/LiteratureAndLatte/lib/libaspell.so.15
sudo ln -s /usr/local/LiteratureAndLatte/lib/libaspell.so.15.2.0 /usr/lib/i386-linux-gnu/libaspell.so
sudo ln -s /usr/local/LiteratureAndLatte/lib/libpspell.so.15.2.0 /usr/local/LiteratureAndLatte/lib/libpspell.so
sudo ln -s /usr/local/LiteratureAndLatte/lib/libpspell.so.15.2.0 /usr/local/LiteratureAndLatte/lib/libpspell.so.15
sudo ln -s /usr/local/LiteratureAndLatte/lib/libpspell.so.15.2.0 /usr/lib/i386-linux-gnu/libpspell.so
  1. Build 32-bit versions of the dictionaries in the LiteratureAndLatte directory tree.
    a) replace symlinks with actual dictionary files
sudo rm /usr/local/LiteratureAndLatte/lib/aspell/*.rws
sudo cp /var/lib/aspell/*.rws /usr/local/LiteratureAndLatte/lib/aspell/

b) Create a shell script to rebuild the dictionaries using the 32-bit aspell install

echo '#!/bin/sh' > /tmp/gen_32_aspell_dicts.sh
echo "ASPELL_CONF='prefix /usr/local/LiteratureAndLatte'" >> /tmp/gen_32_aspell_dicts.sh
echo 'PATH="/usr/local/LiteratureAndLatte/bin:$PATH"' >> /tmp/gen_32_aspell_dicts.sh
echo export PATH ASPELL_CONF >> /tmp/gen_32_aspell_dicts.sh
chmod +x /tmp/gen_32_aspell_dicts.sh
sudo /usr/sbin/aspell-autobuildhash --dry-run  --force 2>&1 | grep zcat | sed -e 's/var\/lib/usr\/local\/LiteratureAndLatte\/lib/' -e 's/usr\/lib/usr\/local\/LiteratureAndLatte\/lib/' >> /tmp/gen_32_aspell_dicts.sh

NOTE: This last command is very important to get right. I have created a pastebin for the command so that you can be sure to copy and paste it correctly: http://pastebin.com/JFGjnsjT.

An example shell script, for non-Ubuntu users, is available here: http://pastebin.com/sXbTTwAq . Be sure to modify it to suit your local system.

c) Execute the shell script as root

sudo bash /tmp/gen_32_aspell_dicts.sh
  1. Remove the downloaded files.
cd /tmp
rm -r aspell ispell
rm ~/downloads/libaspell*_i386.deb ~/downloads/aspell*_i386.deb
  1. Create a shell script for launching Scrivener with the aspell options set correctly.
echo '#!/bin/sh' > /tmp/scrivener.64
echo "ASPELL_CONF='prefix /usr/local/LiteratureAndLatte'" 'PATH="/usr/local/LiteratureAndLatte/bin:$PATH"' 'scrivener &' >> /tmp/scrivener.64
chmod +x /tmp/scrivener.64
sudo cp /tmp/scrivener.64 /usr/local/LiteratureAndLatte/bin/
  1. Enjoy!
/usr/local/LiteratureAndLatte/bin/scrivener.64

The commandline-averse among you may want to create a .desktop file for this.

UPDATE: I realized I was working off a tarball of Scrivener, and installed the .deb package. This includes the file /usr/share/scrivener/bin/scrivener.sh , which is a much better startup script than I provided in step 7. The above steps can be applied to /usr/share/scrivener instead of /usr/local/LiteratureAndLatte , and the scrivener.sh script modified as follows:

bindir=`dirname "$me"`
libdir=`cd "$bindir/../lib" ; pwd`
LD_LIBRARY_PATH=$libdir
export LD_LIBRARY_PATH
# ======================================
# Add these three lines here:
basedir=`cd "$bindir/.." ; pwd`
ASPELL_CONF="prefix $basedir"
export ASPELL_CONF
# ======================================
unset QT_PLUGIN_PATH
exec "$bindir/Scrivener" ${1+"$@"}   

OLD, DANGEROUS, BRUTE-FORCE METHOD (retained for posterity)

[i]
The following code will replace the 64-bit aspell .so files and binaries with 32-bit ones, and rebuild the system dictionaries to be 64-bit – without removing the 64-bit aspell dependency from the package manager.

After making these changes, a 32-bit installation of Scrivener will have a working aspell-based spellchecker on a 64-bit system. A handful of 64-bit applications (Firefox, Thunderbird, Open Office, Opera) have been tested, and (unexpectedly) continue to work fine after these changes.

WARNING These changes will make your system non-standard, may break spell-checking in some 64-bit applications, and may be overwritten during a system upgrade. USE AT YOUR OWN RISK.

Download the .deb files for the following packages:
aspell:i386 http://packages.ubuntu.com/precise/i386/aspell/download
aspell-en:all http://packages.ubuntu.com/precise/aspell-en
libaspell15:i386 http://packages.ubuntu.com/precise/i386/libaspell15/download

  1. Unpack aspell and libaspell15.
cd /tmp
mkdir aspell libaspell
dpkg -x ~downloads/aspell*_i386.deb aspell
dpkg -x ~downloads/libaspell15*_i386.deb libaspell
  1. Copy libaspell into the system 32-bit library location.
sudo cp usr/lib/libaspell.so.15.2.0 /usr/lib/i386-linux-gnu/
sudo ln -s /usr/lib/i386-linux-gnu/libaspell.so.15.2.0 /usr/lib/i386-linux-gnu/libaspell.so.15
sudo ln -s /usr/lib/i386-linux-gnu/libaspell.so.15.2.0 /usr/lib/i386-linux-gnu/libaspell.so
sudo cp usr/lib/libpspell.so.15.2.0 /usr/lib/i386-linux-gnu/
sudo ln -s /usr/lib/i386-linux-gnu/libpspell.so.15.2.0 /usr/lib/i386-linux-gnu/libpspell.so.15
sudo ln -s /usr/lib/i386-linux-gnu/libpspell.so.15.2.0 /usr/lib/i386-linux-gnu/libpspell.so
  1. Replace the support binaries in /usr/lib/aspell with 32-bit versions
sudo cp -r libaspell/usr/lib/aspell /usr/lib/aspell.orig
sudo cp -r libaspell/usr/lib/aspell/*.so /usr/lib/aspell/
sudo cp -r libaspell/usr/lib/aspell/*spell /usr/lib/aspell/
  1. Replace the executables in /usr/bin with 32-bit versions (optional).
sudo mv /usr/bin/aspell /usr/bin/aspell.orig
sudo mv /usr/bin/aspell-import /usr/bin/aspell-import.orig
sudo mv /usr/bin/precat /usr/bin/precat.orig
sudo mv /usr/bin/prezip /usr/bin/prezip.orig
sudo mv /usr/bin/preunzip /usr/bin/preunzip.orig
sudo mv /usr/bin/prezip-bin /usr/bin/prezip-bin.orig
sudo mv /usr/bin/run-with-aspell /usr/bin/run-with-aspell.orig
sudo mv /usr/bin/word-list-compress /usr/bin/word-list-compress.orig
sudo cp aspell/usr/bin/* /usr/bin/
  1. Reinstall the dictionaries. This will build 32-bit dictionaries (readable by 64-bit aspell libraries as well, as per http://aspell.net/0.61/man-html/Using-32_002dBit-Dictionaries-on-a-64_002dBit-System.html).
sudo dpkg -i ~/downloads/aspell-en*.deb
  1. Remove the downloaded files.
cd /tmp
rm -r aspell ispell
rm ~/downloads/libaspell*_i386.deb ~/downloads/aspell*_i386.deb

Note that these steps are non-destructive: you can always roll back the changes by restoring the files named .orig.[/i]

Apparently, it’s impossible to install Scrivener on the current 64-bit Ubuntu.

The OP of that thread suggests installing an entire additional (but 32-bit) operating system, which, IMHO, is absolutely crazy.

I wish someone had just told us that Scrivener won’t work on the current 64-bit Ubuntu, and, that would have saved us all a lot of lost time and effort. If we’re gonna install a whole new operating system, we may as well dual-boot Windows, rather than having two differnet Linux operating systems, one of which is just for running Scrivener. Sigh.

Just successfully installed Scrivener 1.6.1.1 beta on a IBM Lenovo 3000 C100 - 512MB | 1,5GHZ running ElementaryOS!
Scrivener is running smoothly as it can be. :smiley:

Thanks for all the hacking tips. I succeeded to install kindle reader after that. I used the linking method to rebuild the 32bits aspell dictionaries, and now they show up in language selection. but the spellcheck itself seems unable to work… no clue running from a terminal… I may have not gotten all the files in the correct location.

I finally got the spellcheck fully operational in a nested install of Quintall 32 bits. Now it is working fine.

Scrivener is a wonderful software and it is a chance for the community to get it running on the Linux system in the best way.

To help users who got some difficulties installing the speller I’ve updated the procedure of edf
and add improvements allowing me to install the spelling. Here the procedure works for ubuntu/debian systems (.deb package).

With this procedure :
There is no need to install another instance of ubuntu in 32bits
nor create a chrooted 32bits environment to installed scrivener in it.

This procedure is based on the detailed previous one, but I’ve encounter issues that
I’ve solved here adding the improvements and provide more details to help
the users to understand their issues.

To get the speller working with ubuntu 12.04 to 13.10 in 64 bits mode :

The procedure :
Install scrivener with the ia32 dependencies (in my case I’ve installed skype
with synaptic, it adds automatically the 32 bits dependencies) :

Download the .deb package and install it with dpkg :

cd /tmp wget http://www.literatureandlatte.com/scrivenerforlinux/scrivener-1.6.1.1-beta.deb sudo dpkg -i scrivener-1.6.1.1-beta.deb

Post scrivener installation to allow the access from your user account (replace fred by your user name) :

sudo chown -R root:fred /usr/share/scrivener sudo chmod -R 771 /usr/share/scrivener

Now we need to get the missing dependencies in 32 bits :

Download the aspell packages with the shared library:

http://packages.ubuntu.com/precise/i386/aspell/download
http://packages.ubuntu.com/precise/i386/libaspell15/download

Download two other missing shared libraries :

http://packages.ubuntu.com/precise/i386/libncursesw5/download
http://packages.ubuntu.com/fr/precise/i386/libtinfo5/download

[code]cd /tmp
mkdir aspell libaspell libncursesw5 libtinfo5
dpkg -x ~downloads/aspell*_i386.deb aspell
dpkg -x ~downloads/libaspell15*_i386.deb libaspell
dpkg -x ~downloads/libncursesw5_5.9-4_i386.deb libncursesw5
dpkg -x ~downloads/libtinfo5_5.9-4_i386.deb libtinfo5

cp -r /usr/lib/aspell /usr/share/scrivener/lib

sudo cp -i aspell/usr/bin/* /usr/share/scrivener/bin/
sudo cp -r libaspell/usr/lib/aspell/* /usr/share/scrivener/lib/aspell/
sudo cp libaspell/usr/lib/libaspell.so.15.2.0 libaspell/usr/lib/libpspell.so.15.2.0 /usr/share/scrivener/lib
sudo cp libncursesw5/lib/i386-linux-gnu/libncursesw.so.5.9 /usr/share/scrivener/lib/
sudo cp libtinfo5/lib/i386-linux-gnu/libtinfo.so.5.9 /usr/share/scrivener/lib/[/code]

Creation of the symbolic links :

[code]# get root
sudo su
cd /usr/share/scrivener/lib

ln -s libaspell.so.15.2.0 libaspell.so
ln -s libaspell.so.15.2.0 libaspell.so.15
ln -s libpspell.so.15.2.0 libpspell.so
ln -s libpspell.so.15.2.0 libpspell.so.15

ln -s libtinfo.so.5.9 libtinfo.so
ln -s libtinfo.so.5.9 libtinfo.so.5
ln -s libncursesw.so.5.9 libncursesw.so
ln -s libncursesw.so.5.9 libncursesw.so.5

rm /usr/share/scrivener/lib/aspell/.rws
cp /var/lib/aspell/
.rws /usr/share/scrivener/lib/aspell/

exit[/code]

The new scripts add some variables to the previous one :

echo '#!/bin/sh' > /tmp/gen_32_aspell_dicts.sh echo "ASPELL_CONF='prefix /usr/share/scrivener'" >> /tmp/gen_32_aspell_dicts.sh echo 'PATH="/usr/share/scrivener/bin:$PATH"' >> /tmp/gen_32_aspell_dicts.sh echo 'LD_LIBRARY_PATH="/usr/share/scrivener/lib:$LD_LIBRARY_PATH"' >> /tmp/gen_32_aspell_dicts.sh echo 'AC_CONF="/usr/share/scrivener"' >> /tmp/gen_32_aspell_dicts.sh echo export ASPELL_CONF PATH LD_LIBRARY_PATH >> /tmp/gen_32_aspell_dicts.sh chmod +x /tmp/gen_32_aspell_dicts.sh sudo /usr/sbin/aspell-autobuildhash --dry-run --force 2>&1 | grep zcat | sed -e 's/var\/lib/usr\/share\/scrivener\/lib/' -e 's/usr\/lib/usr\/share\/scrivener\/lib/' >> /tmp/gen_32_aspell_dicts.sh

It creates a new script which look like that (this is my example do not execute it) :

[code]#!/bin/sh
ASPELL_CONF=‘prefix /usr/share/scrivener’
PATH="/usr/share/scrivener/bin:$PATH"
LD_LIBRARY_PATH="/usr/share/scrivener/lib:$LD_LIBRARY_PATH"
AC_CONF="/usr/share/scrivener"
export ASPELL_CONF PATH LD_LIBRARY_PATH

zcat /usr/share/aspell/en-common.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-common.rws
zcat /usr/share/aspell/en-variant_0.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-variant_0.rws
zcat /usr/share/aspell/en-variant_1.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-variant_1.rws
zcat /usr/share/aspell/en-variant_2.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-variant_2.rws
zcat /usr/share/aspell/en-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-w_accents-only.rws
zcat /usr/share/aspell/en-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en-wo_accents-only.rws
zcat /usr/share/aspell/en_CA-variant_0.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-variant_0.rws
zcat /usr/share/aspell/en_CA-variant_1.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-variant_1.rws
zcat /usr/share/aspell/en_CA-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-w_accents-only.rws
zcat /usr/share/aspell/en_CA-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_CA-wo_accents-only.rws
zcat /usr/share/aspell/en_GB-ise-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ise-w_accents-only.rws
zcat /usr/share/aspell/en_GB-ise-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ise-wo_accents-only.rws
zcat /usr/share/aspell/en_GB-ize-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ize-w_accents-only.rws
zcat /usr/share/aspell/en_GB-ize-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-ize-wo_accents-only.rws
zcat /usr/share/aspell/en_GB-variant_0.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-variant_0.rws
zcat /usr/share/aspell/en_GB-variant_1.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_GB-variant_1.rws
zcat /usr/share/aspell/en_US-w_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_US-w_accents-only.rws
zcat /usr/share/aspell/en_US-wo_accents-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=en create master /usr/share/scrivener/lib/aspell/en_US-wo_accents-only.rws
zcat /usr/share/aspell/fr-40-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr-40-only.rws
zcat /usr/share/aspell/fr-60-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr-60-only.rws
zcat /usr/share/aspell/fr-80-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr-80-only.rws
zcat /usr/share/aspell/fr_CH-only.cwl.gz | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=/usr/share/scrivener/lib/aspell --lang=fr create master /usr/share/scrivener/lib/aspell/fr_CH-only.rws[/code]

Lanch the generated script :

sudo sh /tmp/gen_32_aspell_dicts.sh

I’ve made some modifications on the previous scripts to add path to the shared libraries
in order to solved the error : wrong ELF class: ELFCLASS64

If you already have the ELFCLASS64 error (which means that a 32 bits program try to load a 64 bits shared library), verify there is no missing dependencies with the load libraries command :

ASPELL_CONF='prefix /usr/share/scrivener' PATH="/usr/share/scrivener/bin:$PATH" LD_LIBRARY_PATH="/usr/share/scrivener/lib:$LD_LIBRARY_PATH" AC_CONF="/usr/share/scrivener" export ASPELL_CONF PATH LD_LIBRARY_PATH ldd /usr/share/scrivener/bin/aspell

You must get something like that :
linux-gate.so.1 => (0xf7725000)
libaspell.so.15 => /usr/share/scrivener/lib/libaspell.so.15 (0xf766e000)
libncursesw.so.5 => /usr/share/scrivener/lib/libncursesw.so.5 (0xf763e000)
libtinfo.so.5 => /usr/share/scrivener/lib/libtinfo.so.5 (0xf761e000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0xf751a000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0xf7366000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0xf7361000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0xf731e000)
/lib/ld-linux.so.2 (0xf7726000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0xf7300000)

No dependencies are missing as we can see in my example.

We know have to update the launch script of scrivener :
Add at the beginning of the script /usr/share/scrivener/bin/scrivener.sh (after #! /bin/sh) :

ASPELL_CONF='prefix /usr/share/scrivener' PATH="/usr/share/scrivener/bin:$PATH" export ASPELL_CONF PATH

You must get something like that :

[code]#! /bin/sh

ASPELL_CONF=‘prefix /usr/share/scrivener’
PATH="/usr/share/scrivener/bin:$PATH"
export ASPELL_CONF PATH

makeAbsolut() {

case $1 in
    /*)
        # already absolute, return it
        echo "$1"
        ;;
    *)
        # relative, prepend $2 made absolute
        echo `makeAbsolute "$2" "$PWD"`/"$1" | sed 's,/\.$,,'
        ;;
esac

}

me=which "$0" # Search $PATH if necessary
if test -L “$me”; then
# Try readlink(1)
readlink=type readlink 2>/dev/null || readlink=
if test -n “$readlink”; then
# We have readlink(1), so we can use it. Assuming GNU readlink (for -f).
me=readlink -nf "$me"
else
# No readlink(1), so let’s try ls -l
me=ls -l "$me" | sed 's/^.*-> //'
base=dirname "$me"
me=makeAbsolute "$me" "$base"
fi
fi

bindir=dirname "$me"
libdir=cd "$bindir/../lib" ; pwd
LD_LIBRARY_PATH=$libdir
export LD_LIBRARY_PATH
unset QT_PLUGIN_PATH
exec “$bindir/Scrivener” ${1+"$@"}[/code]

To get it definitively work, a last chown is needed to restaure the rights to the user :
(replace fred by your user name)

sudo chown -R root:fred /usr/share/scrivener

Launch scrivener, and your spelling is now fully working you just have to manage it in the options.

Have fun :smiley: !

Fred

Thanks Fred - at last! Spellcheck working on 64 bit Mint Cinnamon using your instructions.

Hello, everyone. Using the excellent information in the posts above, I’ve written a shell script that automatically attempts to install and configure spell checking for 64-bit Debian-based systems. I’ve run this script successfully on two different machines.

You should have Scrivener working correctly without spell checking in your environment before running this. My own installs were done on systems based on Debian Wheezy and Debian Jessie. On my systems, in order to get Scrivener working correctly, I needed only to install the i386 libgstreamer-plugins-base package (and its dependencies). All other necessary 32-bit libs came pre-installed. My tests were done on recent releases of SolydK and Crunchbang Linux. You may need to consult earlier posts in this thread if you still have 32-bit library issues.

sudo apt-get install libgstreamer-plugins-base0.10-0:i386

You may also need to perform:

sudo apt-get -f install

to fill in any missing dependencies that the gstreamer library doesn’t pull in, depending on your system.

I’ve tested the script when Scrivener is installed both from the .deb and .tar.gz packages. The script is set up to work with the .deb install, but if you install from the .tar.gz package, you can modify the line that starts with “SCRIV_HOME=” to point to the directory where you installed it.

If you installed Scrivener from the .deb package or you installed the .tar.gz package to somewhere you don’t normally have write access to, you’ll need to run this script using sudo so it can have the proper permissions.

The script is extremely conservative when checking for errors and moving files around - it tries to stop immediately if something goes wrong. If it messes up your Scrivener install, it would probably just be easiest for you to uninstall and reinstall Scrivener, so make sure you back up your work first. This is very unlikely, however. Also, if you run the script a second time, you will get “File already exists”-type errors.

On my Crunchbang system, I get a gnome-keyring-pkcs11 error, but this is harmless. An earlier post details how to fix this if it bothers you.

#!/bin/bash

# Modify this variable to point to the directory Scrivener is installed in
SCRIV_HOME="/usr/share/scrivener"

SCRIV_LIB=$SCRIV_HOME/lib
SCRIV_BIN=$SCRIV_HOME/bin
TMP="/tmp/aspell"

ASPELL_DIR="$TMP/aspell"
LIBASPELL_DIR="$TMP/libaspell"
LIBNCURSES_DIR="$TMP/libncurses"
LIBTINFO_DIR="$TMP/libtinfo"

function download() {
  apt-get download $1
  if [ $? -ne 0 ]; then
    echo "Failed to download package: $1"
    exit 1
  fi
}

function unpack() {
  dpkg -x $@
  if [ $? -ne 0 ]; then
    echo "Failed to unpack package: $1"
    exit 1
  fi
}

function make_copy() {
  cp $@
  if [ $? -ne 0 ]; then
    echo "Failed to copy file: cp $@"
    exit 1
  fi
}

function make_link() {
  ln -s $@
  if [ $? -ne 0 ]; then
    echo "Failed to create symlink: $2 -> $1"
    exit 1
  fi
}

# prepare temp directory
if [ -d $TMP ]; then
  rm -rf $TMP
fi
mkdir $TMP
cd $TMP

echo "Downloading and unpacking 32-bit libs..."

# get the needed libraries
download "aspell:i386"
download "libaspell15:i386"
download "libncursesw5:i386"
download "libtinfo5:i386"

# unpack the libraries
unpack $TMP/aspell* $ASPELL_DIR
unpack $TMP/libaspell15* $LIBASPELL_DIR
unpack $TMP/libncursesw5* $LIBNCURSES_DIR
unpack $TMP/libtinfo5* $LIBTINFO_DIR

echo "Setting up aspell libraries..."

# copy new aspell files to scriv
make_copy -rf /usr/lib/aspell $SCRIV_LIB
make_copy -if $ASPELL_DIR/usr/bin/* $SCRIV_BIN
make_copy -rf $LIBASPELL_DIR/usr/lib/aspell/* $SCRIV_LIB/aspell/
make_copy $LIBASPELL_DIR/usr/lib/libaspell.so.15.2.0 $LIBASPELL_DIR/usr/lib/libpspell.so.15.2.0 $SCRIV_LIB
make_copy $LIBNCURSES_DIR/lib/i386-linux-gnu/libncursesw.so.5.9 $SCRIV_LIB
make_copy $LIBTINFO_DIR/lib/i386-linux-gnu/libtinfo.so.5.9 $SCRIV_LIB

# create symlinks in scrivener lib dir
make_link $SCRIV_LIB/libaspell.so.15.2.0 $SCRIV_LIB/libaspell.so
make_link $SCRIV_LIB/libaspell.so.15.2.0 $SCRIV_LIB/libaspell.so.15
make_link $SCRIV_LIB/libpspell.so.15.2.0 $SCRIV_LIB/libpspell.so
make_link $SCRIV_LIB/libpspell.so.15.2.0 $SCRIV_LIB/libpspell.so.15
make_link $SCRIV_LIB/libncursesw.so.5.9 $SCRIV_LIB/libncursesw.so
make_link $SCRIV_LIB/libncursesw.so.5.9 $SCRIV_LIB/libncursesw.so.5
make_link $SCRIV_LIB/libtinfo.so.5.9 $SCRIV_LIB/libtinfo.so
make_link $SCRIV_LIB/libtinfo.so.5.9 $SCRIV_LIB/libtinfo.so.5

# replace symlinks with real files
rm $SCRIV_LIB/aspell/*.rws
cp /var/lib/aspell/*.rws $SCRIV_LIB/aspell/
if [ $? -ne 0 ]; then
  echo "Failed to copy aspell dictionary files (aspell not installed?)"
  exit 1
fi

# set up env vars
ASPELL_CONF="prefix $SCRIV_HOME"
PATH="$SCRIV_HOME/bin:$PATH"
LD_LIBRARY_PATH="$SCRIV_HOME/lib:$LD_LIBRARY_PATH"
AC_CONF="$SCRIV_HOME"
export ASPELL_CONF PATH LD_LIBRARY_PATH

# check to ensure the new aspell binary is going to work
ldd $SCRIV_BIN/aspell | grep "not found" > /dev/null
if [ $? -eq 0 ]; then
  echo "There are missing dependencies for the aspell program $SCRIV_BIN/aspell"
  echo "These dependencies are:"
  ldd $SCRIV_BIN/aspell
  echo "These dependencies must be resolved or spell checking will not work"
  exit 1
fi

echo "Generating new dictionary files..."

# generate new dictionary files
RWS_FILES="/usr/share/aspell/*.cwl.gz"
for RWS_FILE in $RWS_FILES; do
  BASE=`basename $RWS_FILE`
  NAME=`echo $BASE | cut -d'.' -f1`
  zcat $RWS_FILE | precat | aspell --per-conf=/dev/null --dont-validate-affixes --local-data-dir=$SCRIV_LIB/aspell --lang=en create master $SCRIV_LIB/aspell/$NAME.rws
done

# backup scrivener launch script
SCRIV_TMP=$TMP/scrivener.sh
cp $SCRIV_BIN/scrivener.sh $SCRIV_TMP

echo "Modifying scrivener startup script..."

# modify env variables in temp scrivener launch script
NEW_SCRIV_TMP=$TMP/scrivener_new.sh
sed "1 a\
ASPELL_CONF=\"prefix $SCRIV_HOME\"\\n\
PATH=\"$SCRIV_HOME/bin:\$PATH\"\\n\
export ASPELL_CONF PATH" $SCRIV_TMP > $NEW_SCRIV_TMP

# replace the original scrivener.sh with the modified one
cp $NEW_SCRIV_TMP $SCRIV_BIN/scrivener.sh

# clean up
rm -rf $TMP

echo "Done."

Kudos to the previous posters. I would never have figured out all the steps to get aspell working without their help.

Good luck!