Is there a Yum Option that Creates an Error if a Package is Missing?
Clash Royale CLAN TAG#URR8PPP
up vote
5
down vote
favorite
I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.
Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?
yum --disablerepo=* --enablerepo=myrepo --nogpgcheck
--installroot=/var/some/place/test install
abasdfasfeafseasfeasef bash coreutils utils-linux
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package **abasdfasfeafseasfeasef** available.
No package **utils-linux** available.
<snip>
Complete!
I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.
yum configuration
add a comment |Â
up vote
5
down vote
favorite
I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.
Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?
yum --disablerepo=* --enablerepo=myrepo --nogpgcheck
--installroot=/var/some/place/test install
abasdfasfeafseasfeasef bash coreutils utils-linux
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package **abasdfasfeafseasfeasef** available.
No package **utils-linux** available.
<snip>
Complete!
I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.
yum configuration
add a comment |Â
up vote
5
down vote
favorite
up vote
5
down vote
favorite
I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.
Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?
yum --disablerepo=* --enablerepo=myrepo --nogpgcheck
--installroot=/var/some/place/test install
abasdfasfeafseasfeasef bash coreutils utils-linux
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package **abasdfasfeafseasfeasef** available.
No package **utils-linux** available.
<snip>
Complete!
I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.
yum configuration
I am using a set of local yum repositories and trying to install a set of packages from those repos. I noticed that when one of the packages on the command line does not exist, Yum just prints out that it was not found and goes along its merry way.
Can I make Yum quit when this happens? Is there some other Yum utility that I can use to give it my repos and my packages and tell me if there is a problem?
yum --disablerepo=* --enablerepo=myrepo --nogpgcheck
--installroot=/var/some/place/test install
abasdfasfeafseasfeasef bash coreutils utils-linux
Loaded plugins: fastestmirror, langpacks
Loading mirror speeds from cached hostfile
No package **abasdfasfeafseasfeasef** available.
No package **utils-linux** available.
<snip>
Complete!
I am calling Yum from another script and don't appear to have a way to tell if the packages that I installed are really installed.
yum configuration
yum configuration
edited Oct 31 '14 at 21:36
Anthon
59.3k1798161
59.3k1798161
asked Oct 31 '14 at 21:32
Randy
1263
1263
add a comment |Â
add a comment |Â
3 Answers
3
active
oldest
votes
up vote
3
down vote
Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:
yum -y install epel-release &&
yum -y install dnf
Then on a missing package you'll get an error:
dnf -y install foobar
Error: no package matched: foobar
Your first snippet gives another answer on its own: just useyum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that package
â kbolino
May 10 at 0:08
add a comment |Â
up vote
0
down vote
I don't know about yum, but you can ask whether a package is installed using rpm -q my_package ...
. It will exit with failure status if any of the packages are missing.
$ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
package abasdfasfeafseasfeasef is not installed
bash-4.1.2-9.el6_2.x86_64
coreutils-8.4-19.el6.x86_64
package utils-linux is not installed
$ echo $?
1
$ rpm -q bash
bash-4.1.2-9.el6_2.x86_64
$ echo $?
0
In my situation, I know that the package is not installed because I am installing into a local directory (--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
â Randy
Oct 31 '14 at 21:43
How aboutrpm --root=/var/some/place/test -q ...
?
â Jander
Oct 31 '14 at 22:06
add a comment |Â
up vote
0
down vote
yum --setopt=skip_missing_names_on_install=False <commands-here>
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
3
down vote
Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:
yum -y install epel-release &&
yum -y install dnf
Then on a missing package you'll get an error:
dnf -y install foobar
Error: no package matched: foobar
Your first snippet gives another answer on its own: just useyum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that package
â kbolino
May 10 at 0:08
add a comment |Â
up vote
3
down vote
Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:
yum -y install epel-release &&
yum -y install dnf
Then on a missing package you'll get an error:
dnf -y install foobar
Error: no package matched: foobar
Your first snippet gives another answer on its own: just useyum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that package
â kbolino
May 10 at 0:08
add a comment |Â
up vote
3
down vote
up vote
3
down vote
Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:
yum -y install epel-release &&
yum -y install dnf
Then on a missing package you'll get an error:
dnf -y install foobar
Error: no package matched: foobar
Try using dnf instead of yum, it will fail if a package isn't available the way yum used to. On CentOS you can install it via:
yum -y install epel-release &&
yum -y install dnf
Then on a missing package you'll get an error:
dnf -y install foobar
Error: no package matched: foobar
answered May 5 '17 at 3:02
ctindel
312
312
Your first snippet gives another answer on its own: just useyum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that package
â kbolino
May 10 at 0:08
add a comment |Â
Your first snippet gives another answer on its own: just useyum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that package
â kbolino
May 10 at 0:08
Your first snippet gives another answer on its own: just use
yum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that packageâ kbolino
May 10 at 0:08
Your first snippet gives another answer on its own: just use
yum -y install foo && yum -y install bar && ...
-- yum install will fail if it it's given just 1 package and it can't install that packageâ kbolino
May 10 at 0:08
add a comment |Â
up vote
0
down vote
I don't know about yum, but you can ask whether a package is installed using rpm -q my_package ...
. It will exit with failure status if any of the packages are missing.
$ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
package abasdfasfeafseasfeasef is not installed
bash-4.1.2-9.el6_2.x86_64
coreutils-8.4-19.el6.x86_64
package utils-linux is not installed
$ echo $?
1
$ rpm -q bash
bash-4.1.2-9.el6_2.x86_64
$ echo $?
0
In my situation, I know that the package is not installed because I am installing into a local directory (--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
â Randy
Oct 31 '14 at 21:43
How aboutrpm --root=/var/some/place/test -q ...
?
â Jander
Oct 31 '14 at 22:06
add a comment |Â
up vote
0
down vote
I don't know about yum, but you can ask whether a package is installed using rpm -q my_package ...
. It will exit with failure status if any of the packages are missing.
$ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
package abasdfasfeafseasfeasef is not installed
bash-4.1.2-9.el6_2.x86_64
coreutils-8.4-19.el6.x86_64
package utils-linux is not installed
$ echo $?
1
$ rpm -q bash
bash-4.1.2-9.el6_2.x86_64
$ echo $?
0
In my situation, I know that the package is not installed because I am installing into a local directory (--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
â Randy
Oct 31 '14 at 21:43
How aboutrpm --root=/var/some/place/test -q ...
?
â Jander
Oct 31 '14 at 22:06
add a comment |Â
up vote
0
down vote
up vote
0
down vote
I don't know about yum, but you can ask whether a package is installed using rpm -q my_package ...
. It will exit with failure status if any of the packages are missing.
$ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
package abasdfasfeafseasfeasef is not installed
bash-4.1.2-9.el6_2.x86_64
coreutils-8.4-19.el6.x86_64
package utils-linux is not installed
$ echo $?
1
$ rpm -q bash
bash-4.1.2-9.el6_2.x86_64
$ echo $?
0
I don't know about yum, but you can ask whether a package is installed using rpm -q my_package ...
. It will exit with failure status if any of the packages are missing.
$ rpm -q abasdfasfeafseasfeasef bash coreutils utils-linux
package abasdfasfeafseasfeasef is not installed
bash-4.1.2-9.el6_2.x86_64
coreutils-8.4-19.el6.x86_64
package utils-linux is not installed
$ echo $?
1
$ rpm -q bash
bash-4.1.2-9.el6_2.x86_64
$ echo $?
0
answered Oct 31 '14 at 21:39
Jander
11.3k43256
11.3k43256
In my situation, I know that the package is not installed because I am installing into a local directory (--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
â Randy
Oct 31 '14 at 21:43
How aboutrpm --root=/var/some/place/test -q ...
?
â Jander
Oct 31 '14 at 22:06
add a comment |Â
In my situation, I know that the package is not installed because I am installing into a local directory (--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(
â Randy
Oct 31 '14 at 21:43
How aboutrpm --root=/var/some/place/test -q ...
?
â Jander
Oct 31 '14 at 22:06
In my situation, I know that the package is not installed because I am installing into a local directory (
--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(â Randy
Oct 31 '14 at 21:43
In my situation, I know that the package is not installed because I am installing into a local directory (
--installroot
option). The problem is that the package doesn't exist in the repository and yum doesn't care :(â Randy
Oct 31 '14 at 21:43
How about
rpm --root=/var/some/place/test -q ...
?â Jander
Oct 31 '14 at 22:06
How about
rpm --root=/var/some/place/test -q ...
?â Jander
Oct 31 '14 at 22:06
add a comment |Â
up vote
0
down vote
yum --setopt=skip_missing_names_on_install=False <commands-here>
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
yum --setopt=skip_missing_names_on_install=False <commands-here>
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
up vote
0
down vote
up vote
0
down vote
yum --setopt=skip_missing_names_on_install=False <commands-here>
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
yum --setopt=skip_missing_names_on_install=False <commands-here>
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered 13 mins ago
NoUserException
101
101
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
NoUserException is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |Â
add a comment |Â
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
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f165326%2fis-there-a-yum-option-that-creates-an-error-if-a-package-is-missing%23new-answer', 'question_page');
);
Post as a guest
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
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
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