Search code examples
linuxcentos

Create a meta-package in CentOS 8


I’m trying to create a meta-package in CentOS 8 that installs vim and nano.

I built rpm-package via spec file. The spec file:

Summary: It's just a test meta_package
Version: 0.1 
Release: 1
Group: Applications/Internet
License: GPL 
BuildArch: noarch
Requires: nano, vim

%description
A test meta_package.

%prep 

%build

%install

%clean

%post
yum install -y nano
yum install -y vim

%files
%defattr(-,root,root)

%changelog

Building

rpmbuild --bb meta_package.spec

Then I launch it like

rpm -I meta_package-0.1-1.noarch.rpm

But packages haven’t been installed. Is there any possible solution to that?


Solution

  • For meta-packages, you must not specify dependencies in the %post section.

    You simply specify them with Requires: tag. Example:

    Requires: nano
    Requires: vim-enhanced
    

    Then use a package manager like yum or dnf to satisfy dependencies at install time.