Is yum aware of package chronology? - yum

Is yum aware of package chronology?
Suppose I build a package MY-PKG-0.40-1 and publish it in a yum repo with createrepo --update. Then I build another package with a lower version (from a different VCS branch), MY-PKG-0.38-5.
yum list recent seems to show the greatest version, not the latest one. However from the man page
yum list recent
List packages recently added into the repositories. This is often not
helpful, but what you may really want to use is
"yum list-updateinfo new" from the security yum plugin.
I've experimented with list-updateinfo new and finding little success. yum list-updateinfo new MY-PKG seems to return repositories the package belongs to...
What I want is something like yum list latest MY-PKG to return 0.38-5, given it's the latest version published to the repository, despite having already published 0.40-1.

The answer here is yes. Since yum manages RPMs and running rpm -qi <package> will list a Build Date field (which is part of the package header).
After digging around on the net, the yum python libraries, and working off some of the code samples on the yum wiki, I was able to code up a working sample which lists the latest version of a package.
#!/usr/bin/python
import sys
import yum
package = sys.argv[1:]
yb = yum.YumBase()
yb.conf.cache = 0 # Must run as root to search packages w/o cache
pl = yb.doPackageLists(patterns=package, pkgnarrow='all', showdups=True)
print 'Searching for latest version of package: ' + str(package[0])
if pl.available:
package = ''
latest = 0
for pkg in sorted(pl.available):
# XXX Works with sqlitesack, unsure if it works with rpmsack
buildtime = pkg['buildtime']
# If we're looking at the latest package, update the version
# and textual name for reference
if max(latest, buildtime) == buildtime:
latest = buildtime
package = pkg
print "Latest Package"
print package

Related

Centos 8, yum update command not working. given following error. can't find php-common-7.2

I've tried to remove php-common-7.2 but couldn't find where it located.
Problem: package php-pecl-igbinary-3.2.2-1.el8.remi.7.2.x86_64 requires php(api) = 20170718-64, but none of the providers can be installed
- package php-pecl-igbinary-3.2.2-1.el8.remi.7.2.x86_64 requires php(zend-abi) = 20170718-64, but none of the providers can be installed
- cannot install both php-common-7.2.34-3.el8.remi.x86_64 and php-common-7.4.16-1.el8.remi.x86_64
- cannot install both php-common-7.2.34-4.el8.remi.x86_64 and php-common-7.4.16-1.el8.remi.x86_64
- cannot install the best update candidate for package php-pecl-igbinary-3.2.1-1.el8.remi.7.4.x86_64
- problem with installed package php-common-7.4.16-1.el8.remi.x86_64
- package php-common-7.2.24-1.module_el8.2.0+313+b04d0a66.x86_64 is filtered out by modular filtering
(try to add '--allowerasing' to command line to replace conflicting packages or '--skip-broken' to skip uninstallable packages or '--nobest' to use not only best candidate packages)
My server configuration is
NAME="CentOS Linux"
VERSION="8"
ID="centos"
ID_LIKE="rhel fedora"
VERSION_ID="8"
PLATFORM_ID="platform:el8"
PRETTY_NAME="CentOS Linux 8"
ANSI_COLOR="0;31"
CPE_NAME="cpe:/o:centos:centos:8"
HOME_URL="https://centos.org/"
BUG_REPORT_URL="https://bugs.centos.org/"
CENTOS_MANTISBT_PROJECT="CentOS-8"
CENTOS_MANTISBT_PROJECT_VERSION="8"
Apache Web Server
php7.4-cli
using Webmin & virtaulmin`
You are trying to install igbinary extension for PHP 7.2 with PHP 7.4. This cannot work.
For a proper configuration, please follow the Wizard instructions
And not enough information for more help:
rpm -qa php\*
dnf repolist
dnf module list PHP

Msys2 included packages

Is there a way to find out what default packages are installed along with Msys2 installation. I see that there is openssh, curl, git installed which I didn't. If there is a list that would also be useful. The official base package repository has a long list with thousands of entry.
After installing MSYS2, run pacman -Q to list the packages that are installed.

Control yum update packages sequence

Couldn't find an answer anywhere so I will try here.
Is there a way to tell yum, while running yum update, to update a specific package as the last one?
I am not talking about requires / dependencies, It just needs to be updated after all other packages on the system.
In a nutshell, I manage local repositories in my environment and this particular rpm holds the version for each repository, so by updating it as last I can label the client with that particular version.
You can run two yum commands. First one excluding the .rpm that you don't want to be updated and second, running your usual update.
$ yum --exclude="foo*.rpm" update
If foo*.rpm comes from a particular repository, then during the update, you can disable it using its name. Name of a repository can be found by looking into /etc/yum.repos.d/*.repo file or using the command
$ yum repolist
Then disable the repo and update. Note, this will disable update of all packages coming from this repo.
$ yum --disablerepo="nameOfRepo" update
Finally, run your usual update
$ yum update

FreeBSD pkg repository not updating and thinks it is up to date

I was installing a package using pkg and cancelled during the update check phase. I think this bugged it and now when I run pkg update it says it is on the latest versions. However, it most definitely is not.
Is there a way to force a clean repo list to pull the latest version info?
This is the error when I try to install php56 for example:
username#shavedbox:/usr/home/username # pkg install php56
Updating FreeBSD repository catalogue...
FreeBSD repository is up-to-date.
All repositories are up-to-date.
The following 1 packages will be affected (of 0 checked):
New packages to be INSTALLED:
php56: 5.6.6
The process will require 15 MiB more space.
2 MiB to be downloaded.
Proceed with this action? [y/N]: y
pkg: http://pkg.FreeBSD.org/FreeBSD:10:amd64/latest/All/php56-5.6.6.txz: Not Found
(The most recent version is 5.6.7 so the file is obviously not found)
Any help is greatly appreciated! Not too used to FreeBSD...
The answer was simple.
pkg update -f
And then it worked fine. I need sleep.

Trying to get yum to install dependencies from own repo

I have created a yum repository on a machine I have. I have thrown certain RPM's into it and created the repo. On my second machine I am able to view these repos and the files in them by doing a yum list. The second part of this is I have done a spec file that creates an rpm that depends on all of the RPM's in this specific repo but when I do a yum install createdrpm it determines the correct dependencies, but does not install them from my own repo.
I have tried searching over the web for this, but no luck unfortunately. If someone can point me in the right direction that would be great.
Thanks
In the rpm spec file, the Requires section should list the package names that are shown in the yum repo, not the rpm filenames.
For example:
yum list | grep something
something.noarch v1.0
The rpm spec file should have:
Require: something >= 1.0