How to Install Okular 0.15 on 12.04 LTS?

173

Solution 1

I backported poppler 0.20.5 to Ubuntu 12.04, compiled Okular 0.16.2 (edit: now updated to 0.17) against it, and put them in a ppa. To use it, add the ppas ppa:kubuntu-ppa/backports and ppa:kalakris/okular:

sudo apt-add-repository ppa:kubuntu-ppa/backports
sudo apt-add-repository ppa:kalakris/okular

Now update the package index and upgrade okular:

sudo apt-get update
sudo apt-get install okular

This version allows me to export annotations to PDF. Since these packages are compiled for precise, there should be no trouble with other dependencies, unlike the solution that suggests installing packages from quantal.

Solution 2

Please read the following paragraph very carefully. This answer shows a way to upgrade Okular to 0.15 (with support for exporting annotations to PDF) on Ubuntu 12.04. Note that (as the OP has mentioned) the other solution regarding the Kubuntu backports PPA will get version 0.15 of Okular but will NOT give you the functionality to export annotations to PDF, which was something that the OP wanted. Unfortunately, you will find that this new functionality in Okular 0.15 is a bit limited, and it may not encode certain types of annotations into your PDF documents. In addition, upgrading can cause compatibility issues with fonts, etc. Thus, you should think twice before trying this.

