我可以在CentOS 7上從我自己的rpm-package(這是我的任務,其他變體,如shell腳本被拒絕)安裝不同的軟件包嗎?我試圖理解rpmbuild的spec文件格式,所以我使用這個文件的一些最小配置。我創建了一個rpm包(我們稱之爲test.rpm),使用「rpm -i test.rpm」啓動它,並看到%post的「yum install」啓動,但卡在「Running transaction」級別安裝。 SELINUX被禁用。我可以從我自己的rpm包安裝不同的軟件包嗎?
這裏是我的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!
我建立我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'''節中聲明規範文件。 – Sild
是的,只是忘了添加它。這是「百勝安裝test.rpm」輸出結束:下載包: 運行的事務檢查 運行的事務測試 交易測試成功 運行的事務 \t安裝:test_script_name-0.1-1.noarch –
的Lync包沒有安裝後這條路? – Sild