Skip to main content
19 votes

RPM install file conflict from previous install

you cannot install twice the same rpm. Therefore if you want to install a newer version of the same rpm (mypackage in your case); you need to use the -U | --upgrade option. Typical usage of rpm goes ...
Chris Maes's user avatar
  • 3,422
8 votes
Accepted

Where I can find original CentOS RPM Spec files?

You can find all the source packages (SRPMs) in the CentOS vault; for example, you’ll find the source packages for 7.5 here. EPEL SRPMs are likewise available from Fedora (where they’re maintained); ...
Stephen Kitt's user avatar
6 votes
Accepted

What does "-14" mean in a dump of RPM macros

RPM macros have an associated level which is the recursion depth. When returning from a recursive expansion, macros at that level are automatically undefined. Macros with a level <= 0 are always ...
Jeff Johnson's user avatar
6 votes
Accepted

%dir doesn't seem to work in spec file

From Maximum RPM: Taking the RPM Package Manager to the Limit if a directory is specified in the %files list, the contents of that directory, and the contents of every directory under it, will ...
jsbillings's user avatar
  • 24.6k
5 votes
Accepted

If I do not care about debug support in red hat packages, what are the drawbacks of turning build-id support off in the specs file?

--excludepath=/usr/lib/.build-id is a clean workaround, yes. As far as I’m aware, losing “debug capabilities” is the only drawback; files skipped by this option won’t even cause rpm --verify to fail. ...
Stephen Kitt's user avatar
5 votes
Accepted

giving variables a default value in a spec file

You should be able to use a conditional %if "%{?myname}" == "" %define myname my_name %endif For example, using a very basic spec file: % cat foo.spec %if "%{?foo}" == &...
Stephen Harris's user avatar
4 votes
Accepted

How can I reliably modify build configs and add compiler flags in C/C++ RPM files?

The most universal way that would apply to most packages is customizing optflags macro. You can create $HOME/.rpmrc and put your customized value for it. To get the current value for our OS, you can ...
Danila Vershinin's user avatar
4 votes
Accepted

How to acquire SPEC files from SRPM?

For Fedora, you can find the sources on any of the official mirrors: http://mirrors.kernel.org/fedora/releases/29/Everything/source/tree/Packages/ You should also be able to use dnf download --...
GracefulRestart's user avatar
4 votes
Accepted

yum: install local RPMs and all local dependencies

localinstall won't pick the other RPMs from the folder automatically, it will try to install only the packages specified in the command (and it also installs dependencies but only from system ...
Vojtech Trefny's user avatar
4 votes
Accepted

Why does yum install stall when performing an RPM install from my spec file?

There is a good chance your RPM database is trying to eat itself at that point. The DB is already open, but then you're tryin to open it again before it's closed. You're deliberately creating a race ...
John's user avatar
  • 17.1k
3 votes
Accepted

How can you specify ./configure args with rpmbuild?

If you don’t want (or need) the standard arguments provided by the %configure macro, you don’t need to use it: %build ./configure ... make (./ instead of %.) You should still use the appropriate ...
Stephen Kitt's user avatar
3 votes

cron job setup using rpm is not working

You are confused about the meaning of the %install section. The sections %prep %build %install %check run on the machine where you build the rpm package, not on the machine where the rpm is ...
Chris Maes's user avatar
  • 3,422
3 votes
Accepted

How do I set a RPM package to require Java 8 or higher, whose dependencies can be satisfied by Java 11

