1

Let's take a long list of dependencies required for GNU-Radio to install on Ubuntu 17.04. I elaborate this list below.

sudo apt-get -y install git swig cmake doxygen build-essential libboost-all-dev libtool libusb-1.0-0 libusb-1.0-0-dev libudev-dev libncurses5-dev libfftw3-bin libfftw3-dev libfftw3-doc libcppunit-1.13-0v5 libcppunit-dev libcppunit-doc ncurses-bin cpufrequtils python-numpy python-numpy-doc python-numpy-dbg python-scipy python-docutils qt4-bin-dbg qt4-default qt4-doc libqt4-dev libqt4-dev-bin python-qt4 python-qt4-dbg python-qt4-dev python-qt4-doc python-qt4-doc libqwt6abi1 libfftw3-bin libfftw3-dev libfftw3-doc ncurses-bin libncurses5 libncurses5-dev libncurses5-dbg libfontconfig1-dev libxrender-dev libpulse-dev swig g++ automake autoconf libtool python-dev libfftw3-dev libcppunit-dev libboost-all-dev libusb-dev libusb-1.0-0-dev fort77 libsdl1.2-dev python-wxgtk3.0 git-core libqt4-dev python-numpy ccache python-opengl libgsl-dev python-cheetah python-mako python-lxml doxygen qt4-default qt4-dev-tools libusb-1.0-0-dev libqwt5-qt4-dev libqwtplot3d-qt4-dev pyqt4-dev-tools python-qwt5-qt4 cmake git-core wget libxi-dev gtk2-engines-pixbuf r-base-dev python-tk liborc-0.4-0 liborc-0.4-dev libasound2-dev python-gtk2 libzmq3-dev libzmq5 python-requests python-sphinx libcomedi-dev python-zmq

This is an extremely long list of dependencies for and there are numerous occasions when APT hangs or complains saying one or two of the dependencies are not found.

How can we install a dependency that is not found by APT? What are the most widely accepted methods?

For e.g., a very good method is described in this answer where N0rbert makes an effort to extract the missing libliquid1d & libliquid1d-dev using a weird method I do not understand, extracting libraries from /mirrors.kernel.org. However, to date, when I type apt-get install libliquid1d on my Ubuntu 16.04 system, it still says it cannot find that library. Below is my console output:

 [sudo] password for user:
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 E: Unable to locate package libliquid1d

So in this case, a user might search and find under https://packages.ubuntu.com/search?keywords=libliquid1d that this library exists within the Ubuntu ecosystem only for Artful, Bionic and Cosmic releases. So how about installing for other distributions?

Ubuntu packages search result

This is the question I have. What hacks are known/popular in the community when that case happens? I am interested in a generic method that works to install missing dependencies in Ubuntu distributions, if it exists. I hope my question is specific enough.

Thanks a lot for answers and views.

Zanna
  • 70,465
Denis
  • 337
  • 4
  • 18
  • 3
    Such a method does not exist. – fkraiem May 09 '18 at 09:01
  • But, can you explain why we have this problem in the first place? Why cant libraries be compiled to work on all X86 architectures? Why are these libraries dependant on even the version of Ubuntu? – Denis May 09 '18 at 09:09
  • 1
    There is no generic method what to do when the generic method (i.e. APT) fails. Specifically, libliquid1d seems to be too new for 16.04, it’s contained in newer Ubuntu releases. Related: https://askubuntu.com/questions/151283/why-dont-the-ubuntu-repositories-have-the-latest-versions-of-software – Melebius May 09 '18 at 09:15
  • But I have found cases where some packages being available in older releases and not for news ones. But thanks for your view – Denis May 09 '18 at 09:24
  • Once an Ubuntu release is released, no new packages are added to it, so if a new package appears afterwards, it is not added. Similarly, packages can be dropped and not be available in later releases, even though they are still available in versions released before the package was dropped. – fkraiem May 09 '18 at 09:39
  • "Why cant libraries be compiled to work on all X86 architectures?" Do you mean why can't the package be compiled for older Ubuntu releases? Sometimes it can (sometimes not), but even then the Ubuntu developers will not do it for you and you have to do it yourself (or find someone who has done it, such as through a PPA). – fkraiem May 09 '18 at 09:48
  • 1
    @fkraiem Are you sure that "Such a method does not exist"? If so, how could you possibly know that such a method doesn't exist? I know that such a method does exist because I use it often, but in the general case how could anyone know with certainty that a method doesn't exist? btw I got the accept vote on this question which proves that such a method does exist, so you should in conscience retract your close vote if that was you that cast it. – karel May 09 '18 at 10:32
  • 1
    @kerel, you nailed it! Such a lovely reply. – Denis May 09 '18 at 10:34
  • @karel It is no business of yours whether it was I who cast a close vote, nor whether the person who cast it should retract it. – fkraiem May 09 '18 at 11:11
  • @fkraiem I think you lost it. Accept it :-P – Denis May 09 '18 at 11:38

