debuginfo handling within fedora, how to remove debuginfo - gdb

I can simply install debug info's for several packages with e.g:
sudo dnf debuginfo-install ibus-gtk3-1.5.21-5.fc31.x86_64
But I did not see any command to remove the debuginfos.
Is there any dnf command which can remove debuginfos?
I know that I can manually remove any package with dnf, as long as I know the name. But I can't find out automatically the relation between the package and the debuginfo to that package for remove/uninstall.
Is there any trick to do that job?

Related

How does one pin/freeze a version of the dependencies of an opam project/package and then install the project with such specified dependencies?

How do we freeze an entire dependency tree/chain from an already working opam install?
I have a bunch of coq projects installed via opam right now. I'd like to figure out what commit they are using for their current install. I want to know this -- ideally automatically -- such that the opam pkgs/projects and their dependencies are pinned/fixed/frozen so that future opam installs/pins on the never break on them. For example if I knew the commit I could construct the opam switch need and install it with:
eval $(opam env --switch=coq-8.10 --set-switch)
opam pin add coq-metalib https://github.com/plclub/metalib/commits/104fd9efbfd048b7df25dbac7b971f41e8e67897
how do I do this? at the very least I'd like to be able to get commits like 104fd9efbfd048b7df25dbac7b971f41e8e67897 from opam installs that are already working.
How to automatically determine the git commit to make a permanent opam pin add url.git#commit install?
If I have a working set-up with opam. How do I get all the git commits for each opam project/package I have so to make the current install permanent? e.g. some projects it seems in coq get over written in the OPAM official repo so I want to lock those with git commits. So far manually checking them works:
eval $(opam env --switch=coq-8.10 --set-switch)
opam pin add -y coq-metalib git+https://github.com/plclub/metalib.git#104fd9efbfd048b7df25dbac7b971f41e8e67897
but I have a massive list of opam packages working right now and would like to make their install robust with the git commits. e.g. all these work for now:
# --- Install all Opam Dependencies: 1. create opam switch needed 2. then install all opam dependencies & projs
opam list
# - Create the 8.10.2 switch
opam switch create coq-8.10 4.07.1
eval $(opam env --switch=coq-8.10 --set-switch)
opam pin add -y coq 8.10.2
# - Install dependency packages for 8.10
opam repo add coq-extra-dev https://coq.inria.fr/opam/extra-dev
# We don't need it in all opam switches due to incompatabilities: Run `opam repository add <coq-proj> --all-switches|--set-default' to use it in all existing switches, or in newly created switches, respectively. cmd: opam repository add coq-extra-dev --all-switches
opam repo add coq-released https://coq.inria.fr/opam/released
opam repo add psl-opam-repository https://github.com/uds-psl/psl-opam-repository.git
opam install -y coq-serapi
opam install -y coq-struct-tact
opam install -y coq-inf-seq-ext
opam install -y coq-smpl
opam install -y coq-int-map
opam install -y coq-pocklington
opam install -y coq-mathcomp-ssreflect coq-mathcomp-bigenough coq-mathcomp-algebra
opam install -y coq-fcsl-pcm
opam install -y coq-list-string
opam install -y coq-error-handlers
opam install -y coq-function-ninjas
opam install -y coq-algebra
opam install -y coq-zorns-lemma
opam pin -y add menhir 20190626
# coq-equations seems to rely on ocamlfind for it's build, but doesn't
# list it as a dependency, so opam sometimes tries to install
# coq-equations before ocamlfind. Splitting this into a separate
# install call prevents that. https://stackoverflow.com/questions/75452026/how-do-i-install-ocamlfind-first-properly-before-other-opam-packages-without-roo, untested for now
opam install -y ocamlfind
opam install -y coq-equations coq-metacoq coq-metacoq-checker coq-metacoq-template
# lin-alg-8.10 needs opam switch coq-8.10
git submodule add -f --name coq-projects/lin-alg-8.10 git#github.com:HazardousPeach/lin-alg-8.10.git coq-projects/lin-alg
git submodule update --init coq-projects/lin-alg
(cd coq-projects/lin-alg && make "$#" && make install)
# to confirm it installed look for lin-alg: https://github.com/UCSD-PL/proverbot9001/issues/81, for now you can confirm by trying to install it again and it all looks alright
#opam list
#opam list | grep lin-alg-8.10
# Install the psl base-library from source
mkdir -p deps
git clone -b coq-8.10 git#github.com:uds-psl/base-library.git deps/base-library
(cd deps/base-library && make "$#" && make install)
git clone git#github.com:davidnowak/bellantonicook.git deps/bellantonicook
(cd deps/bellantonicook && make "$#" && make install)
opam list | grep base-library
# -- Get cheerios, req to have old versions work in opam: https://github.com/uwplse/cheerios/issues/17
eval $(opam env --switch=coq-8.10 --set-switch)
# opam install might give issues since it gets the most recent version from the official OPAM repository
#opam -y install coq-cheerios
#opam install -y coq-verdi
# use opam pin since pin is created to install specific version (e.g. from git, local, etc.)
opam pin add coq-cheerios git+https://github.com/uwplse/cheerios.git#9c7f66e57b91f706d70afa8ed99d64ed98ab367
#opam pin add coq-cheerios https://github.com/uwplse/cheerios.git\#9c7f66e57b91f706d70afa8ed99d64ed98ab367d
#opam pin add coq-verdi https://github.com/uwplse/verdi/tree/f3ef8d77afcac495c0864de119e83b25d294e8bb
opam pin add coq-verdi git+https://github.com/uwplse/verdi.git#f3ef8d77afcac495c0864de119e83b25d294e8bb
# use opam pin since pin is created to install specific version (e.g. from git, local, etc.)
Context: installing proverbot9001 coq-projects dependencies that have their OPAM repo code overwritten by original authors
I have this issue were I try to install an opam package (coq project/pkg in my specific case) that I have downloaded/cloned via a git submodule and when I do try to opam install it it fails. It fails, although I have cloned the right version of the coq project/pkg. The source of failure is something I've been told here because it is imho very hard to infer/deduce that from the error message:
(iit_synthesis) brando9~ $ eval $(opam env --switch=coq-8.10 --set-switch)
(iit_synthesis) brando9~ $ opam install -y coq-cheerios
[ERROR] Package conflict!
* Missing dependency:
- coq >= 8.14
not available because the package is pinned to version 8.10.2
No solution found, exiting
it says a newer version of coq is needed but it's very confusing why that is the case. In python there is a setup.py or a requirements.txt file that makes all of this a little bit more clear (dependency management is always a pain afaik :( ).
I am wondering, is there such a file in opam where I can specify for the coq-projects I am using which version of the dependencies I need so I don't have to go back and fix everything? e.g. in python I'd do:
pip3 freeze > requirements.txt # Python3
pip freeze > requirements.txt # Python2
can I do this in ocaml? Ideally automatically. Even more ideally looping through all the coq-projs in my current repo under the folder coq-projects/ and create such a freeze of the dependencies for future installs? Once that is there how would I install the downloaded/cloned coq proj with the specified forzen dependencies?
Why can't we just extract the deps from a list like pip does? It's linear once a working installation is set up
I don't understand something about opam vs pip. Once a working installation is set up -- it's not a chain or recursive structure of installations. It's simply a list of installations that can be frozen with pip. Is that not possible with opam? If not why not and why is it so hard to fix?
Useful links
related discussion to solve this issue:
trying to get coq-cheerios & verdi to work by getting the right commits for them: https://github.com/uwplse/cheerios/issues/17 , trying to get support for cheerios for coq 8.10: https://github.com/uwplse/cheerios/issues/12
this is a related question I asked when I thought it was my cloning of the coq-projects I was going to build How does one git submodule add a specific commit and have it be recorded in the .modules files? but before I even build them I need to get their dependencies installed! e.g. via opam. Some proverbot installed from source :( and Idk how to fix those yet e.g. metalib: https://github.com/UCSD-PL/proverbot9001/issues/82
I might have an issue with coq-serapi too: https://github.com/UCSD-PL/proverbot9001/issues/78
when I thought creating my own forks would work https://github.com/UCSD-PL/proverbot9001/issues/83 but likely just getting the opam install/pin to work with the commit is better e.g. opam pin add coq-metalib https://github.com/plclub/metalib/commits/104fd9efbfd048b7df25dbac7b971f41e8e67897.
cross at ocaml discuss: https://discuss.ocaml.org/t/how-does-one-pin-freeze-a-version-of-the-dependencies-of-an-opam-project-package-and-then-install-the-project-with-such-specified-dependencies/11424
another discussion when running a giant set of opam installs: https://github.com/UCSD-PL/proverbot9001/issues/55
related & likely culprit of issues; is it true that OPAM allows none addative updates to their official repository of packages? https://discuss.ocaml.org/t/is-it-true-that-the-official-opam-repository-allows-non-additive-updates-to-the-projects-packages-pushed-to-it/11432
Yeah the problem here is that the Cheerios project used to be compatible with older versions of Coq, and other projects depend on that. In another package manager, you could just pin to the older version of Cheerios and everything that used that version would be fine. But in Opam there's no guarantee that having a working dependency chain at one time means there will always be a working dependency chain.
EDIT: I don't think opam lock would work here unless it's tarring up the packages or something, because opam is no longer aware of a version of Cheerios which is compatible with Coq 8.10. That version of Cheerios has been erased from the opam repositories, replaced with a newer version which is no longer compatible.
The cheerios coq project that you are building states explicitly that it is only compatible with Coq 8.14 and later in its README.md. I am not sure which part is confusing?
More generally, you can specify which versions of packages your project is compatible with in the dependency fields of your opam file.
If you need to freeze a dependency tree, you can also lock an opam package to depends on the installed versions of its dependencies with opam lock.

How to install libpq-fe.h?

I cannot figure this out for the life of me.
When I pip install django-tenant-schemas it tries to install the dependency psycopg2 which requires the Python headers and gcc. I have all this installed and still keep getting this error!
./psycopg/psycopg.h:35:10: fatal error: libpq-fe.h: No such file or directory
So to install libpq-fe-h I need to sudo apt-get install libpq-dev..
..which returns..
libpq-dev is already the newest version (10.10-0ubuntu0.18.04.1).
Then when I sudo find / libpq-fe.h it doesn't seem to be in my OS.
I am lost at this point. If anyone can help I would highly appreciate it.
For some reason, the file is missing on the system.
As you're using apt-get, the system is dpkg based, presumably Debian or it's derivative. You can try the Ubuntu's package search to get which package contains a file with name ending in libpq-fe.h.
I found the package is libpq-dev and file's absolute path is /usr/include/postgresql/libpq-fe.h.
FWIW, on a dpkg based system, you can check which package gives a file if you know the file's absolute path:
% dpkg -S /usr/include/postgresql/libpq-fe.h
libpq-dev: /usr/include/postgresql/libpq-fe.h
Also, unlike find, locate keeps a cache of found files (mlocate.db) that is created everyday via cron; so if the file happens to be removed after the last run, you can run locate libfq-fe.h to get the absolute path to the file without needing to check the Ubuntu package search online.
So the package is libpq-dev. Now, reinstalling it will get everything to the default state i.e. all relevant files will be copied to the right places. As it is only a library package, no user/system level configurations will be overridden (and dpkg will prompt you for action for any package that does that).
To reinstall the package:
sudo apt-get install --reinstall libpq-dev
For me, I realized it was trying to use the deprecated setup.py so I installed wheel (pip install wheel) and that sorted it all out.
Well after installing these libraries
sudo dnf install python-virtualenv openssl-devel gcc libffi-devel libxslt-devel issue was not gone.
I used mlocate to find where libpq-fe.h file is located. On my system (Fedora 32) it was located at /usr/pgsql-10/include/libpq-fe.h
yum install mlocate
sudo updateb
locate libpq-fe.h
After all added this line to ~/.bash_profile
nano ~/.bash_profile
export PATH=/usr/pgsql-10/bin/:$PATH
Works fine, I can easily install psycopg2 without any trouble.
You need to create a LD_LIBRARY_PATH that indicates the path of your library /user/pgsql-11/lib
Source: The 3rd point of build prerequisites at https://www.psycopg.org/docs/install.html#build-prerequisites

Docker compose libstdc++.so.6 GLIBCXX_3.4.21 not found

When running docker-compose up in my node directory, I get
/usr/lib/x86_64-linux-gnu/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by /app/node_modules/bcrypt/lib/binding/bcrypt_lib.node)
But I definitely have the glib:
strings /usr/lib/x86_64-linux-gnu/libstdc++.so.6 | grep GLIBCXX_3.4.2
GLIBCXX_3.4.2
GLIBCXX_3.4.20
GLIBCXX_3.4.21
GLIBCXX_3.4.22
I tried doing
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
as per https://askubuntu.com/questions/164296/glibcxx-3-4-15-not-found but I get the same error. I have no idea how to resolve this and can't find a solution anywhere else.
This is on Ubuntu 16.04 if it matters.
Some node addons on npm use node-pre-gyp to provide the ability to download pre-compiled addon binaries so that you don't need a compiler installed to use it (mainly useful on Windows, where it is usually more difficult to get a build environment set up).
For these kinds of addons, you can specify a --build-from-source command line option to tell node-pre-gyp to always compile locally instead of downloading one of the pre-compiled addon binaries.
By installing the addon with this flag, you can avoid such errors when the pre-compiled addon binaries are compiled on older/newer machines that utilize different glibc ABIs.

