Monday, April 29, 2024
6
rated 0 times [  6] [ 0]  / answers: 1 / hits: 12657  / 3 Years ago, tue, august 17, 2021, 1:59:53

I want to install libgflags-dev. According to this launchpad link, it is present in the ubuntu repositories : https://launchpad.net/ubuntu/+source/gflags and http://packages.ubuntu.com/raring/libdevel/libgflags-dev



But when i try to sudo apt-get install it, I get E: Unable to locate package libgflags-dev

Why is this happening ? I have all multiverse and universe enabled from software center.



How to install it from apt-get ?



P.S. I know i can simply download the binary and make install it, but I want to know how to do this from apt-get.


More From » installation

 Answers
6

Not packaged for Precise



As you can see on the packages.ubuntu.com site with a query, this isn't available in Precise (12.04), but only for Quantal (12.10) and newer.



Rather than installing from source, here's how to build your own package from the sources of Quantal.



Manual package build (backport)



This is a very very verbose description - for anyone building a package for the first time.




  1. Install basic packages to build software and packages: build-essential Install build-essential and devscripts Install devscripts.


  2. Go to the source package (gflags) page at Launchpad: https://launchpad.net/ubuntu/+source/gflags


  3. Unfold the section for "The Quantal Quetzal (supported) 2.0-1" version.


  4. Locate the source package description file (.dsc extension). At the time of writing this is https://launchpad.net/ubuntu/+archive/primary/+files/gflags_2.0-1.dsc


  5. Copy the link to your clipboard.


  6. Open a terminal and download the source package using dget:



    dget https://launchpad.net/ubuntu/+archive/primary/+files/gflags_2.0-1.dsc


    This will fail the first time:



    gpg: Signature made Thu 31 May 2012 14:48:41 CEST using RSA key ID 8AE09345
    gpg: Can't check signature: public key not found
    Validation FAILED!!

  7. Install the required RSA key as in the error message above:



    gpg --keyserver keyserver.ubuntu.com --recv-key 8AE09345

  8. Configure the DPKG development scripts to use your GPG keyring:



    echo 'DSCVERIFY_KEYRINGS="/etc/apt/trusted.gpg:~/.gnupg/pubring.gpg"' > ~/.devscripts


    See Added key, but dget still shows "gpg: Can't check signature: public key not found" for why.


  9. Run the earlier dget command again. This should now succeed.


  10. Hop into the directory created:



    cd gflags-2.0/

  11. Try building the package.



    debuild -uc -us


    Explanation for the options: unsigned changes file, unsigned new .dsc file. As you are not redistributing the package, there's no need to sign anything.



    This may fail due to missing build dependencies, e.g.:



    dpkg-checkbuilddeps: Unmet build dependencies: debhelper


    Note this is really system specific.


  12. Install the build dependencies (satisfy all above from the output you get), e.g.:



    sudo apt-get install debhelper

  13. Try building the package again:



    debuild -uc -us

  14. One directory below, you'll find your packages, e.g.:



    $ cd ..
    $ ls -al *gflags*.deb
    -rw-r--r-- 1 gert gert 108450 Jun 24 18:59 libgflags2_2.0-1_amd64.deb
    -rw-r--r-- 1 gert gert 147590 Jun 24 18:59 libgflags-dev_2.0-1_amd64.deb
    -rw-r--r-- 1 gert gert 14778 Jun 24 18:59 libgflags-doc_2.0-1_all.deb

  15. Install them:



    sudo dpkg -i *gflags*.deb


    In case this fails because of binary dependencies not satisfied, run



    sudo apt-get install -f



Done!



You can remove or update them any time, like any other package.



The next time you will build any package you will not have to go through all the hoops... in general the recipe is like:




  1. dget <.dsc-file>


  2. cd thefolder


  3. debuild -uc -us


  4. sudo dpkg -i ../*somepattern*.deb



[#30604] Wednesday, August 18, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
terneive

Total Points: 329
Total Questions: 117
Total Answers: 105

Location: Denmark
Member since Tue, Oct 18, 2022
2 Years ago
;