{"id":56,"date":"2019-01-26T06:00:06","date_gmt":"2019-01-26T06:00:06","guid":{"rendered":"https:\/\/www.alansiu.net\/munkiguide\/?p=56"},"modified":"2025-08-07T04:21:34","modified_gmt":"2025-08-07T04:21:34","slug":"munkiimport","status":"publish","type":"post","link":"https:\/\/www.alansiu.net\/munkiguide\/munkiimport\/","title":{"rendered":"Adding an item to your Munki repo"},"content":{"rendered":"<p>Now that you&#8217;ve <a href=\"https:\/\/www.alansiu.net\/munkiguide\/reposetup\">set up your Munki repo and installed Munki tools<\/a>, let&#8217;s get an item into the Munki repo.<\/p>\n<h2>Get an item to import<\/h2>\n<p>In the future, we&#8217;ll look at a way to automate downloading new software into your Munki repo, but for now, let&#8217;s just manually download something. Firefox is as good an item to start with as any. It&#8217;s a simple drag-and-drop .app bundle, and it&#8217;s free to download. So go ahead and <a href=\"https:\/\/www.mozilla.org\/en-US\/firefox\/new\/\" target=\"_blank\" rel=\"noopener noreferrer\">download Firefox<\/a>.<\/p>\n<h2>Import the item<\/h2>\n<p>There are command-line tools to do everything you want to manage your Munki repo. I actually prefer to use a point-and-click program (which we&#8217;ll install later) to manage my Munki repo, but even with that, I still use the command-line for importing items into Munki, because it asks a lot of questions, and because it can create a .dmg on the fly for an .app bundle that doesn&#8217;t already come in a .dmg.<\/p>\n<p>Let&#8217;s go ahead and use <em>munkiimport<\/em> to import Firefox.<\/p>\n<p>\n<code>munkiimport Downloads\/Firefox\\ 141.0.2.dmg<\/code><\/p>\n<p>I&#8217;m using a specific version of Firefox for this example, but obviously use whatever version you downloaded. Tab completion can be helpful here. Once you type <em>Firefox<\/em>, hit Tab, and the rest should fill in, as long as you don&#8217;t have multiple Firefox versions downloaded to the same folder.<\/p>\n<p>\n<code>Item name: Firefox<\/code>\n<\/p>\n<p><em>munkiimport<\/em> may detect the item name. Please pay special attention to what you fill in here. You can go with whatever <em>munkiimport<\/em> suggests or put in your own preferred name, but names are how Munki refers to items. The display name and description below are things your users will see later, but the item name is what will change Munki functionality. If you have an item named <em>Firefox<\/em> that has a display name of <em>Firefox<\/em> and then another item named <em>MozillaFirefox<\/em> that has a display name of <em>Firefox<\/em>, your users may see them as the same, but Munki will see them as different, because they have different item names.<\/p>\n<p><code>Display name: <strong>Mozilla Firefox<\/strong><br \/>\nDescription: <strong>Firefox web browser<\/strong><\/code><\/p>\n<p>For things that <em>munkiimport<\/em> doesn&#8217;t detect, go ahead and just fill in whatever you think is appropriate. You can also leave these blank, but I&#8217;d recommend filling in as much as you can.<\/p>\n<p>\n<code>Version: 141.0.2<\/code>\n<\/p>\n<p>Because this is an .app bundle, the version should be easily detectable (assuming the vendor packaged it properly), so you may find the version fills in automatically.<\/p>\n<p><code>Category: <strong>Browsers<\/strong><br \/>\nDeveloper: <strong>Mozilla<\/strong><\/code><\/p>\n<p>Once again, the more information you can give your users, the better. But you can leave these blank if you really want to.<\/p>\n<p><code>Unattended install: <strong>True<\/strong><br \/>\nUnattended uninstall: <strong>True<\/strong><\/code><\/p>\n<p><em>munkiimport<\/em> will have these default to <em>False<\/em>, but in almost all cases (with some exceptions we&#8217;ll go into later), you&#8217;ll want to change these to <em>True<\/em>. If you even just type <em>t<\/em>, that&#8217;ll work, too. You don&#8217;t have to type out the entire word <em>True<\/em>.<\/p>\n<p><code>Catalogs: testing<\/code><\/p>\n<p>You almost always want to start with adding only to the <em>testing<\/em> catalog. Even if your testing is only to make sure the program installs successfully, launches up, and doesn&#8217;t crash immediately afterwards; that&#8217;s still better than putting it immediately into production.<\/p>\n<p><code>Import this item? [y\/n] <strong>y<\/strong><\/code><\/p>\n<p>Type <em>y<\/em> to confirm you want to import the item.<\/p>\n<p><code>Upload item to subdirectory path []:<\/code><\/p>\n<p>Some Munki admins like to put items into various subfolders for their own organizational purposes. In terms of functionality and performance, your Munki clients won&#8217;t care whether the item is at the top level or in a subfolder. I usually just go with the top-level (so hit Return here), but if you feel strongly about using your own subfolders, go for it, and organize them however you want.<\/p>\n<p><code>No existing product icon found.<br \/>\nAttempt to create a product icon? [y\/n] <strong>y<\/strong><br \/>\nAttempting to extract and upload icon...<br \/>\nImported icons\/Firefox.png.<\/code><\/p>\n<p>It will look prettier and be easier to navigate for your users if you have icons for the items in your Munki repo, so it&#8217;s worth it to see if <em>munkiimport<\/em> can extract a missing icon.<\/p>\n<p>Many times (as with Firefox), <em>munkiimport<\/em> will find an appropriate icon, and then all is good. Sometimes, it may find various icons and not know which one to use, in which case, you&#8217;ll get numbered icons (e.g., NAMEOFITEM_1.png, NAMEOFITEM_2.png, NAMEOFITEM_3.png)\u2014it would then be your job to go into the icons folder and rename one to be <em>NAMEOFITEM.png<\/em> and then delete the extraneous ones.<\/p>\n<p><code>Copying Firefox 141.0.2.dmg to repo...<br \/>\nCopied Firefox 141.0.2.dmg to pkgs\/Firefox 141.0.2.dmg.<br \/>\nEdit pkginfo before upload? [y\/n]: <strong>n<\/strong><\/code><\/p>\n<p>There may be times you want to edit the pkginfo file for the item before you rebuild the catalogs, but in most cases, you&#8217;ll just want to proceed. Provided the vendor has packaged things properly, <em>munkiimport<\/em> is fairly good at detecting the right settings for each item.<\/p>\n<p><code>Saved pkginfo to pkgsinfo\/Firefox-141.0.2.<br \/>\nRebuild catalogs? [y\/n] <strong>y<\/strong><br \/>\nRebuilding catalogs at file:\/\/\/Users\/Shared\/munki_repo...<br \/>\nCreated icons\/_icon_hashes.plist...<\/code><\/p>\n<p>Munki clients cannot see pkginfo files. They see catalogs. So if you change a pkginfo file and want your Munki clients to pick up on those changes, you need to rebuild the catalogs. Since <em>munkiimport<\/em> prompts you, you can just type <em>y<\/em> to confirm you want catalogs rebuilt. If you edit a pkginfo file manually yourself later (apart from <em>munkiimport<\/em>), you&#8217;ll want to run the <code>makecatalogs<\/code> command manually afterwards.<\/p>\n<p>Also, if you&#8217;re importing several items manually with <em>munkiimport<\/em>, you may want to wait until after the last item is done before you decide to rebuild catalogs. You can rebuild after each one, too\u2014it may just take a little longer than doing it only once at the end.<\/p>\n<h2>Taking a look at what happened after an item import<\/h2>\n<p>After you do this import, your Munki repo should look like this:<\/p>\n<p><code>catalogs\/all<br \/>\ncatalogs\/testing<\/code><\/p>\n<p>The <em>all<\/em> catalog has all the catalog info, but since you have only a testing catalog, right now the two are identical. You can take a look at these two files just to see what they look like, but you should never manually edit a catalog file.<\/p>\n<p><code>icons\/_icon_hashes.plist<br \/>\nicons\/Firefox.png<\/code><\/p>\n<p>The icon hashes have hashes for each icon in the directory, and then you have the icons you extracted or manually copied to the icons directory. See? There&#8217;s your Firefox.png that <em>munkiimport<\/em> extracted from the .app in the .dmg.<\/p>\n<p><code>manifests\/<\/code><\/p>\n<p>We don&#8217;t have any manifests yet. We&#8217;ll make one in the next tutorial.<\/p>\n<p><code>pkgs\/Firefox 141.0.2.dmg<\/code><\/p>\n<p>When you import an item, whatever &#8220;installer&#8221; it has <em>munkiimport<\/em> will copy to the pkgs directory. That will most likely be a .pkg or a .dmg.<\/p>\n<p>Remember when you could have created a subdirectory? Well, if you had, your Firefox would be in <em>pkgs\/NAMEOFYOURSUBDIRECTORY\/Firefox VERSIONNUMBER.dmg<\/em> instead of <em>pkgs\/Firefox VERSIONNUMBER.dmg<\/em>.<\/p>\n<p><code>pkgsinfo\/Firefox-141.0.2.pkginfo<\/code><\/p>\n<p><em>munkiimport<\/em> creates a pkginfo file for the Firefox item. This has all the information that will get put into the catalogs file(s) that your Munki clients will use to decide whether Firefox (or whatever item it is) is installed already, how to install it, how to remove it, which is the newest version, etc.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Now that you&#8217;ve set up your Munki repo and installed Munki tools, let&#8217;s get an item into the Munki repo. Get an item to import In the future, we&#8217;ll look at a way to automate downloading new software into your Munki repo, but for now, let&#8217;s just manually download something. Firefox is as good an [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-56","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_shortlink":"https:\/\/wp.me\/paDrAJ-U","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts\/56","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/comments?post=56"}],"version-history":[{"count":32,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts\/56\/revisions"}],"predecessor-version":[{"id":501,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/posts\/56\/revisions\/501"}],"wp:attachment":[{"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/media?parent=56"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/categories?post=56"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.alansiu.net\/munkiguide\/wp-json\/wp\/v2\/tags?post=56"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}