How to list all the packages with dependencies within a package group in RedHat / CentOS 8 - centos

If I run the command
dnf groupinstall --downloadonly core
then it will
list all the packages which belongs to the package group core,
resolve their dependencies and
download the rpms locally.
What I want is not to download but only list. Is there any easy way to resolve all dependencies related to all packages pertaining to a particular package group?

I have no idea about the strait way to get the list. But you can download them w/o actually store them in your system:
dnf groupinstall --downloadonly --downloaddir=/dev/null core
This command will list all the packages to be downloaded so grab the output strip unnecessary lines and voila.
If this do not work you can try combination of:
yum deplist <package>
and
yum groupinfo core
You can get the list of packages with groupinfo and loop and get the dependencies via deplist

Related

Trouble with gitlab updating on redhat 8: nothing provides perl

I've in trouble with updating GitLab CE 15.0.x -> 15.4.0
dnf install gitlab-ce-15.4.0
conflicting requests
nothing provides perl needed by gitlab-ce-15.4.0-ce.0.el8.x86_64
(try to add '--skip-broken' to skip uninstallable packages or '--nobest' to use not only > best candidate packages)
dnf install perl
未找到匹配的参数: perl # no match parameters
错误:没有任何匹配 # error: no any match
I've searched a lot and I can't find a specific solution for this, it seems like in redhat8 the name of perl is perl-interpreter
# cat /etc/redhat-release
CentOS Linux release 8.0.1905 (Core)
# dnf list perl-interpreter
已安装的软件包 // installed packages
perl-interpreter.x86_64 4:5.26.3-416.el8 #anaconda
可安装的软件包 // installable packages
perl-interpreter.x86_64 4:5.26.3-420.el8 base

rpmbuild unable to find the custom installed package

There are plenty of perl packages missing in Centos 8 and Rocky Linux. So, I try to get the rpm spec by cpanspec and build rpm by myself. But, it seems like that rpmbuild could not find the rpm I built.
This is the script for me to build rpm.
cd /root/rpmbuild
cpanspec --packer 'Example <example#example.com>' <Perl-Package-Name>
mkdir SOURCES
cp <Perl-Package-Name>.tar.gz SOURCES
rpmbuild -ba perl-<Package-Name>.spec
Let's say we have two package A and B. A is needed by B.
I try to build both of the packages through the script above. I build A first, switch into /root/rpmbuild/RPMS/noarch and install A.rpm. Then, I try to build package B.
I got
error: Failed build dependencies:
perl(A) is needed by perl-<B>
I try to check the existence of package A.
yum list installed | grep A
and
perldoc -l A
Both of the commands show that A exists.
Did I miss something?
update 2022/06/07
I just gave up and commented the BuildRequires: A in B package. This is not a good approach but it works.

pacman -Syu errors occured, no packages were upgraded

Following problem:
After a fresh installation of Blackarch i want to execute
pacman -Syu
but after it downloaded all the packages i get the same error for all packages. For example:
/usr/lib/ruby/gems/2.5.0/gems/colorize-0.8.1/LICENSE exists in both 'ssrf-proxy and 'yawast'
This means that two packages claim ownership of the same file. In reality, they conflict, but the package maintainers haven't noticed and haven't updated MAKEPKG. You'll need to uninstall one of the packages. Use pacman -Qii <package> to inspect each package. If one was explicitly installed, then it's safe to remove with pacman -Rns <package>

yum downgrade does not remove new package

Release 1 contains the following packages
Package A-1.0
Package B-1.0
Release 2 contains the following packages
Package A-2.0
Package B-2.0
Package C-2.0
In Release 2, Package B-1.0 was split into two packages - package B-2.0 and package C-2.0.
Now when Release 2 is installed, how do I downgrade to Release 1?
yum downgrade A B tries to install package B-1.0 which has file conflicts with package C-2.0.
yum downgrade A B C does not work because there is no older version for Package C.
Is there a single command through which it erases the new package (package C-2.0) and downgrades packages A and B?
If you upgraded several packages and then you want to downgrade just those two, then it cannot be done. Not using just yum (unless you use --nodeps and temporary break deps). There are high level tools like RH Satellite, which can do that.
If you upgrade just those in separate transaction then you can run:
yum history list
yum history undo <ID>
or
yum history undo last
And it will rollback that transaction. I.e. in your case downgrade those packages.
See man page of yum for details about history command.
It might be too late as you have already released packages A-2.0 and B-2.0, but what you should have done (and can still do if you can delete your A-2.0 and B-2.0 packages):
In spec file of A-2.0 and B-2.0 add: Requires: C
This has multiple advantages you search (and more):
when updating A and/or B; C will be automatically installed.
when uninstalling C A and B will be downgraded.
However:
when downgrading A and B; C will not be uninstalled.
There is an alternative which I use for my projects: I use a meta-package:
meta-package-1.0: Requires A-1.0, B-1.0, Conflicts C
meta-package-2.0: Requires A-2.0, B-2.0, C-2.0
(and I use a branch with an unstable meta-package preparing next release: meta-package: Requires A, B)
You can use yum shell to write multiple operations before executing them all in a single transaction.
In your case, you can use the following:
yum shell
yum downgrade A B
yum remove C
run
you just need to use the repo that was referred while executing the earlier yum command.
yum history undo <yum_history_id> --enablerepo=<yum_repo>

yum update dependencies only

I install my new rpm package using yum install (my package name) command; yum command installs main rpm package along with dependencies; there is no issue.
If my main package is updated to new and higher version then yum update (my package name) work fine, without any issues.
Please note, I execute createrepo command whenever new rpm is copied into rpm collection folder.
Problem is: If only adependent rpm is upgraded i.e. to new version in rpm collection folder at repo server, How to update only dependent rpms on client machine (RH machine)?
What I tried:
1. sudo yum update (my package name) command always returns (my package name) is already updated but It did not even check dependencies for a new version
I added one more dependent pkg (deppkg) section in repo file like below:
[mainpkg]
name=simplest
baseurl="file:///home/anand/testcode/rpmtest/"
gpgcheck=0
[deppkg]
name=simplest
baseurl="file:///home/anand/testcode/rpmtest/"
gpgcheck=0
Having added one deppkg section, yum update deppkg started working which is obvious. Still, yum update mainpkg command still does not find new dependencies.
I do not want to go by 2nd option as there can be many pkgs and will have to add or delete time to time so it will be difficult in the long run.
Could you please let me know if there are any alternative ways which would be useful to update only dependencies from a remote machine?
Regards,
Anand Choubey
Just "sudo yum upgrade" should pull in the updates. Don't give it any package names.
Edit: If you only want the ones from your repo, you can do "sudo yum upgrade --disablerepo=* --enablerepo=yourreponame"
you can run sudo yum makecache to update repos
and sudo yum update --downloadonly to pull rpm's without installing it