Hey,
i wonder if its possible to use dnf and dictate it to not install packages that are younger then $((today - 7 )) for example. If not directly possible, any other ways to accomplishing it? Sure, building repos with snapshots would work here but I am looking for additional ways ...
-- Thanks, Leon
On 14/11/2021 13:08, Leon Fauster via CentOS wrote:
Hey,
i wonder if its possible to use dnf and dictate it to not install packages that are younger then $((today - 7 )) for example. If not directly possible, any other ways to accomplishing it? Sure, building repos with snapshots would work here but I am looking for additional ways ...
-- Thanks, Leon
A couple ideas:
1. You could run weekly from a scrpt:
yum --assumeno update
which will create the transaction (but not install it) and save it to /tmp/ and then rerun that transaction week later:
yum --assumeyes load-transaction /tmp/yum_save_tx.2021-11-14.13-54.FhQii3.yumtx
2. Write a yum plugin to mask packages from the transaction sack that are less than 7 days old. How are your python skills?
Am 14.11.21 um 14:59 schrieb Phil Perry:
On 14/11/2021 13:08, Leon Fauster via CentOS wrote:
Hey,
i wonder if its possible to use dnf and dictate it to not install packages that are younger then $((today - 7 )) for example. If not directly possible, any other ways to accomplishing it? Sure, building repos with snapshots would work here but I am looking for additional ways ...
A couple ideas:
- You could run weekly from a scrpt:
yum --assumeno update
which will create the transaction (but not install it) and save it to /tmp/ and then rerun that transaction week later:
yum --assumeyes load-transaction /tmp/yum_save_tx.2021-11-14.13-54.FhQii3.yumtx
That's an interesting approach. Not sure if this is still valid for EL8? Some tests doesn't show any transaction artifact. Maybe I need to dive deeper ...
- Write a yum plugin to mask packages from the transaction sack that
are less than 7 days old. How are your python skills?
That seems to be the cleanest solution. Lets see if I find time for that. A quick look into repodata xml files shows that the build time is also there exposed ...
Thanks, Leon
On 15/11/2021 11:49, Leon Fauster via CentOS wrote:
Am 14.11.21 um 14:59 schrieb Phil Perry:
On 14/11/2021 13:08, Leon Fauster via CentOS wrote:
Hey,
i wonder if its possible to use dnf and dictate it to not install packages that are younger then $((today - 7 )) for example. If not directly possible, any other ways to accomplishing it? Sure, building repos with snapshots would work here but I am looking for additional ways ...
A couple ideas:
- You could run weekly from a scrpt:
yum --assumeno update
which will create the transaction (but not install it) and save it to /tmp/ and then rerun that transaction week later:
yum --assumeyes load-transaction /tmp/yum_save_tx.2021-11-14.13-54.FhQii3.yumtx
That's an interesting approach. Not sure if this is still valid for EL8? Some tests doesn't show any transaction artifact. Maybe I need to dive deeper ...
Yes, you are correct, 'yum load-transaction' is not available in dnf on RHEL8
https://access.redhat.com/solutions/5576651
I'm still mostly using el7 so never noticed :-)
- Write a yum plugin to mask packages from the transaction sack that
are less than 7 days old. How are your python skills?
That seems to be the cleanest solution. Lets see if I find time for that. A quick look into repodata xml files shows that the build time is also there exposed ...
Thanks, Leon
Am 15.11.21 um 22:08 schrieb Phil Perry:
On 15/11/2021 11:49, Leon Fauster via CentOS wrote:
Am 14.11.21 um 14:59 schrieb Phil Perry:
On 14/11/2021 13:08, Leon Fauster via CentOS wrote:
Hey,
i wonder if its possible to use dnf and dictate it to not install packages that are younger then $((today - 7 )) for example. If not directly possible, any other ways to accomplishing it? Sure, building repos with snapshots would work here but I am looking for additional ways ...
A couple ideas:
- You could run weekly from a scrpt:
yum --assumeno update
which will create the transaction (but not install it) and save it to /tmp/ and then rerun that transaction week later:
yum --assumeyes load-transaction /tmp/yum_save_tx.2021-11-14.13-54.FhQii3.yumtx
That's an interesting approach. Not sure if this is still valid for EL8? Some tests doesn't show any transaction artifact. Maybe I need to dive deeper ...
Yes, you are correct, 'yum load-transaction' is not available in dnf on RHEL8
I am experimenting with following now ...
# echo "recent=7" >> /etc/dnf/dnf.conf
# export DNFARGS=$(for e in $(dnf repoquery --recent) ; do echo -n "--exclude ${e} " ;done)
# dnf update ${DNFARGS}
-- Leon