I was using this command in a shell script on my ubuntu server apt-get install -y packagename --no-upgrade
. It will install the package if it is not already present. It will not upgrade the package. Now I want to migrate it to a centos machine. I couldn't find any switch equivalent to --no-upgrade
in yum. Any help?
Asked
Active
Viewed 1,629 times
2

Harikrishnan
- 1,159
- 2
- 14
- 32
1 Answers
3
There is no such option for yum
.
You will have to work around it with something like this:
rpm --quiet -q packagename || yum -y install packagename

faker
- 17,496
- 2
- 60
- 70