diff --git a/dnf5/commands/versionlock/versionlock_add.cpp b/dnf5/commands/versionlock/versionlock_add.cpp index 35cc344683..4046504ead 100644 --- a/dnf5/commands/versionlock/versionlock_add.cpp +++ b/dnf5/commands/versionlock/versionlock_add.cpp @@ -97,7 +97,7 @@ void VersionlockAddCommand::run() { const libdnf5::ResolveSpecSettings settings{ .with_nevra = true, .with_provides = false, .with_filenames = false, .with_binaries = false}; for (const auto & spec : pkg_specs) { - libdnf5::rpm::PackageQuery query(ctx.base); + libdnf5::rpm::PackageQuery query(ctx.base, libdnf5::sack::ExcludeFlags::IGNORE_VERSIONLOCK); query.resolve_pkg_spec(spec, settings, false); if (query.empty()) { std::cerr << libdnf5::utils::sformat(_("No package found for \"{}\"."), spec) << std::endl; diff --git a/dnf5/commands/versionlock/versionlock_exclude.cpp b/dnf5/commands/versionlock/versionlock_exclude.cpp index d90dda389e..00bd534504 100644 --- a/dnf5/commands/versionlock/versionlock_exclude.cpp +++ b/dnf5/commands/versionlock/versionlock_exclude.cpp @@ -125,7 +125,7 @@ void VersionlockExcludeCommand::run() { const libdnf5::ResolveSpecSettings settings{ .with_nevra = true, .with_provides = false, .with_filenames = false, .with_binaries = false}; for (const auto & spec : pkg_specs) { - libdnf5::rpm::PackageQuery query(ctx.base); + libdnf5::rpm::PackageQuery query(ctx.base, libdnf5::sack::ExcludeFlags::IGNORE_VERSIONLOCK); query.resolve_pkg_spec(spec, settings, false); if (query.empty()) { std::cerr << libdnf5::utils::sformat(_("No package found for \"{}\"."), spec) << std::endl;