For now, the OpenJDK 11 packages in RHEL 7 and 8 don’t provide java-headless, jre-headless, or any of the unversioned Java packages. (As I understand it, the reason is that OpenJDK 11 isn’t guaranteed ...
Stephen Kitt's user avatar
3 votes

What does "-14" mean in a dump of RPM macros

I asked on rpm-ecosystem mailing list. See: http://lists.rpm.org/pipermail/rpm-ecosystem/2017-March/000476.html In case of "rpm --showrc" such a negative number represents the "source" or "...
msuchy's user avatar
  • 1,480
3 votes

rpm: define my own variable in spec file

Define your variable at the beginning: %define my_var my_value and use it with %{my_var}. According to rpm packaging guide - defining your own macros, %global can be used too. See also: https://rpm-...
thanasisp's user avatar
  • 8,252
3 votes
Accepted

Why can't I see print statements in my RPM spec file?

The %pre and %post scriptlets are run at install time, not at build time. You will not see these statements echo'ed out during the rpmbuild, you will see them when you install the package with rpm -i.
John's user avatar
  • 17.1k
2 votes

Defining macros for authoring RPM files that require Python 3

Most modern packages put macros to /usr/lib/rpm/macros.d/. The macros defined by that package is there. That package fromIUS repository define macros: %__python36, %python36_sitelib...
msuchy's user avatar
  • 1,480
2 votes

How do you use rpmbuild to make an rpm package when there are file not found or permission errors?

This error: error: File not found: /root/rpmbuild/BUILDROOT/wget-1.19-1.x86_64/usr/local/bin/wget means that you specified this file in %files section: %files /usr/local/bin/wget so rpmbuild ...
msuchy's user avatar
  • 1,480
2 votes
Accepted

Rpmlint "use-tmp-in-%postun" error

always try to avoid %post and %postun scripts if possible. You could make those aci files or folders belong to your package. let's suppose for the sake of the example that /var/aci is a folder and /...
Chris Maes's user avatar
  • 3,422
2 votes

What are some effective ways to build & run an SRPM without installing it?

the %install step when building an rpm doesn't actually install the binaries on your system, it installs the binaries in the RPM_BUILD_ROOT, that is justs one of the rpm build steps. Your workflow ...
Chris Maes's user avatar
  • 3,422
2 votes

What are some effective ways to build & run an SRPM without installing it?

Building RPMs should not install any of the resulting binaries onto your system (at least I have never observed that behavior using rpmbuild). Though it does normally require installing the SRPM and ...
GracefulRestart's user avatar
2 votes

RPM Spec file %setup macro when you don't know the root name?

you can just use: %prep %setup -q -c %install cd myproject-* # continue installation here the -c option: %setup expects the archive to create its own top-level directory. If this isn't the case, ...
Chris Maes's user avatar
  • 3,422
2 votes

Yum is not respecting `Requires` maximum version. How can I debug and check what yum thinks the dependency version is?

you can ask rpm to tell you the requirement for your test package: if it is installed: rpm -q test --requires if it is not installed: rpm -qp /path/to/test.rpm --requires that could help you out. ...
Chris Maes's user avatar
  • 3,422
2 votes
Accepted

Build RPM subpackages without a base package

As far as the binary RPMs are concerned, the main package and its subpackages are equal. I can think of a couple of reasons subpackages are called that: they are described as “variants” of the main ...
Stephen Kitt's user avatar
2 votes
Accepted

Fedora 33 RPM package provides its own libraries won't install says "nothing provides"

Given the avalanche of responses, I guess I have to post my own answer. This is what actually worked. ======= Name: @PACKAGE@ Version: @RPM_VERSION@ Release: @RPM_RELEASE@ Summary: ...
user3450148's user avatar
2 votes

Linux RPMBUILD SPEC, how to Install to custom location /usr/local/file1 not always /usr dirctory

Your make install step shouldn’t repeat the path: make install DESTDIR=$RPM_BUILD_ROOT Better still, the make_install macro should do everything for you: %install %make_install
Stephen Kitt's user avatar
2 votes
Accepted

Make OS-dependent Requires section in an RPM spec file

You could omit the conditionals and depend on the semanage exectutable instead of the policycoreutils-python package: Requires(post): %{_sbindir}/semanage Requires(post): %{_sbindir}/restorecon See ...
Andreas Vögele's user avatar
2 votes

Make OS-dependent Requires section in an RPM spec file

The conditional in SPEC file are evaluating during build time. So when you SPEC file contains: %if %{rhel} < 8 Requires(post): policycoreutils-python %endif %if %{rhel} == 8 Requires(post): ...
msuchy's user avatar
  • 1,480
2 votes
Accepted

RPM macro and quotes

Just remove the quotes: %define completions_dir %( pkg-config --variable=completionsdir bash-completion ) instead of %define completions_dir "%( pkg-config --variable=completionsdir bash-...
msuchy's user avatar
  • 1,480
2 votes
Accepted

automatically activate service after RPM was installed

Does it mean I should not be adding .preset file in my rpm? Yes, you shouldn't put the .preset file in your service's package RPM but it is not happening It's not happening because the systemd ...
Danila Vershinin's user avatar

Only top scored, non community-wiki answers of a minimum length are eligible