bell notificationshomepageloginedit profileclubsdmBox

10% popularity   0 Reactions

Newer versions of Calibre come out on a regular basis and I have not found a site from where I can automatically install the latest packages for my Linux system using the normal packaging download system (apt-get).

I therefore use a small script named update-calibre. It kills the currently running Calibre, moves the previous version from /opt/calibre (prefix is easily changed) to a backup (/opt/calibre-) and then downloads and installs the latest version to/opt/calibre` using the script provided on the calibre site specifically for Linux installs.

So whenever the calibre interface tells me there is a new version I run update-calibre and restart to have the latest version.

#!/bin/bash

# change this to your preferred install location,
# **and** update the `sudo python` line!
BASE=/opt

# make sure the server stops
killall calibre
E=$BASE/calibre/calibre
if [ -e $E ]; then
V=$($E --version | tr ')' ' ' | cut -d ' ' -f 3 )
sudo mv "$E" "$E-$V"
fi

sudo python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urlli
b.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.cali
bre-ebook.com/linux_installer').read()); main(install_dir='/opt')"

Make sure the last line in the script corresponds to the one specified on the linux install page.

Killing the calibre process is necessary, as closing the interface keeps calibre running. This results in a temporarily confused user, who does not understand why the newly downloaded version number does not show up in the interface, even though the program was started.


Free books android app tbrJar TBR JAR Read Free books online gutenberg


Load Full (0)

Login to follow story

More posts by @Lorraine

0 Comments

Sorted by latest first Latest Oldest Best

 

Back to top