RPM spec to require specific RHEL release - linux

In an RPM spec file, what is a good way of requiring a minimum RHEL distribuition? I tried to make RHEL 6.3 a prerequisite using:
Requires: redhat-release-server-6Server >= 6.3
This blocks the install on 6.2 and 6.3 with:
error: Failed dependencies:
redhat-release-server-6Server >= 6.3 is needed by my.package-1.2.0-0.x86_64
I also tried:
Requires: redhat-release >= 6.3
which did not fail the dependecy check on either 6.2 or 6.3.

The redhat-release-server-6Server-6.3.0.3.el6.x86_64 (on my system) seems to be a good candidate as a prerequisite. See http://rhn.redhat.com/errata/RHEA-2012-0971.html . What is not obvious for a novice looking at the package name is that "6Server" is actually the package version. "rpm -q --info" make this clear, though:
$ rpm -q redhat-release-server-6Server --info
Name : redhat-release-server Relocations: (not relocatable)
Version : 6Server Vendor: Red Hat, Inc.
Release : 6.3.0.3.el6 Build Date: Wed 30 May 2012 11:19:03 AM PDT
Install Date: Tue 02 Oct 2012 09:48:26 AM PDT Build Host: x86-003.build.bos.redhat.com
Group : System Environment/Base Source RPM: redhat-release-server-6Server-6.3.0.3.el6.src.rpm
Size : 38585 License: GPLv2
Signature : RSA/8, Wed 30 May 2012 12:19:55 PM PDT, Key ID 199e2f91fd431d51
Packager : Red Hat, Inc. <http://bugzilla.redhat.com/bugzilla>
Summary : Red Hat Enterprise Linux Server release file
Description :
Red Hat Enterprise Linux Server release files
So the correct directive is:
Requires: redhat-release-server >= 6Server-6.3

I would suggest that instead of required specific version of RHEL, Require the dependency that only appear in the target version (e.g. RHEL 6.3)
Following not only cause problem you mentioned, but also block the installation for the client and workstation users (6Client and 6Workstation)
Requires: redhat-release-server-6Server >= 6.3

Related

Oracle Linux Server 7.9 how solve problem with dependencies when yum install docker-ce-20.10.5?

I have OS
# cat /etc/os-release
NAME="Oracle Linux Server"
VERSION="7.9"
ID="ol"
ID_LIKE="fedora"
VARIANT="Server"
VARIANT_ID="server"
VERSION_ID="7.9"
PRETTY_NAME="Oracle Linux Server 7.9"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:oracle:linux:7:9:server"
HOME_URL="https://linux.oracle.com/"
BUG_REPORT_URL="https://bugzilla.oracle.com/"
ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7"
ORACLE_BUGZILLA_PRODUCT_VERSION=7.9
ORACLE_SUPPORT_PRODUCT="Oracle Linux"
ORACLE_SUPPORT_PRODUCT_VERSION=7.9
try to install docker-ce-20.10.5
# yum install docker-ce-20.10.5 docker-ce-cli-20.10.5 containerd.io -y
returned errors
--> Finished Dependency Resolution
Error: Package: docker-ce-rootless-extras-20.10.7-3.el7.x86_64 (docker-ce-stable)
Requires: fuse-overlayfs >= 0.7
Error: Package: docker-ce-rootless-extras-20.10.7-3.el7.x86_64 (docker-ce-stable)
Requires: slirp4netns >= 0.4
fuse3-devel
# yum info fuse3-devel
Loaded plugins: langpacks, rhnplugin
This system is receiving updates from Spacewalk server.
Repository docker-ce-stable is listed more than once in the configuration
Available Packages
Name : fuse3-devel
Arch : x86_64
Version : 3.6.1
Release : 2.el7
Size : 38 k
Repo : cmn_ol_7_epel
Summary : File System in Userspace (FUSE) v3 devel files
License : LGPLv2+
Description : With FUSE it is possible to implement a fully functional filesystem in a
: userspace program. This package contains development files (headers,
: pgk-config) to develop FUSE v3 based applications/filesystems.
How solve this problem?
Just meet the same problem.
To fix it, Oracle Linux developer repo should be enabled. In the current Oracle Linux version from Oracle cloud it can be done by editing /etc/yum.repos.d/oraclelinux-developer-ol7.repo, where in a block [ol7_developer] value enabled should be set to 1.

yum update showing package version which is already installed