1 Answers1

1

Maybe the dependencies are found on another version of Ubuntu or a version of Debian. Run this command to find out.

sudo apt install devscripts  
rmadison -u ubuntu,debian first-package-name next-package-name last-package-name  

Replace the package-names in the above code with the names of the packages that you are searching for.

The problem with this command is that sometimes the package version number is part of the package name, so the rmadison program will only find packages that have the same version number in their names. To overcome this limitation I have written a bash shell script that allows for searching for packages that match part of the package name, e.g. match only the name part of the package name without needing to match the version number too.

  1. Create a shell script to query if the multiple packages exist named Open-multiple-URLs-in-Firefox.sh. The script contains the following code:

    #!/bin/bash
    while read line; do
        firefox --new-tab "https://packages.ubuntu.com/$line"
    done < packages.txt
    
  2. Make the script executable.

    chmod +x Open-multiple-URLs-in-Firefox.sh
    
  3. Create a file named packages.txt that contains the names of all the required dependency packages, each package on a separate line. Save packages.txt in the same directory as Open-multiple-URLs-in-Firefox.sh.

  4. Run the script.

    ./Open-multiple-URLs-in-Firefox.sh  
    

The webpage that has information about each required dependency package will open in a separate tab in Firefox.

In order to search for multiple packages in Debian replace https://packages.ubuntu.com/ in the shell script with https://packages.debian.org/search?keywords=

karel
  • 114,770
  • i am really amaized at your answer. Exactly what I was searching for. I am 24x7 Ubuntu user but still a beginer. So much to learn from ypur phylosophy and your way of handling things. I wish you best in everything you do. – Denis May 09 '18 at 10:39
  • 1
    -1 This method is not at all general. Firstly, it is very possible that the dependencies are not available in any version of Ubuntu or Debian, and secondly even if they are they may not be installable on the target Ubuntu release. – fkraiem May 09 '18 at 11:08
  • I am not asking for a method that is capable of installing libraries that are not even available. if the library is avaialble, I just want it installed. Thats my question. I just want that method to be generic. How could anyone come up with a method to install a library thats not even available? – Denis May 09 '18 at 23:11
  • @DavidJones It depends on how you define “available”. Is the library “available” if it can be found 1) in repositories a) for the current Ubuntu version, b) for another Ubuntu version, c) for Debian, 2) as binary downloadable from the web, 3) source code etc. A true generic method would consider all that – at least as I (and probably @fkraiem) understand generic. – Melebius May 10 '18 at 09:28
  • 1
    I would be happy if someone else posted an answer about what to do about binaries downloadable from the web, source code, etc. If I add one more thing to this answer, the question will definitely be closed for being too broad. It's already closeable for being off topic because 17.04 is an end of life release, and I can't edit the "Ubuntu 17.04" out of the question for obvious ethical reasons. It's not my question. fkraiem doesn't think it's ethical for me to answer this question because it's both too broad and off topic. – karel May 10 '18 at 09:40
  • More importantly why did I bother fkraiem about his comment if the question is probably going to get closed anyway? – karel May 10 '18 at 09:56
  • 1
    I wouldn't worry about 17.04 because apt-get and dependencies are relevant to all versions from 14.04 to 18.04. – WinEunuuchs2Unix May 11 '18 at 20:00