Home Ask Login Register

Developers Planet

Your answer is one click away!

Michelle Jun Lee February 2016

rpmbuild error file not found even though files are in the path

i did the following but gotten error when running rpmbuild

Files are there in path

Any help or hint are appreciated


rpmbuild -vv --buildroot $PWD/root --target x86_64 -bb bin-show.spec
Building target platforms: x86_64
Building for target x86_64
Processing files: helloworld-1.0-1.x86_64
error: File not found: /nobackup/username/prod/packaging/redhat/bin-show/root/etc/testpackage.conf

RPM build errors:
    File not found: /nobackup/username/prod/packaging/redhat/bin-show/root/etc/testpackage.conf

where bin-show.spec

# Hello World Spec File
Summary: Hello world!
Name: helloworld
Version: 1.0
Release: 1
License: Proprietary
Group: Applications/Utilities

This is my first RPM test package!


and the files structure


find . -name \*



Thomas Dickey February 2016

The messages from rpmbuild can be obscure. It is probably complaining

  • not that your filesystem lacks the file,
  • but rather that the corresponding pathname does not exist under the BUILDROOT directory.

It normally expects that your spec-file will construct a set of files and directories under ~/rpmbuild/BUILDROOT which it will collect into a package. You can override the location of the BUILDROOT directory (and appear to have done this). But your package expects


and (allowing for the apparent location of the BUILDROOT directory) you have given it


msuchy February 2016

Thomas is nearly correct about the origin of the error.

However rpmbuild expect that the file is present in


You should either create it in %install section:

echo some content > %{buildroot}/%{_sysconfdir}/testpackage.conf

or provide as SourceX:

Source1:  testpackage.conf

cp -a %{SOURCE1} %{buildroot}/%{_sysconfdir}/


Post Status

Asked in February 2016
Viewed 3,569 times
Voted 6
Answered 2 times


Leave an answer

Quote of the day: live life