To continue and try Okular 0.15 for yourself, you may want to first make a file old_packages.txt containing a list of your currently installed packages/versions (if you forget this, don't worry):

sudo apt-get install aptitude
aptitude -q -F "%?p=%?V" --disable-columns search \~i > old_packages.txt

To prepare for the upgrade, add the following two lines to /etc/apt/sources.list

deb http://archive.ubuntu.com/ubuntu/ quantal main universe
deb-src http://archive.ubuntu.com/ubuntu/ quantal main universe

Then run the following commands:

sudo apt-get update
sudo apt-get install okular -f

If you get any errors, try this (repeatedly until the Okular install succeeds):

sudo apt-get install -f
sudo apt-get autoremove -f
sudo apt-get install okular -f

After, this typing

okular --version

should show version 0.15.x. Finally, to prevent unexpected stuff from getting added/upgraded, you should probably comment out the two added lines in /etc/apt/sources.list and do

sudo apt-get update

Please be warned that this procedure can cause other packages to be updated from the Quantal repository, creating compatibility issues with fonts, etc. The comments below this answer contain more information about this.

If you want to uninstall Okular 0.15 and undo all these changes to your packages, it is fairly straightforward. You should first do

sudo apt-get purge okular
sudo apt-get autoremove -f

At this point, you could use the old_packages.txt file you initially created to downgrade all of your packages to their previous versions (see here for the details). Or you can do the following nice procedure (detailed in an answer to a question about rolling back Ubuntu).

Edit /etc/apt/preferences and add the following

Package: *
Pin: release v=12.04
Pin-Priority: 1001

Finally, do

sudo apt-get dist-upgrade -f
sudo apt-get autoremove -f

You should now be back to your original 12.04 packages/versions.

Solution 3

That's easy. Add ppa:kubuntu-ppa/backports to your software sources and you'll be able to install KDE 4.9 software along with Okular 0.15.0

Solution 4

I followed the suggestion by user135805 and works flawlessly. Only difference to the tutorial pointed, I am using trusty and kubuntu backports repos. To sum up,

edit /etc/apt/sources.list:

deb http://archive.ubuntu.com/ubuntu/ trusty main restricted universe
deb-src http://archive.ubuntu.com/ubuntu/ trusty main restricted universe

edit /etc/apt/preferences.d/okular:

Package: okular
Pin: release a=trusty
Pin-Priority: 990

Package: libokularcore4
Pin: release a=trusty
Pin-Priority: 990

Package: libpoppler-qt4-4
Pin: release a=trusty
Pin-Priority: 990

IMPORTANT, edit: /etc/apt/apt.conf.d/00aptitude

APT::Default-Release "precise";

otherwise you will mess up your packages

edit: /etc/apt/sources.list.d/kubuntu-ppa-backports-precise.list

deb http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu precise main
deb-src http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu precise main
deb http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu trusty main
deb-src http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu trusty main

perhaps some of the entries in /etc/apt/preferences.d/okular are not needed, but it workded for me this way. After editing you have to do

apt-get update
apt-get install okular -t trusty

hope this helps.

Solution 5

The feature you quote seems to require poppler 0.20. I don't know if there's a backport for 12.04.

Share:
173

Related videos on Youtube

Docter
Author by

Docter

Updated on September 18, 2022

Comments

  • Docter
    Docter almost 2 years

    my function looks like this so far:

    int orderList (struct artikel_t * order_arr, int arr_size_order)
    {
    struct artikel_t akt_artikel_order;
    
    int icount_order=0;
    struct order_list {
        int lfd_nr;
        int art_nr;
        char bezeichner[MAXCHAR];
        int bestellmenge;
        float preis;
        float gesamtpreis;};
    
    
    struct order_list bestellung[arr_size_order];
    
    while (fread(&akt_artikel_order, akt_artikel_order, arr_size_order, order_arr) < arr_size_order)
    {
    
        bestellung[icount_order].lfd_nr=icount_order;
        bestellung[icount_order].art_nr=akt_artikel_order[icount_order].art_nr
        strcpy(bestellung(icount_count).bezeichner, "akt_artikel_order.bezeichner");
    
        bestellung[icount_order].bestellmenge=(akt_artikel_order[icount_order].min)*4);
        bestellung[icount_order].preis=akt_artikel_order[icount_order].preis;
        bestellung[icount_order].gesamtpreis=((akt_artikel_order[icount_order].preis)*(akt_artikel_order[icount_order].min)*4);
    
        icount_order++;
    
    }
    }
    

    the function orderList receives the adress of the first element of an array of the type struct artikel_t that was created in another function and delivered to the main before orderList is opened; this array contains arr_size_order elements. The function orderList is then supposed to create a new array of the type struct order_list. The elements of each structure in the array ( lfd_nr, art_nr,...) are then filled with the data from where *orderArray is pointing to.

    I will write the rest of the function (to send the array to stdout in useful was, etc. ) later.

    My Question: is the fread function properly written and is it legit to use fread a) read from arrays and b) read structures?

    I hope this makes sense.

    • Admin
      Admin almost 12 years
      I could update poppler to 0.20 by temporarily adding a quantal repository. But there was no update offered for Okular. I have 0.15.0 installed, but the annotation saving does not work. I assume you require a version that was compiled with the appropriate libpoppler. The one in the quantal repositories does not seem to be.
    • Admin
      Admin over 11 years
      Was about to look for a ppa etc; thanks a lot for your EDIT and the heads-up warning. Will re-consider (and/or proceed cautiously).
    • Admin
      Admin over 11 years
      @nuttyaboutnatty I'm glad you found this Q&A useful. One small remark though: Installing Okular from the Kubuntu backports PPA as outlined here works flawlessly (minus the annotation feature as this requires the new Poppler version). My problems arose when I tried to upgrade liboppler from the Quantal repositories. So if it's just an updated Okular you want you can go ahead without any major worries.
    • Admin
      Admin over 11 years
      Thanks again, MHC; again: very "precise" ;) For today, I've had my fair share of new software packages (mostly pdf- and TeX-related), but will gladly resume with your sound advice, soon!
    • Admin
      Admin over 11 years
      I don't think this warrants a separate question, so just briefly here: I guess this bug / feature-request (about wanting a tabbed interface in okular) bugs.kde.org/show_bug.cgi?id=155515 is still (officially) not resolved, also in 0.15, right?
    • Admin
      Admin about 10 years
  • Glutanimate
    Glutanimate almost 12 years
    Hey, thanks for posting this. I am still a newbie with Ubuntu. Could you guide me through adding those repositories and installing the packages please? Also, is adding quantal repositories save? Does it interfere with the regular update progress? Or can you specifically choose which packages get updated through quantal and which through precise repos? Thanks in advance!
  • Glutanimate
    Glutanimate almost 12 years
    Thanks! Your solution worked out fine. I was pretty disappointed, though, that even in this new version, okular only supports export of the "note type" annotations. Other forms of review can't be saved to pdf. And a small headsup for other people that try this installation method out. After restoring the previous sources.list you might run into some font configuration issues (Error messages in terminal). Either reinstall the afflicted fonts or follow this tutorial to solve the problems: ubuntuforums.org/showthread.php?p=12159762#post12159762
  • Glutanimate
    Glutanimate almost 12 years
    Another important remark: I had several issues after adding the quantal ppas even though I immediately deactivated the sources after installing okular. The following packages were upgraded with the install and caused several problems (i.e. sluggish performance when playing back flash video): liblzma5, libfontconfig1, libfontconfig1:i386, fontconfig-config. Eventually I had to undo all the previous changes to restore functionality. All things considered I would advice against installing okular 0.15 on precise.
  • Glutanimate
    Glutanimate almost 12 years
    Please also be aware of the fact that downgrading packages is no easy feat. In order to go back to how things were before the installation I had to manually downgrade each package using their respective .deb files.
  • Mohammad Zeeshan
    Mohammad Zeeshan almost 12 years
    Thanks for mentioning the issues caused by the 0.15 install, Glutanimate. I haven't noticed any font problems on my machine yet, but I may just go ahead and downgrade, since I was a bit disappointed with the annotation functionality as well.
  • illya
    illya almost 12 years
    This just works, thanks a lot! I have no idea why you had 0 upvotes before I voted you up. Seems the OP lost interest after the failed attempt of the accepted answer.
  • Glutanimate
    Glutanimate almost 12 years
    It works fine as far as installing Okular 0.15 is concerned. The PDF engine Okular utilizes (libpoppler) is not upgraded in the process. As a result there is no way of exporting annotations to pdf. If you need that functionality you will have to follow through with the more complicated method provided above.
  • Pushpak Dagade
    Pushpak Dagade over 11 years
    Doing this has created lots of problems on my machine. Opening geany, okular report fontconfig problems. Plus, some of my commonly used apps lost their configuration (ex: gnome-terminal is not able to rem. the default profile, thunar lost its custom actions, and many more which I dont know as of yet.) Moreover, I dont seem to enjoy the extra okular features as I had expected - seems like the same old version. I am still trying to fix everything back. So my suggestion is to not go for 808sound's solution.
  • Mohammad Zeeshan
    Mohammad Zeeshan over 11 years
    @Guanidene yes, I gave a very clear warning that things can go wrong when you try to do this with the Quantal repository. In addition, I referred to the above comments which explain that you don't really get the expected features. Please remove your downvote, or explain how I can edit the answer to address your concerns.
  • Mohammad Zeeshan
    Mohammad Zeeshan over 11 years
    @Guanidene In addition, please notice that the OP has also reiterated these warnings in the original question. Do you have Ubuntu 12.04, follow my instructions exactly, notice/heed the various warnings, and realize that Okular's "annotation" functionality is very limited? If not, then it really isn't appropriate to downvote my answer.
  • Pushpak Dagade
    Pushpak Dagade over 11 years
    @808sound My system got into a real mess, which I couldn't 100% solve, neither was there any useful solution for this on the web. SO, to get out of this, I actually ended up installing 12.10 besides my 12.04. So I have downvoted your answer so that others dont have to go through the same as I had to (which has a good chance, since your answer has been accepted). If you want me to remove your downvote, kindly add a note on your post regarding a possible solution to remove all the problems caused by your solution (which I would verify on my 12.04).
  • Mohammad Zeeshan
    Mohammad Zeeshan over 11 years
    @Guanidene I'm sorry to hear about these issues. I've added some explanation/information to the answer, as well as a method(s) to downgrade packages back to their original 12.04 versions. Please take a look on your 12.04 installation and remove your downvote accordingly.
  • Mohammad Zeeshan
    Mohammad Zeeshan over 11 years
    @Christian there seems to be some confusion here. The OP asked for a method to install Okular 0.15 with ability to export annotations to PDF. As the OP mentioned, this answer does not provide that capability, while my answer does. In any case, I've clarified my answer, and added information about removing any detrimental changes made by the corresponding okular installation. Please remove your downvote!
  • Mohammad Zeeshan
    Mohammad Zeeshan over 11 years
    Sorry, I meant to say, whoever downvoted on Aug 25, please remove your downvote or explain what the problem is. Thanks!
  • illya
    illya over 11 years
    @808sound Sorry, I didn't realize that indeed. I came here because I just wanted to install Okular 0.15 and I was happy that there is this easy way. I didn't want to imply that this solution is better in any way than yours. It just did what I needed in the most simple way possible. People downvote much too lavishly. It wasn't me though :/
  • Pushpak Dagade
    Pushpak Dagade over 11 years
    @808sound Here you go. +1
  • Mohammad Zeeshan
    Mohammad Zeeshan over 11 years
    Thanks @Guanidene and I appreciate you letting me know about the issues!
  • Glutanimate
    Glutanimate about 10 years
    Warning: one possible complication of this method is that applications that rely on the system standard release of libpoppler might start having problems. That's the case for Inkscape, for instance. If libpoppler is more recent than the one Inkscape was built against various PDF functions will stop working (e.g. PDF import and export).
  • Ivan Kapitonov
    Ivan Kapitonov over 8 years
    I only get this: okular: symbol lookup error: /usr/lib/kde4/okularpart.so: undefined symbol: _ZN14KMessageWidget7setIconERK5QIcon