Timeline for How can I tell whether a package is installed via yum in a bash script?
Current License: CC BY-SA 3.0
11 events
| when toggle format | what | by | license | comment | |
|---|---|---|---|---|---|
| May 23, 2017 at 12:39 | history | edited | CommunityBot | replaced http://stackoverflow.com/ with https://stackoverflow.com/ | |
| Feb 4, 2016 at 22:44 | comment | added | Sunil D. | OMG it's the 21st century, can't they have a proper option to tell if a package is installed so I don't have write functions or one liners!? | |
| Sep 9, 2015 at 22:33 | comment | added | Doktor J | @FGreg good call... I've replaced the return statements with calls to true and false, so the function is easily readable yet returns the output bash expects. | |
| Sep 9, 2015 at 22:33 | history | edited | Doktor J | CC BY-SA 3.0 | Tweaked the function a little bit to correct an issue in my original post, and make its behavior a bit more intuitive |
| Sep 9, 2015 at 20:37 | comment | added | FGreg | I think your echo statements are reversed, no? isInstalled returns 1 if the package is installed; but 1 is evaluated to false in bash so "not installed" is echoed. | |
| Oct 21, 2014 at 21:20 | vote | accept | Doktor J | ||
| Apr 2, 2014 at 17:10 | history | edited | Doktor J | CC BY-SA 3.0 | Added function to help make sense of the output |
| Apr 2, 2014 at 15:19 | history | edited | Doktor J | CC BY-SA 3.0 | Added function to help make sense of the output |
| Apr 2, 2014 at 4:21 | review | First posts | |||
| Apr 2, 2014 at 5:20 | |||||
| Apr 2, 2014 at 4:05 | comment | added | Chris Down | You don't need to manually check the value of $?, just wrap the command in a conditional: if yum list installed "$package" >/dev/null 2>&1; then [...] | |
| Apr 2, 2014 at 4:02 | history | answered | Doktor J | CC BY-SA 3.0 |