简体   繁体   中英

How to call yum install as a Makefile's target

How to create a Makefile's target that calls a specific yum install :

yum install libarchive-devel.x86_64

but only if the desired package isn't yet installed. Maybe a yum list installed | grep libarchive yum list installed | grep libarchive to check...

My goal is to call: sudo yum install libarchive-devel.x86_64 but only if the package isn't installed yet. A kind of Maven like in an abstract way.

Don't need any specific version of it. Only it to be x86_64.

Solution:

»»» below means a tab char

installLib:
»»»rpm -qa | egrep -q libarchive-devel.*64 || sudo yum install --assumeyes libarchive-devel.x86_64

This way won't try to install libarchive at each make

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM