yum install multiple packages requiring all for success
Clash Royale CLAN TAG#URR8PPP
On centos 7 (docker), I see yum install
command with several packages succeeds even if some are not found. This is nasty for scripting :-(
(in this example golang
not found because I didn't add EPEL repo)
[root@1ec73c6c476b /]# yum install golang nano
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
Resolving Dependencies
--> Running transaction check
---> Package nano.x86_64 0:2.3.1-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================
Installing:
nano x86_64 2.3.1-10.el7 base 440 k
Transaction Summary
==============================================================================================================================================================================================
Install 1 Package
Total download size: 440 k
Installed size: 1.6 M
Is this ok [y/d/N]: y
Downloading packages:
nano-2.3.1-10.el7.x86_64.rpm | 440 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : nano-2.3.1-10.el7.x86_64 1/1
Verifying : nano-2.3.1-10.el7.x86_64 1/1
Installed:
nano.x86_64 0:2.3.1-10.el7
Complete!
[root@1ec73c6c476b /]# echo $?
0
It only exits 0 if all specified packages are missing:
[root@1ec73c6c476b /]# yum install foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package foo available.
Error: Nothing to do
[root@1ec73c6c476b /]# yum install golang foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
No package foo available.
Error: Nothing to do
According to https://access.redhat.com/solutions/321603, the latter behavior is new in RHEL 6, per this changelog: https://github.com/rpm-software-management/yum/blob/master/ChangeLog#L3749-L3762
... If all package(s) are "not found", yum turns the message "Nothing to do" into an error (returns 1, atm). ...thus:
yum install -y a b && echo worked
This will echo "worked" if either a or b is installed after yum finishes, but tries to install both.
yum install a && yum install b && echo worked
This will echo "worked" if both are installed (and if a is not available, b will not even try to be installed).
But presumably, a single yum install a b
is faster and in complex cases better at dependency resolution than yum install a && yum install b
(?)
Q: Is there any flag/config to install many packages in one yum invocation, requiring all to be found for success?
centos yum
add a comment |
On centos 7 (docker), I see yum install
command with several packages succeeds even if some are not found. This is nasty for scripting :-(
(in this example golang
not found because I didn't add EPEL repo)
[root@1ec73c6c476b /]# yum install golang nano
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
Resolving Dependencies
--> Running transaction check
---> Package nano.x86_64 0:2.3.1-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================
Installing:
nano x86_64 2.3.1-10.el7 base 440 k
Transaction Summary
==============================================================================================================================================================================================
Install 1 Package
Total download size: 440 k
Installed size: 1.6 M
Is this ok [y/d/N]: y
Downloading packages:
nano-2.3.1-10.el7.x86_64.rpm | 440 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : nano-2.3.1-10.el7.x86_64 1/1
Verifying : nano-2.3.1-10.el7.x86_64 1/1
Installed:
nano.x86_64 0:2.3.1-10.el7
Complete!
[root@1ec73c6c476b /]# echo $?
0
It only exits 0 if all specified packages are missing:
[root@1ec73c6c476b /]# yum install foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package foo available.
Error: Nothing to do
[root@1ec73c6c476b /]# yum install golang foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
No package foo available.
Error: Nothing to do
According to https://access.redhat.com/solutions/321603, the latter behavior is new in RHEL 6, per this changelog: https://github.com/rpm-software-management/yum/blob/master/ChangeLog#L3749-L3762
... If all package(s) are "not found", yum turns the message "Nothing to do" into an error (returns 1, atm). ...thus:
yum install -y a b && echo worked
This will echo "worked" if either a or b is installed after yum finishes, but tries to install both.
yum install a && yum install b && echo worked
This will echo "worked" if both are installed (and if a is not available, b will not even try to be installed).
But presumably, a single yum install a b
is faster and in complex cases better at dependency resolution than yum install a && yum install b
(?)
Q: Is there any flag/config to install many packages in one yum invocation, requiring all to be found for success?
centos yum
add a comment |
On centos 7 (docker), I see yum install
command with several packages succeeds even if some are not found. This is nasty for scripting :-(
(in this example golang
not found because I didn't add EPEL repo)
[root@1ec73c6c476b /]# yum install golang nano
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
Resolving Dependencies
--> Running transaction check
---> Package nano.x86_64 0:2.3.1-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================
Installing:
nano x86_64 2.3.1-10.el7 base 440 k
Transaction Summary
==============================================================================================================================================================================================
Install 1 Package
Total download size: 440 k
Installed size: 1.6 M
Is this ok [y/d/N]: y
Downloading packages:
nano-2.3.1-10.el7.x86_64.rpm | 440 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : nano-2.3.1-10.el7.x86_64 1/1
Verifying : nano-2.3.1-10.el7.x86_64 1/1
Installed:
nano.x86_64 0:2.3.1-10.el7
Complete!
[root@1ec73c6c476b /]# echo $?
0
It only exits 0 if all specified packages are missing:
[root@1ec73c6c476b /]# yum install foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package foo available.
Error: Nothing to do
[root@1ec73c6c476b /]# yum install golang foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
No package foo available.
Error: Nothing to do
According to https://access.redhat.com/solutions/321603, the latter behavior is new in RHEL 6, per this changelog: https://github.com/rpm-software-management/yum/blob/master/ChangeLog#L3749-L3762
... If all package(s) are "not found", yum turns the message "Nothing to do" into an error (returns 1, atm). ...thus:
yum install -y a b && echo worked
This will echo "worked" if either a or b is installed after yum finishes, but tries to install both.
yum install a && yum install b && echo worked
This will echo "worked" if both are installed (and if a is not available, b will not even try to be installed).
But presumably, a single yum install a b
is faster and in complex cases better at dependency resolution than yum install a && yum install b
(?)
Q: Is there any flag/config to install many packages in one yum invocation, requiring all to be found for success?
centos yum
On centos 7 (docker), I see yum install
command with several packages succeeds even if some are not found. This is nasty for scripting :-(
(in this example golang
not found because I didn't add EPEL repo)
[root@1ec73c6c476b /]# yum install golang nano
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
Resolving Dependencies
--> Running transaction check
---> Package nano.x86_64 0:2.3.1-10.el7 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==============================================================================================================================================================================================
Package Arch Version Repository Size
==============================================================================================================================================================================================
Installing:
nano x86_64 2.3.1-10.el7 base 440 k
Transaction Summary
==============================================================================================================================================================================================
Install 1 Package
Total download size: 440 k
Installed size: 1.6 M
Is this ok [y/d/N]: y
Downloading packages:
nano-2.3.1-10.el7.x86_64.rpm | 440 kB 00:00:00
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
Installing : nano-2.3.1-10.el7.x86_64 1/1
Verifying : nano-2.3.1-10.el7.x86_64 1/1
Installed:
nano.x86_64 0:2.3.1-10.el7
Complete!
[root@1ec73c6c476b /]# echo $?
0
It only exits 0 if all specified packages are missing:
[root@1ec73c6c476b /]# yum install foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package foo available.
Error: Nothing to do
[root@1ec73c6c476b /]# yum install golang foo
Loaded plugins: fastestmirror, ovl
Loading mirror speeds from cached hostfile
* base: centos.interhost.net.il
* extras: centos.interhost.net.il
* updates: centos.interhost.net.il
No package golang available.
No package foo available.
Error: Nothing to do
According to https://access.redhat.com/solutions/321603, the latter behavior is new in RHEL 6, per this changelog: https://github.com/rpm-software-management/yum/blob/master/ChangeLog#L3749-L3762
... If all package(s) are "not found", yum turns the message "Nothing to do" into an error (returns 1, atm). ...thus:
yum install -y a b && echo worked
This will echo "worked" if either a or b is installed after yum finishes, but tries to install both.
yum install a && yum install b && echo worked
This will echo "worked" if both are installed (and if a is not available, b will not even try to be installed).
But presumably, a single yum install a b
is faster and in complex cases better at dependency resolution than yum install a && yum install b
(?)
Q: Is there any flag/config to install many packages in one yum invocation, requiring all to be found for success?
centos yum
centos yum
asked Feb 6 at 12:36
Beni Cherniavsky-PaskinBeni Cherniavsky-Paskin
1063
1063
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499034%2fyum-install-multiple-packages-requiring-all-for-success%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499034%2fyum-install-multiple-packages-requiring-all-for-success%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown