Dnf's recent argument

DNF has an option to list packages recently added into the repositories.

#  man dnf |grep recent
       dnf [options] list --recent [<package-file-spec>...]
              List packages recently added into the repositories.
       --recent
              Limit the resulting set to packages that were recently edited.
       dnf   [options]   repository-packages   <repoid>   info   --recent   [<pack‐
              List packages recently added into the repository.
       dnf   [options]   repository-packages   <repoid>   list   --recent   [<pack‐
              List packages recently added into the repository.
       of  the most recent transaction. The last form is last-<offset>, where <off‐
       most recent transaction.

Does someone has a clue about the time window that defines
this “–recent” option? (1,3,7,14,30 hours/days?) Thanks.

1 Like

The default value for dnf’s recent option is 7. The unit is days.

Source: libdnf/ConfigMain.cpp at 0.65.0 · rpm-software-management/libdnf · GitHub

OptionNumber<std::int32_t> recent{7, 0};

{7,0} means the default value is 7, the minimum value is 0, and there is no maximum limit.

The definition of OptionNumber can be seen here: libdnf/OptionNumber.hpp at 0.65.0 · rpm-software-management/libdnf · GitHub

You can configure the value for recent in /etc/dnf/dnf.conf by adding this line:

# file: /etc/dnf/dnf.conf
...
recent=7
...

Change the number 7 to the number of days you want “recent” to mean.

1 Like

Hello @ne0l ,
Could you please mark @robin217’s comment as the solution, since it is.

Thank you for clarifying this, @robin217. Very much appreciated!

1 Like