Yes, you can absolutely read DJVU files on Debian/KDE, and Okular is indeed the preferred way to do it for most KDE users, as it supports DJVU via a backend plugin.
Here's how to set it up:
1. Using Okular (Recommended for KDE)
Okular itself doesn't directly handle DJVU files, but it uses external backends for various document formats. For DJVU, it relies on the djvulibre library.
Steps:
Update your package lists:
bash
sudo apt update
Install the Okular extra backends package:
This package provides support for various formats in Okular, including DJVU.
bash
sudo apt install okular-extra-backends
This package will pull in libdjvulibre21 and djvulibre-bin as dependencies if they're not already installed.
Restart Okular:
If Okular was open during the installation, close it completely and then reopen it.
Open your DJVU file:
Now, you should be able to open DJVU files directly with Okular by double-clicking them in Dolphin (KDE's file manager), or by right-clicking and choosing "Open With" > "Okular Document Viewer".
2. Alternative DJVU Viewers
If for some reason Okular doesn't work as expected or you prefer a dedicated viewer, here are a couple of other options:
a. DjView (Dedicated DJVU Viewer)
This is the official graphical viewer from the djvulibre project. It's often very robust.
Install djview:
bash
sudo apt install djview
(Note: The package name might be djview4 on some systems, but djview is common on Debian).
How to use:
You can launch djview from your applications menu or by running djview <filename.djvu> in the terminal.
b. Evince (GNOME's Document Viewer)
While primarily a GNOME application, Evince also works well on KDE and has DJVU support via a plugin.
Install evince and its DJVU plugin:
bash
sudo apt install evince evince-common
evince-common usually pulls in the necessary libdjvulibre dependency for DJVU support.
How to use:
Similar to Okular, you can set it as the default viewer or open files with it.
c. qdjvu (Lightweight Qt-based Viewer)
If you want a minimalistic Qt-based viewer (which integrates well with KDE), qdjvu is a good option.
Install qdjvu:
bash
sudo apt install qdjvu
How to use:
Launch it from your applications menu or qdjvu <filename.djvu>.
How to Set a Default Application
After installing your preferred viewer (likely Okular), you might want to ensure DJVU files open with it by default:
Right-click on any DJVU file in Dolphin.
Select "Open With".
Choose "Okular Document Viewer" (or your preferred alternative).
Tick the checkbox "Remember application association for this type of file" if available, or click "Other Application..." and then "Okular Document Viewer" and set it as default there.
With okular-extra-backends installed, Okular should seamlessly handle your DJVU files on Debian/KDE. Enjoy your reading!