Reputation: 35
Can I install different packages from my own rpm-package (that's my task, other variants, like shell-script is denied) on CentOS 7? I'm trying to understand spec-file format of rpmbuild, so I use some minimal configuration of this file. I'm create an rpm-package (let's call it test.rpm), launch it with "rpm -i test.rpm" and see that "yum install" from %post is launch, but stuck in "Running transaction" level of installation. SELINUX is disabled.
Here is my test.spec:
Name: test_script_name
Summary: It's just a test_script_summary
Version: 0.1
Release: 1
Group: Applications/Internet
License: GPL
BuildArch: noarch
%description
A test_script_description.
%prep
%build
%install
%clean
%post
yum install -y lynx
%files
%defattr(-,root,root)
%changelog
* Tue Dec 08 2015 test test <[email protected]>
- test_script_changelog!
I'm build my test.rpm with:
rpmbuild --bb test.spec
Launch it with:
rpm -i test.rpm
And here is a part of yum output that shown during installation:
Total download size: 1.5 M
Installed size: 5.4 M
Downloading packages:
(1/2): centos-indexhtml-7-9.el7.centos.noarch.rpm | 92 kB 00:00:00
(2/2): lynx-2.8.8-0.3.dev15.el7.x86_64.rpm | 1.4 MB 00:00:00
-----------------------------------------------------------------------------------------------------------------------
Total 2.4 MB/s | 1.5 MB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Warning: RPMDB altered outside of yum.
That's all of the output. Package didn't installed. Please, help me. Thank you.
Upvotes: 1
Views: 2044
Reputation: 54455
Addressing OP's question: no, you cannot install one rpm from within another rpm. To do what you want, you can list other packages as dependencies using the Requires
tag.
Further reading:
RPM dependencies are discussed here:
As a rule, you should use yum
for installing (even locally built packages) to keep its database up to date.
Upvotes: 2
Reputation: 3443
If you will define this package as Requirements:
Requires: lynx
Then it will be installed as dependencies after the following command:
yum localinstall test.rpm
look the question about autoinstallation dependencies
Upvotes: 3