【发布时间】:2016-03-16 01:37:06
【问题描述】:
我可以在 CentOS 7 上从我自己的 rpm-package 安装不同的软件包(这是我的任务,其他变体,如 shell-script 被拒绝)?我正在尝试了解 rpmbuild 的规范文件格式,因此我使用了该文件的一些最小配置。我正在创建一个 rpm 包(我们称之为 test.rpm),使用“rpm -i test.rpm”启动它,并看到来自 %post 的“yum install”已启动,但停留在“运行事务”级别安装。 SELINUX 被禁用。
这是我的 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 <test@test.com>
- test_script_changelog!
我正在构建我的 test.rpm:
rpmbuild --bb test.spec
启动它:
rpm -i test.rpm
这是安装过程中显示的 yum 输出的一部分:
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.
这就是所有的输出。未安装软件包。请帮我。谢谢。
【问题讨论】:
-
您是否尝试使用
yum install test.rpm而不是rpm -i test.rpm?这些情况也应在规范文件的Requires部分声明。 -
是的,只是忘记添加了。那是“yum install test.rpm”输出的结尾: Downloading packages: Running transaction check Running transaction test Transaction test succeeded Running transaction正在安装:test_script_name-0.1-1.noarch
-
这种方式后没有安装lync包?