My system has a libmaxminddb-1.2.0-10.el8.rpm package which is already installed. But when I run yum update --assumeno, the same package is asking to be reinstalled again, any idea why is this happening and how can I avoid it. Thanks
[root#vm x86_64]# ls | grep libmax
libmaxminddb-1.2.0-10.el8.rpm
[root#vm~]# yum update --assumeno
Repository 'My-Repository' is missing name in configuration, using id.
Repository 'updates' is missing name in configuration, using id.
Last metadata expiration check: 0:14:11 ago on Thu 04 Feb 2021 06:16:35 PM UTC.
Dependencies resolved.
=====================================================================================================================================================================================================
Package Architecture Version Repository Size
=====================================================================================================================================================================================================
Upgrading:
libmaxminddb x86_64 1.2.0-10.el8 My-Repository 33 k
Transaction Summary
=====================================================================================================================================================================================================
Upgrade 1 Package
Total download size: 33 k
Operation aborted.
Maybe the new package have same name, version, release and arch, but different epoch (which would be pretty ugly from packaging point of view)? Try to compare what you have and what is available.
To see details on package you have installed (in this example I'm using bash):
# rpm -q --queryformat "Epoch: %{EPOCH}\n" bash
Epoch: (none)
# rpm -q --info bash
Name : bash
Version : 5.0.17
Release : 2.fc33
Architecture: x86_64
Install Date: Tue 20 Oct 2020 01:36:17 AM CEST
Group : Unspecified
Size : 7709818
License : GPLv3+
Signature : RSA/SHA256, Tue 28 Jul 2020 12:10:09 AM CEST, Key ID 49fd77499570ff31
Source RPM : bash-5.0.17-2.fc33.src.rpm
Build Date : Mon 27 Jul 2020 03:17:35 PM CEST
Build Host : buildhw-x86-14.iad2.fedoraproject.org
Packager : Fedora Project
Vendor : Fedora Project
URL : https://www.gnu.org/software/bash
Bug URL : https://bugz.fedoraproject.org/bash
Summary : The GNU Bourne Again shell
Description :
The GNU Bourne Again shell (Bash) is a shell or command language
interpreter that is compatible with the Bourne shell (sh). Bash
incorporates useful features from the Korn shell (ksh) and the C shell
(csh). Most sh scripts can be run by bash without modification.
And then get same info on available package:
# yum download bash
# rpm -qp bash-5.0.17-2.fc33.x86_64.rpm --queryformat "Epoch: %{EPOCH}\n"
Epoch: (none)
# rpm -qp bash-5.0.17-2.fc33.x86_64.rpm --info
Name : bash
Version : 5.0.17
Release : 2.fc33
Architecture: x86_64
Install Date: (not installed)
Group : Unspecified
Size : 7709818
License : GPLv3+
Signature : RSA/SHA256, Tue 28 Jul 2020 12:10:09 AM CEST, Key ID 49fd77499570ff31
Source RPM : bash-5.0.17-2.fc33.src.rpm
Build Date : Mon 27 Jul 2020 03:17:35 PM CEST
Build Host : buildhw-x86-14.iad2.fedoraproject.org
Packager : Fedora Project
Vendor : Fedora Project
URL : https://www.gnu.org/software/bash
Bug URL : https://bugz.fedoraproject.org/bash
Summary : The GNU Bourne Again shell
Description :
The GNU Bourne Again shell (Bash) is a shell or command language
interpreter that is compatible with the Bourne shell (sh). Bash
incorporates useful features from the Korn shell (ksh) and the C shell
(csh). Most sh scripts can be run by bash without modification.

Node: building from source vs binary distribution

I have downloaded node 0.10.31 source and built on my Linux machine using same steps mentioned in wiki. The source is just as it is and no changes made at all. The build is successful but when I compare bin/node file size with the one from binary downloaded there is around 900kb difference (built from source is bigger).
What is the reason?
Did I miss any optimizer or special config? Actually I wanted to use locally build node (after some change) in production. I just don't want to miss some settings here.
My environment:
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-4)
Python 2.6.6 (r266:84292, Nov 21 2013, 10:50:32)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch:graphics-4.0-amd64:graphics-4.0-noarch:printing-4.0-amd64:printing-4.0-noarch
Distributor ID: RedHatEnterpriseServer
Description: Red Hat Enterprise Linux Server release 6.5 (Santiago)
Release: 6.5
Codename: Santiago
Note: Already posted in node.js groups, sorry for the cross post.
Thanks
You can try and strip out debugging symbols. E.g.,
$ strip node
Debugging symbols are pieces of information embedded in an object file, and useful for debugging purposes. Unfortunately, they take up space in the file, so if you do not plan debugging the node interpreter itself you could get rid of them.
Moreover, please check out strip's manual page for a full list of choices when discarding symbols from object files.

How to find non official installed packaged?

How do I find all installed packages that are not from the official Ubuntu repository?
Some of the packages might have been installed with dpkg -i ....
There is a utility called apt-show-versions in the Ubuntu repo that shows you the versions of programs in the Ubuntu archive. So running
apt-show-versions | grep 'No available version'
would pick up anything that wasn't installed by a repository.
On Fedora I do this rpm -qi to get the package info. There must be something similar options in dpkg
[root#Shash ~]# rpm -qi perl-Scalar-List-Utils-1.31-293.fc20.x86_64
Name : perl-Scalar-List-Utils
Version : 1.31
Release : 293.fc20
Architecture: x86_64
Install Date: Sat 10 May 2014 06:41:29 PM IST
Group : Development/Libraries
Size : 81706
License : GPL+ or Artistic
Signature : RSA/SHA256, Sat 17 Aug 2013 01:28:36 AM IST, Key ID 2eb161fa246110c1
Source RPM : perl-Scalar-List-Utils-1.31-293.fc20.src.rpm
Build Date : Fri 16 Aug 2013 10:05:41 PM IST
Build Host : buildvm-06.phx2.fedoraproject.org
Relocations : (not relocatable)
Packager : Fedora Project
Vendor : Fedora Project
URL : http://search.cpan.org/dist/Scalar-List-Utils/
Summary : A selection of general-utility scalar and list subroutines
Description :
This package contains a selection of subroutines that people have expressed
would be nice to have in the perl core, but the usage would not really be
high enough to warrant the use of a keyword, and the size so small such
that being individual extensions would be wasteful
.
Probably this is the one your looking for
dpkg -p {package} Display details about package package group, version, maintainer, > Architecture, display depends packages, description etc dpkg -p lsof
NOTE: You've to write a script to query and find non-offical package

Is there a way to get an installed RPM's signature Key ID programatically?

As displayed by rpm -qi package?
I don't really want to parse the output of rpm -qi. I'd much rather use rpm -q --qf, of which I can control the format and is not subjected to a future version's aesthetic whims.
But the only useful tag I can find in the man page is SIGPGP, which gets me the entire signature, not only the short key id. See the difference:
$ rpm -qi coreutils
Name : coreutils Relocations: (not relocatable)
Version : 8.4 Vendor: Fedora Project
Release : 8.fc13 Build Date: Tue 20 Jul 2010 05:21:15 AM BRT
Install Date: Tue 03 Aug 2010 01:58:53 PM BRT Build Host: x86-17.phx2.fedoraproject.org
Group : System Environment/Base Source RPM: coreutils-8.4-8.fc13.src.rpm
Size : 12659257 License: GPLv3+
Signature : RSA/SHA256, Tue 20 Jul 2010 03:14:09 PM BRT, Key ID 7edc6ad6e8e40fde
Packager : Fedora Project
URL : http://www.gnu.org/software/coreutils/
Summary : A set of basic GNU tools commonly used in shell scripts
Description :
These are the GNU core utilities. This package is the combination of
the old GNU fileutils, sh-utils, and textutils packages.
$ rpm -q --qf '%{NAME}\t%{VERSION}\t%{RELEASE}\t%{ARCH}\t%{EPOCH}\t%{SIGPGP}\n' coreutils
coreutils 8.4 8.fc13 i686 (none) 8902150305004c45e7717edc6ad6e8e40fde010824c50fff6af998d5b67a663e6c165bbb3ff888afbe0961b7a60bab3d9a1605b271bbfaccc2eda4bc121e7bc8300efa0208100eb0961c021db2f0be52d422d21c0906a3252df125454fd4886af63574ed729c1370f583c0d46e4a97ee007b72966d965eed1891aaacf296ba31cb44fb46a20c5b39031b79c4eff66948aa3e79090a5f1ce969d3319ebbd47ff38ef382c64c1d59ba5c4d40b3d31a02620bd26005910ca98b7115ac24a30c2198f194bebb2347041ea094be23f5af2e6bb397736e8aff0dd95b4ebd2301ce00663180bbcf214559c72bc74a902102cdb2485b60c78e90c07ed76ecc78d44fd2ec710eb59937e513a37383b5f79a9a1a3996b614a8c1dc81eb8bd468b24aeceac378ee2da659978b5ebe7ab8b52ddb9342e45b2aa5d7b46c40904b57fd6e5ecf26e651c0dce46edb65ef54d26b73fbe99ac5757648c2e509e00887bb1373d30202a30e978407d9db3426d1f468ed4f88f3b379b14ac74b98167860fa36adc0768d6f33958e17c08a896f5aadcb6b70ce2c104454ab4d5b2e6166de465905d8aac14d5257324d50d78e9dc0b3836adc0817eacf5cd026e53330afefe24c6ad549d29b46f9bef544abfa4a87c66fc64c5281b453f72b3c6e660098c856d18031abb725792788ca6061603046170bfdfffb7772ee55299a2f92c996cd140470dba1b99f3c8e5e4a4f7c159fd0fae3fd1854335615e577fb5d05f5
To answer the actual question, no, there is no way to directly query for the keyid. I ran into the same problem you're having and found someone actually created a bug report with redhat for a feature to request that feature be added.
In the bug report, the responder says to use something like below:
rpm -q --qf "%|DSAHEADER?{%{DSAHEADER:pgpsig}}:{%|RSAHEADER?{%{RSAHEADER:pgpsig}}:{(none}|}| %{NVRA}\n" emacs | cut -d' ' -f11
Any reason you can't clip the relevant portion of SIGPGP with cut? I strongly suspect it's located at the same offset in every rpm header, but you should probably check RPMs from multiple sources just to be sure.

Resources