I have installed dnf package on custom linux distribution(non fedora). dnf can able to pull and install the .rpm packages from the configured repository. I could not able to remove the packages via dnf remove command as dnf not maintaining the database of installed packages. Also, dnf list --installed does not showing the packages installed via dnf install.

Note: Both dnf and rpm packages are compiled from source. Instructions used are listed below.


/usr/bin/cmake -DCMAKE_TOOLCHAIN_FILE="/usr/src/rootfs/scripts/cmake" -DPYTHON_DESIRED:FILEPATH="/usr/bin/python3.6" -DCMAKE_INSTALL_LIBDIR=${LIB_NAME} -DCMAKE_INSTALL_PREFIX=/usr ..


make install


./configure --build=none --host="$TOOL_TRIPLET" --prefix=/usr --libdir=/usr/"$LIB_NAME" --disable-static --disable-nls --with-pcre=external --with-sqlite=yes --with-dbapi=sqlite --enable-debug=yes --with-libelf --enable-python


make install

  • The dnf software is a dependency manager for the rpm package manager. The database of installed packages would be stored via rpm and that is what would be read for dnf --installed. If you built dnf from source, you would also need to make sure rpm is also installed and used by your dnf. If your system is not a Fedora based distribution, then the already built rpm packages would be useless to you and you would have to make your own rpm packages and repositories for your custom Linux distribution. – GracefulRestart Mar 12 '19 at 22:25
  • I have created my own rpm packages and stored them in a repository. Also I can able to install the rpm packages using dnf. When I try to list the packages installed via dnf its not showing list of packages installed but I can able to get the list via rpm -qa command. And dnf trying to install the dependent package though it is already installed and failing with error message ** Error: Transaction check error: package XYZ-1.0-1.x86_64 is already installed ** – Krishnamoorthi M Mar 13 '19 at 4:49
  • When I try to remove the installed packages I am getting below messages No match for argument: XYZ No packages marked for removal. Dependencies resolved. Nothing to do. Complete! I can also remove it via rpm -e XYZ-1.0-1.x86_64 – Krishnamoorthi M Mar 13 '19 at 5:09
  • It sounds like your dnf is not using the rpm which you currently have installed to build the package database. Without knowing how you installed dnf or rpm, there is not much anyone can do to help. Please add that information to your question to hopefully get better answers. – GracefulRestart Mar 13 '19 at 17:52
  • Both rpm and dnf packages are built from source. I have updated the instruction used in my question. – Krishnamoorthi M Mar 15 '19 at 3:36

dnf is the package manager for fedora. Non Fedora OS will have their own package manager.

Ubuntu has apt-get, redhat has rpm. Arch linux has pacman and so on.

| improve this answer | |
  • My linux distribution doesn't have package management support at all. It is a Monolithic distribution. I am trying to add package management support to make it as modular. – Krishnamoorthi M Mar 12 '19 at 8:57
  • Then you will have to download the source code, compile packages and install them at relevant paths to use them. – GGJON Mar 12 '19 at 9:37
  • For more details, check this link howtogeek.com/105413/… – GGJON Mar 12 '19 at 9:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.