如何基于ubuntu安装部署Calibre?

Linux基础

1 基础知识

1.1 什么是Caliber

– Caliber是一款电子书管理软件
– Caliber完全开源免费
– Caliber主要使用Python编写并包含一些C/C++的代码

1.2 Caliber的功能

– 支持查看电子书(支持所有主要的电子书格式)
– 支持转换电子书(支持所有主要的电子书格式)
– 支持编辑电子书(支持所有主要的电子书格式)
– 支持分类电子书(支持所有主要的电子书格式)
– 支持与电子书阅读器设备对话
– 支持从互联网获取图书的元数据
– 支持报纸的下载并转换为电子书以便于阅读

1.3 安装须知

1.3.1 Caliber支持的系统平台

– Linux
– Widonws
– macOS

1.3.2 对Python的需求

– Caliber与Python 3不兼容
– Caliber需要不低于Python 2.7.9版本

2 最佳实践

2.1 准备工作

2.1.1 系统环境

OS = Ubuntu 16.04.6 LTS
ip address= 10.168.0.100
hostname = any.cmdschool.org

2.1.2 安装桌面端

apt install -y ubuntu-gnome-desktop

2.2 安装Caliber

2.2.1 下载软件包

cd ~
wget https://download.calibre-ebook.com/4.13.0/calibre-4.13.0-x86_64.txz

其他版本请从以下链接下载,
https://download.calibre-ebook.com/

2.2.2 部署软件包

mkdir -p /opt/calibre
rm -rf /opt/calibre/*
cd ~
tar -xf calibre-4.13.0-x86_64.txz -C /opt/calibre/

2.2.3 安装软件包

/opt/calibre/calibre_postinstall

可见如下提示,

Using python executable: /usr/bin/python3
2020-03-30 11:37:31 URL:https://download.calibre-ebook.com/linux-installer.sh [31887/31887] -> "-" [1]
Installing to /opt/calibre
Downloading tarball signature securely...
Using previously downloaded calibre-4.13.0-x86_64.txz
Extracting files to /opt/calibre ...
Extracting application files...
Creating symlinks...
        Symlinking /opt/calibre/fetch-ebook-metadata to /usr/bin/fetch-ebook-metadata
        Symlinking /opt/calibre/lrf2lrs to /usr/bin/lrf2lrs
        Symlinking /opt/calibre/markdown-calibre to /usr/bin/markdown-calibre
        Symlinking /opt/calibre/ebook-edit to /usr/bin/ebook-edit
        Symlinking /opt/calibre/lrfviewer to /usr/bin/lrfviewer
        Symlinking /opt/calibre/ebook-viewer to /usr/bin/ebook-viewer
        Symlinking /opt/calibre/web2disk to /usr/bin/web2disk
        Symlinking /opt/calibre/calibre-customize to /usr/bin/calibre-customize
        Symlinking /opt/calibre/ebook-device to /usr/bin/ebook-device
        Symlinking /opt/calibre/calibre to /usr/bin/calibre
        Symlinking /opt/calibre/ebook-meta to /usr/bin/ebook-meta
        Symlinking /opt/calibre/calibre-server to /usr/bin/calibre-server
        Symlinking /opt/calibre/calibre-smtp to /usr/bin/calibre-smtp
        Symlinking /opt/calibre/lrs2lrf to /usr/bin/lrs2lrf
        Symlinking /opt/calibre/calibredb to /usr/bin/calibredb
        Symlinking /opt/calibre/ebook-polish to /usr/bin/ebook-polish
        Symlinking /opt/calibre/ebook-convert to /usr/bin/ebook-convert
        Symlinking /opt/calibre/calibre-debug to /usr/bin/calibre-debug
        Symlinking /opt/calibre/calibre-parallel to /usr/bin/calibre-parallel
Setting up command-line completion...
Installing zsh completion to: /usr/share/zsh/vendor-completions/_calibre
Installing bash completion to: /usr/share/bash-completion/completions/
Setting up desktop integration...
Creating un-installer: /usr/bin/calibre-uninstall
Run "calibre" to start calibre

2.2.4 测试运行

calibre

如果遇到如下提示,

qt.qpa.xcb: could not connect to display
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.

Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, xcb.

Aborted (core dumped)

以上提示的是QT错误,我们使用如下命令调试,

apt install -y qtcreator
export QT_DEBUG_PLUGINS=1
qtcreator

可见如下显示,

QFactoryLoader::QFactoryLoader() checking directory path "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms" ...
[...]
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/usr/bin/platforms" ...
loaded library "/usr/lib/x86_64-linux-gnu/qt5/plugins/platforms/libqxcb.so"
QXcbConnection: Could not connect to display
Aborted (core dumped)

根据提示我们尝试使用如下设置解决,

echo "export QT_QPA_PLATFORM='offscreen'" | tee /etc/profile.d/QT_QPA.sh
source /etc/profile

再次尝试运行,

calibre

注:按下【Ctrl+Z】结束程序

参阅文档
=================

官方首页
—————-
https://calibre-ebook.com/

软件下载
—————-
https://calibre-ebook.com/download

gihub
—————-
https://github.com/kovidgoyal/calibre

二进制安装
————
https://calibre-ebook.com/download_linux
https://manual.calibre-ebook.com/develop.html#binary-install-of-calibre

编译安装
—————-
https://github.com/kovidgoyal/calibre/blob/master/bypy/README.rst
https://manual.calibre-ebook.com/develop.html#source-install-on-linux

没有评论

发表回复

Linux基础
如何锁定Linux用户?

1 前言 一个问题,一篇文章,一出故事。 笔者最近需要锁定Linux用户,于是整理此文。 2 基础知 …

Linux基础
如何在救援模式下启动SSH服务?

1 前言 一个问题,一篇文章,一出故事。 笔者最近想使用Linux救援模式进入系统进行远程的修复工作 …

Linux基础
如何熟悉SSH客户端?

1 前言 一个问题,一篇文章,一出故事。 笔者作为一个Linux运维人员,用过几款喜欢的Open S …