Closed mikhailnov closed 2 years ago
I've removed this check:
diff --git a/dnf/dnf-main.c b/dnf/dnf-main.c
index f26f36e..caebc9c 100644
--- a/dnf/dnf-main.c
+++ b/dnf/dnf-main.c
@@ -497,15 +497,6 @@ main (int argc,
*/
if (!show_help)
{
- if (installroot_used &&
- !(config_used && disable_plugins_loading && cachedir_used && reposdir_used && varsdir_used))
- {
- error = g_error_new_literal (G_OPTION_ERROR, G_OPTION_ERROR_BAD_VALUE,
- "The \"--installroot\" argument must be used together with \"--config\", "
- "\"--noplugins\", \"--setopt=cachedir=<path>\", \"--setopt=reposdir=<path>\", "
- "\"--setopt=varsdir=<path>\" arguments.");
- goto out;
- }
if (disable_plugins_loading)
dnf_context_set_plugins_all_disabled (disable_plugins_loading);
Now I get: "error: Could not find os-release in etc/, usr/etc, or usr/lib under source root '/tmp/microdnf-root'"
I expected microdnf to be able to bootstrap a chroot from scratch :(
I have created /tmp/microdnf-root/etc/os-release, there is nothing elase in this directory, and now microdnf works
[user@rosa2019 ~]$ mkdir -p /tmp/microdnf-root/etc
[user@rosa2019 ~]$ cp -v /etc/os-release /tmp/microdnf-root/etc
'/etc/os-release' -> '/tmp/microdnf-root/etc/os-release'
This kind of goes back to the thing that the $releasever
detection should be able to use the distroverpkg method like DNF does.
@mikhailnov
Microdnf does not know which release you want to install in the newly created (empty) "installroot". However, there is no need to create an "os-release" file. Releasever can be set with the command line argument --releasever
.
eg --releasever=35
for Fedora35
microdnf --noplugins --config=/etc/dnf/dnf.conf --setopt=cachedir=/var/cache/microdnf --setopt=reposdir=/etc/yum.repos.d --setopt=varsdir=/etc/dnf --installroot=/tmp/microdnf-root --releasever=35 install basesystem
You do not need to use the --releasever
command line argument in next run. The example installs the release file package in the installroot directory. So the next time you run it, microdnf will use it for autodetection.
DNF has the same behavior.
Using latest release