Score:1

Compiling a program from source

cn flag

I have a basic question concerning packages and the possibility to build a program in Ubuntu. To make it concrete: I'm using Ubuntu 18.04.6 LTS. Say I want to build Okular from the source to have the latest features [ okular from source ]. There are some related questions on this topic, see Q1, Q2, but what I would like to know is: When starting downloading the needed dependencies (e.g. I need cmake_3.18.4-2_amd64.deb, and this needs libarchive13_3.4.3-2+b1_amd64.deb and so on...) how can I check if, at some point, I need an newer kernel? Because this would be the ultimate end, right (since at this point I should really directly install a never OS)? I'm not sure to which extend apt is doing this job. Does apt's output

 ...
     cmake : Depends: libarchive13 (>= 3.3.3) but 3.2.2-3.1ubuntu0.7 is to be installed
     Depends: libgcc-s1 (>= 3.0) but it is not installable
     Depends: libjsoncpp24 (>= 1.9.4) but it is not installable
     Depends: libstdc++6 (>= 9) but 8.4.0-1ubuntu1~18.04 is to be installed

 ...

mean exactly this, namely that it is hopeless to install all the needed dependencies to succeed? I don't dread a lot of work but I would like to know in advance if it is a waste of time to build the package by myself. What is the best procedure here (except from a system update)?

Pilot6 avatar
cn flag
Why are you downloading packages manually7 Run `sudo apt install build-essential` and all dependencies will be installed. Or install at lease `cmake`.
pawel_winzig avatar
cn flag
@Pilot6: This output is from installing `cmake_3.18.4-2_amd64.deb`. So, should I proceed or is it hopeless?
pawel_winzig avatar
cn flag
@Pilot6: And by the way, I have installed `build-essential`...
Pilot6 avatar
cn flag
`sudo apt install cmake` Apt should take care of dependencies.
pawel_winzig avatar
cn flag
@Pilot6: Well, this is of course something I already did, here is the output: `The following packages have unmet dependencies: cmake : Depends: cmake-data (= 3.10.2-1ubuntu2.18.04.2) but 3.18.4-2 is to be installed`
pawel_winzig avatar
cn flag
So, back to my question: Is it worth it to proceed?
Pilot6 avatar
cn flag
It is probably because you downloaded and install some wrong version manually.
Pilot6 avatar
cn flag
Remove `cmake` and install it again. The 3.18 version is not for Ubuntu 18.04.
pawel_winzig avatar
cn flag
I see, where can I check whether it is for Ubuntu 18.04 or not? I indeed installed 3.18 from the Debian repo
user535733 avatar
cn flag
When mucking about with different versions, it's often helpful to use a Container or VM (or in Python a venv) to prevent all the weird versions from polluting your base system.
user535733 avatar
cn flag
Since you installed build-essential, try `rmadison`. Example: `rmadison cmake` will tell you versions and matching releases of Ubuntu. `rmadison -u debian cmake` will tell you the same for Debian.
pawel_winzig avatar
cn flag
@user535733 `rmadison cmake` tells me that the highest version of `cmake` I can have for Ubuntu 18.04 is `3.10.2-1ubuntu2.18.04.2`. Since CMake 3.16 or higher is required for the Okular build there is no way to install it, right?
user535733 avatar
cn flag
There's almost always a way. But it's telling you that particular path won't be easy. By the time you have upgraded dependencies, you will essentially be running 21.04 or 21.10...and getting there might be very ugly. Maybe that's not the path you want. Most documentation for building assumes you want up-to-date software, which means you need up-to-date dependencies.
pawel_winzig avatar
cn flag
@user535733 But this is exactly the point. What does "path won't be easy" tell me? Can it fail or is it simply installing a lot of dependencies? It is this fuzziness which is unnecessary.
user535733 avatar
cn flag
It's fuzzy because we have not tested what you are doing. You are off the marked path. My opinion is that you will destroy your system trying to install bleeding-edge software into a 3-year-old Debian-based system. You won't be able to reconcile all of the dependency conflicts that you will create. However, I have not tested that. I might be flat wrong.
pawel_winzig avatar
cn flag
@user535733 I'm asking this since I'm thinking of the following scenario: Say you a running a cluster on Debian 10 where it is not that simple to update the OS (downtime etc.). When should I say: Here I can risk a compilation from source to get a newer version of some package?
N0rbert avatar
zw flag
Debian 10 is off-topic here. On Ubuntu use flatpak as described in below answer.
Score:2
zw flag

You can't compile very new software on not-so-very old system because of dependencies. Manual installation of new dependencies on old system will break it.

As not-harmful alternative you can use Okular 21.08.2 flatpak from KDE instead on your Ubuntu 18.04 LTS. Install it with:

sudo add-apt-repository ppa:flatpak/stable
sudo apt update
sudo apt install flatpak

flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

flatpak install flathub org.kde.okular

And to start it use

flatpak run org.kde.okular

or find relevant icon in your desktop environment.

pawel_winzig avatar
cn flag
So: flatpak or snap? Somehow your comment, N0rbert, was deleted...
pawel_winzig avatar
cn flag
...and to start it: `flatpak run org.kde.okular`
Score:-1
cn flag

KDE already solved this problem with the Okular Snap.

https://snapcraft.io/okular

The Snap is sandboxed from the rest of your system, and will auto-update whenever the author (KDE) pushes an update.

The current snap (version 20.12.3) should be fully compatible with your 18.04 system.

  • For additional information: snap list okular
  • To install: sudo snap install okular
  • It's independent of Ubuntu (or Debian) versions. If you discover that the snap is stale, simply ping KDE directly -- they're the author, and they can update it anytime.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.