Install boost version 1.40

I am using a server running with Ubuntu 12.04
I want to install the boost libraries in it. I know
sudo apt-get install libboost-all-dev
will make the work done, but it installs the latest version version 1.52 or above.
But I need to install the particular version 1.40 as there is a problem in a simulator which I am using for my academic purpose. What is the particular command for that so that I can install the boost libraries along with the other requirements for it like the linking files
Thanks in advance
Quick answer: sudo apt-get install libboost-dev= 1.40.0.1
If it doesn't work, continue reading.
The apt-get does support installing a particular version of a package as long as it is in an archive that apt knows about. From the apt-get manpage:
A specific version of a package can be selected for installation by following the
package name with an equals and the version of the package to select. This will
cause that version to be located and selected for install. Alternatively a specific
distribution can be selected by following the package name with a slash and the version of
the distribution or the Archive name (stable, frozen, unstable).
For e.g. if you wanted to install apache 2.20 for Ubuntu, you would do something like:
sudo apt-get install apache2=2.2.20-1ubuntu1
Note that you may need to do some dependency resolution on your own in this case, but if there are any problems apt-get will tell you what is causing them. For e.g.(on 11.04)
sudo apt-get install apache2=2.2.20-1ubuntu1 \
apache2.2-common=2.2.20-1ubuntu1 \
apache2.2-bin=2.2.20-1ubuntu1 \
apache2-mpm-worker=2.2.20-1ubuntu1
Note: You must first check if build 1.40 is still available. For that use:
aptitude search libboost
If aptitude search command don't give you sufficient results, try sudo aptitude update and then run aptitude search again.
You might have to investigate whether debs from earlier Ubuntu versions can be installed. i.e. remove the current package, download the debs and try installing them. But there could be dependency on older versions of the standard library.If so, you can probably try downloading the source from launchpad.
As a last resort, download from boost.org and build it - painfully!
EDIT: I see you have asked the same question on ubuntu forums and it seems that you have 1.48 as the default. You might have to build the library itself. Can you try this apt-get
sudo apt-get install libboost1.40-all-dev=1.40.0-4ubuntu4
If this doesn't work, you will have to build it and install it yourself. You can download the source from
Download source (1.40.0): libboost 1.40.0 source files
After it's installed, run the following command to hold your installed version, preventing the package manager from automatically updating it in the future:
sudo echo "[packagename] hold" | sudo dpkg --set-selections
Source:How to Downgrade Packages on Ubuntu
Generally you download sources, build it (some parts are not just headers like filesystem on Windows). Then you can select which subset of libraries you want to install (you can make compact version with only what you need). Then by invoking bootstrap script you build it to another directory this subset of libraries you want and then you invoke install.
Here is a pretty good description how to do it: http://ubuntuforums.org/showthread.php?t=1180792

Not able to install GDB on Fedora

How to download and install GDB(GNU Debugger) on Fedora Linux Machine.. I have tried downloading from gnu website 7.1 package, but then it fails during
./configure and then make command...
Please share the source from where i can get information on the same.
Thanks..
I have found this tutorial which might be helpful to install gdb.
http://www.tutorialspoint.com/gnu_debugger/installing_gdb.htm
But for me the command:
yum install gdb
works.
You may need to install some development packages with header files needed to build gdb. The exact package list depends on error messages from ./configure and make. Here is installed package list on my system:
# rpm -qa "*devel"
kernel-devel-2.6.23.1-42.fc8
ncurses-devel-5.6-12.20070812.fc8
python-devel-2.5.1-15.fc8
expat-devel-2.0.1-2
libtirpc-devel-0.1.7-12.fc8
glibc-devel-2.7-2
libstdc++-devel-4.1.2-33
Try to install all of them with yum.