Why is the yum exit status on "Nothing to do" returns different in between Red Hat Enterprise Linux 5 and 6?
Issue
- When running a yum command where the result returns that no actions are necessary, the exit status of the yum command is different between Red Hat Enterprise Linux 5 and 6:
[root@system ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 5.9 (Tikanga)
[root@tester ~]# yum install tester
Loaded plugins: rhnplugin, security
This system is receiving updates from RHN Classic or RHN Satellite.
Setting up Install Process
No package tester available.
Nothing to do
[root@system ~]# echo $?
0
On RHEL6, yum exits with a status 1:
[root@system ~]# cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
[root@system ~]# yum install ipvsadm
Loaded plugins: product-id, rhnplugin, security, subscription-manager
Updating certificate-based repositories.
Unable to read consumer identity
Setting up Install Process
No package ipvsadm available.
Error: Nothing to do
[root@system ~]# echo $?
1
Environment
- Red Hat Enterprise Linux 5 & 6
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.
Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.
