Page 1 of 5 123 ... LastLast
Results 1 to 10 of 43

Thread: Ubuntu 18.04: Trouble fixing bad install of Okular

  1. #1
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    54
    Distro
    Ubuntu

    Ubuntu 18.04: Trouble fixing bad install of Okular

    Soon after getting my system up and running last year I tried out various document viewer alternatives.
    Using the Ubuntu Software Manager I found two versions of Okular and made a hash of things by trying to install both.

    Okular 4.17.12.3-0ubuntu1 is an old version available via ubuntu-bionic-universe.
    Okular 20.04 is the latest version available via Snap Store.

    Only v4.17 was able to be used.

    A weird manifestation of the mess I created could be seen by right clicking a pdf file > properties > open with.
    Initially the icon for v4.17 was listed about 10 times, which probably relates to the number of times I initially attempted to install it all those months ago when I knew much less about what I was doing than the little I know now.

    Tonight I tried unsuccessfully to clean up the mess and install v20.04 via Snap. I used a couple of online tutorials for guidance.

    Here's a list of the various methods I tried.

    dpkg-query -l | grep okular
    ...this found an "okular" package and a dependency "libokular5core8"
    I removed both with the method:
    sudo dpkg --remove Okular
    sudo dpkg --remove libokular5core8

    This was followed up with:
    sudo apt remove okular
    sudo apt purge okular
    sudo apt-get remove okular
    sudo apt-get clean
    sudo apt-get autoremove

    After doing all of that I remembered to check the Ubuntu Software Manager. It still claimed both versions were installed so I used the Software Manager's remove button for each. Both were claimed to have been removed.

    After this I tried to install v20.04 via Snap from terminal:
    sudo snap install okular

    The snap install process completed normally but a problem remains. When I hit Super > search "Okular" the result is two icons. One is a generic diamond logo depicting gears meshing, the other is the icon for Okular 4.17. When clicked neither launches Okular.

    Help with properly fixing my stuff up would be appreciated.
    Last edited by nought2; July 25th, 2020 at 03:06 PM.

  2. #2
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,032
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    Don't use dpkg directly to modify anything. Stay with APT tools which managed dependencies. Only use dpkg to gather information.

    I can't help with menu stuff. Sorry, I don't use menus.
    I also avoid snaps. They don't work on some of my systems for technical reasons the snap team is well aware concerning. If there is an Okular AppImage or flatpak, you can check those out. Can't guarantee those will work, since the packages may not include all the dependencies for your system. I've run into that with snaps too.
    Last edited by TheFu; July 26th, 2020 at 01:13 PM. Reason: clarified dpkg use.

  3. #3
    Join Date
    Aug 2013
    Beans
    4,367

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    You don't use apt or dpkg to remove snap packages, your steps just removed the .deb version of okular (apparently only partially, see below) which is not the one causing you problems (and as theFu said dpkg is a bad idea anyway, should use apt)

    Code:
    sudo snap remove okular
    should remove the okular snap.

    To get rid all snap stuffs (maybe that's what you should do, just to clean up the mess, you can reinstall snapd with apt after)

    Code:
    sudo apt purge snapd
    This will remove everything related to snap except configuration files in your $HOME, which you'll have to clean up manually (sudo updatedb then use locate okular, locate snap etc)

    Another issue is that you might have messed up the deb version of okular as well by trying to be too clever (using dpkg followed by apt, dpkg only removed parts of it but it left bits still registered with apt so instead of removing it cleanly it left you with something broken and apt gets confused.. something like that) In that case just reinstall okular and then uninstall it with apt (or keep it if you want).

    But you should get synaptic instead of messing with commands that you apparently don't understand.
    Code:
    sudo apt install synaptic
    Last edited by monkeybrain20122; July 25th, 2020 at 10:02 PM.

  4. #4
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    54
    Distro
    Ubuntu

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    Thank you TheFu and monkeybrain for your replies.

    To be clear, my aim here is to install and use the most up to date version of Okular. That is v20.04 which is available from Snap Store.

    monkeybrain reckons the problem is caused by snap. That doesn't totally agree with what I see. When the latest Okular version (20.04) is installed via Snap Store it seems to conflict with remnants of the old version (4:17.12.3) installed via Ubuntu Software Manager. After attempting to remove the old version using apt and then installing the newest version via snap, at the very least the icon linking to the old version remains on the system.

    Today I tried conservative methods to install and remove v4:17.12.3 and then install v20.04 via snap.

    sudo snap remove okular
    ...To make sure snap version was not installed to the system.

    sudo apt install okular
    ...This installed Okular 4:17.12.3-0ubuntu1 from ubuntu bionic/universe. Was able to launch it and use it to view files.

    sudo apt remove okular
    ...To uninstall Okular. Came with notice that many packages were automatically installed and are no longer required.
    sudo apt autoremove
    ...To remove these redundant packages.

    sudo snap install okular
    ...This completed successfully, however Okular will not launch.
    Screenshot below shows what I get after hitting Super > search "okular"
    20200726-Okular-probs-scnsht-4.png

    Following monkeybrain's suggestion I had a look at:
    sudo apt purge snapd
    ...which produced this warning:
    The following packages will be REMOVED:
    gnome-software-plugin-snap* snapd*

    Searching "gnome-software-plugin-snap" pulled up an Ask Ubuntu query in which the OP had created problems with his system after doing "purge snapd". Removing gnome-software-plugin-snap broke the Ubuntu Software Manager front page and he was unable to fix it (presumably with the snap plugin absent).
    https://askubuntu.com/questions/1240...nt-on-ubuntu-1

    After reading that I aborted apt purge snapd. I would only try it after taking the precaution to image my system.

    If I was to do apt purge snapd and remove both snapd and gnome-software-plugin-snap, would installing both again via apt restore the function of snap and the Ubuntu Software Manager?

    I had a look at the man page for updatedb but it was beyond my comprehension. Ditto man locate. I would need guidance to use them effectively and safely.

    Removing snapd from the system seems like a heavy handed approach.
    Is there a lighter way to find and weed out what is causing this problem?

    In my $HOME I saw two text files within its subfolder .config:
    okularpartrc (0 bytes)
    okularrc (745 bytes)
    Searching .config also found numerous other files with name format:
    okular_<random-character-string>

    Would it be safe to delete these files before attempting to install Okular again?
    Last edited by nought2; July 26th, 2020 at 10:07 AM.

  5. #5
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,761

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    To be clear, my aim here is to install and use the most up to date version of Okular. That is v20.04 which is available from Snap Store.
    The latest Okular version at the moment is 1.10.3
    If you want to use the latest in Ubuntu 18.04, other than a Snap, you can get it as a Flatpak. I use the Flatpak in Ubuntu 18.04 and it works fine.

  6. #6
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    54
    Distro
    Ubuntu

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    Quote Originally Posted by Dennis N View Post
    The latest Okular version at the moment is 1.10.3
    If you want to use the latest in Ubuntu 18.04, other than a Snap, you can get it as a Flatpak. I use the Flatpak in Ubuntu 18.04 and it works fine.
    Another universal package format, very interesting.

    Found two useful step-by-step guides to install it to Ubuntu:
    https://www.omgubuntu.co.uk/2019/02/...ubuntu-flathub
    https://www.atechtown.com/how-to-ins...-ubuntu-18-04/

    Using bits from each I installed a list of relevant items:
    -Flatpak
    -Flatpak PPA
    -Flatpak software plugin
    -Flathub Repo
    ...and then restarted the system.

    I then did this:
    Code:
    ~$ flatpak search okular
    Name       Description         Application ID    Version    Branch    Remotes
    Okular     Document Viewer     org.kde.okular    1.10.3     stable    flathub
    The outlined installation method from terminal in the second guide led me to do this:
    Code:
    ~$ sudo flatpak install flathub org.kde.okular
    [sudo] password for zen: 
    Looking for matches…
    Required runtime for org.kde.okular/x86_64/stable (runtime/org.kde.Platform/x86_64/5.14) found in remote flathub
    Do you want to install it? [Y/n]: y
    
    org.kde.okular permissions:
        ipc                   network       cups       pulseaudio
        wayland               x11           dri        file access [1]
        dbus access [2]
    
        [1] host, xdg-config/kdeglobals:ro
        [2] com.canonical.AppMenu.Registrar
    
    
            ID                                   Branch Op Remote  Download
     1.     org.freedesktop.Platform.GL.default  19.08  i  flathub  < 89.1 MB
     2.     org.freedesktop.Platform.VAAPI.Intel 19.08  i  flathub   < 8.7 MB
     3.     org.freedesktop.Platform.openh264    2.0    i  flathub   < 1.5 MB
     4.     org.kde.KStyle.Adwaita               5.14   i  flathub   < 6.0 MB
     5.     org.kde.Platform.Locale              5.14   i  flathub < 337.3 MB (partial)
     6.     org.kde.Platform                     5.14   i  flathub < 363.0 MB
     7.     org.kde.okular.Locale                stable i  flathub   < 3.1 MB (partial)
     8.     org.kde.okular                       stable i  flathub  < 54.0 MB
    
    Proceed with these changes to the system installation? [Y/n]:
    For the time being I have not proceeded.

    All of that adds up to an enormous download for a single application. Easily 850MB.

    Have I done this correctly?

    Regarding Okular versions, there is variation in the numerical naming system. The old version installed via apt was labelled 4:17.12.3-0ubuntu1 in the Ubuntu Bionic Universe repository. When installed its Help > About page labelled it 1.3.3. I have no idea how the Gnome Snap system came up with version 20.04 for what the Ubuntu Software manager offers. The version of Okular available from Flatpak, 1.10.3, seems to be right up to date.
    Last edited by nought2; July 26th, 2020 at 03:43 PM.

  7. #7
    Join Date
    Mar 2010
    Location
    Squidbilly-Land
    Beans
    21,032
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    Quote Originally Posted by nought2 View Post
    All of that adds up to an enormous download for a single application. Easily 850MB.
    That is one of the issues with all snaps, flatpaks, appimages. There are many others which may or may not matter/impact you.

    Okular is a Qt-based tool, as seen by the KDE sub-packages.
    Gnome uses a competing GTK+ toolkit.

    These are competing, but it is fine to have both on a single system, running at the same time. All they waste is RAM, storage, startup time, and CPU. In return, we get packages which are supposed to be 100% self-contained enough to run on any supported Linux distro. It doesn't always work that way, but recent and currently supported distros really should work.

  8. #8
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,761

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    You should go to:

    https://flathub.org/home

    where there is a 'quick setup' link. Be sure you did all the steps, including installing the gnome-software-plugin-flatpak so Ubuntu Software (in 18.04) can detect updates and inform you of them.

    Your command for install is correct. Go ahead and install! Okular is a KDE package, and need some KDE resources (called platforms) not found in the default Ubuntu with Gnome Desktop. Later, if you install another KDE package, the resources needeed will already have been installed. The apt version would also need additional resources, all installed as separate dependencies which are a mess to clean up. With Flatpak, should you decide to uninstall an application, you can neatly remove any platform that's no longer used.

    Okular - not just for PDFs - I use it as my epub reader.
    Last edited by Dennis N; July 26th, 2020 at 05:32 PM.

  9. #9
    Join Date
    Jul 2019
    Location
    Melb, Aus
    Beans
    54
    Distro
    Ubuntu

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    Thank you TheFu and Dennis N.

    Having read a little more about Flatpak it seems sensible to start using software distributed through this channel. Its cross Linux platform availability cuts through the fragmented array of OS choices, and it's quite straightforward to use. Both of which for end users like me are very good things.

    The entire download to install Okular via Flatpak wasn't quite as large as I expected. Instead of 850MB it was only 750MB, cough.

    Okular launches and works a treat. Happiness.

    Dennis N confirmed what I had surmised about the KDE resources necessary for Okular, that is they will be used for other KDE-origin flatpaks that are installed. I will have to live with the hit to system resources all that extra software aboard will cost. Hopefully it will only amount to a modest inconvenience.

    This workaround has elegantly sidestepped what would have been a tricky and intricate clean-up to get Okular working via Snap. That issue can now rest. Ripping out snapd by the roots would likely have caused all kinds of problems with other Snaps installed. Just too hard. Ultimately it will be resolved when at some point in future I start again with a clean install of the latest version of Ubuntu. 18.04 is working alright so no need for that yet.

    Out of interest I searched for other snaps installed:
    Code:
    ~$ snap list
    Name                             Version                     Rev   Tracking       Publisher    Notes
    canonical-livepatch              9.5.5                       95    latest/stable  canonical✓   -
    core                             16-2.45.2                   9665  latest/stable  canonical✓   core
    core18                           20200707                    1880  latest/stable  canonical✓   base
    gnome-3-28-1804                  3.28.0-17-gde3d74c.de3d74c  128   latest/stable  canonical✓   -
    gtk-common-themes                0.1-36-gc75f853             1506  latest/stable  canonical✓   -
    gtk2-common-themes               0.1                         13    latest/stable  canonical✓   -
    kde-frameworks-5-core18          5.61.0                      32    latest/stable  kde✓         -
    kde-frameworks-5-qt-5-14-core18  5.68.0                      4     latest/stable  kde✓         -
    onlyoffice-desktopeditors        5.5.1                       43    latest/stable  onlyoffice✓  -
    p7zip-desktop                    16.02.2                     220   latest/stable  ernytech     -
    pdftk                            2.02-4                      9     latest/stable  smoser       -
    Not sure if this is the correct way to find out which Snaps were installed by me. The results are odd. I'm pretty sure p7zip was installed from terminal using apt. Why would this search find it?

    Dennis N, some months ago in another thread you helped me use LibreOffice via AppImage. I noticed LO is offered at flathub.org. Do you think running LO from a Flatpak is preferable to running it from AppImage? For one Flatpak should enable automatic updates, wouldn't it?
    Last edited by nought2; July 28th, 2020 at 12:12 AM.

  10. #10
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    4,761

    Re: Ubuntu 18.04: Trouble fixing bad install of Okular

    I'm glad to hear you're giving Flatpak a try. I've been very satisfied with those I've installed.

    When I did recent fresh installs of Ubuntu 20.04 LTS, I opted for the 'minimal install' option and then utilized Flatpak versions for a number of applications. That way, I always have the latest stable versions of those.

    I suggest installing Flatseal (a Flatpak) to manage permissions. I found some Flatpaks are by default too restrictive on access to a separate data disk or external media.

    I do use the LibreOffice Flatpak regularly. I like it and prefer it.

    AppImage format didn't seem to have a lot of offerings - I have a few of them (Etcher and Krita come to mind) but generally moved on to Flatpak or Snap.

    Based on my own observations, Flatpak applications are automatically updating in Ubuntu 20.04, but not earlier Ubuntu releases. Probably due to a newer Gnome Software Flatpak plugin in 20.04. If a Flatpak doesn't automatically update, you will see a notification about any software updates.

    I DO have some snaps, and won't criticize them. Some things are only found as a snap. For example, I have Firefox ESR as a snap (no Flatpak is available), and my atari800 emulator is a snap (better than the repository version). The LibreOffice snap is fine too.

Page 1 of 5 123 ... LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •