Thursday, April 28, 2022

[SOLVED] plutil: command not found

Issue

Ultimate Goal: I'm trying to convert a binary plist file to an xml format so that I can put it in an array and grab values from it. What I'm finding via web search on this is that the command for Linux comes from libplist.

Problem: I ran "yum install libplist" and it told me libplist is already installed and latest version. I've read that if I enter the following command:

plutil -i /mypath/file.plist > /mypath/file.xml.plist

That this will help accomplish my ultimate goal. However, when I do this only a blank file called file.xml.plist is created. Further, with this command and any other command involving plutil, I get a "bash: plutil: command not found. . ." error. Is libplist seemingly not installed (even though it says it is) or why would I repeatedly get this error? Thanks for your help.


Solution

You can use yum to look for a package knowing the binary you want. For instance, if I want to install the package that provides plutil, I simply run this command:

$> yum provides plutil

Unfortunately, the result is No matches found... But you say you read that the libplist package provides this tool. Maybe it was renamed ? Let's use repoquery for this (if you don't have it, yum provides repoquery tells you that you need to install yum-utils).

$> repoquery --list libplist
/usr/bin/plistutil
/usr/lib/libplist++.so.3
/usr/lib/libplist++.so.3.0.0
/usr/lib/libplist.so.3
/usr/lib/libplist.so.3.0.0
/usr/share/doc/libplist
/usr/share/doc/libplist/AUTHORS
/usr/share/doc/libplist/COPYING.LESSER
/usr/share/doc/libplist/README

And what I see is that a program called plistutil was installed with this package !

I've never used plutil, so I can't tell you for sure plistutil is the program you want (but it probably is). What I wanted to do instead with this post is to show how you can use yum to install the packages you need !



Answered By - julienc
Answer Checked By - Marie Seifert (WPSolving Admin)