{"id":161,"date":"2010-08-03T20:49:42","date_gmt":"2010-08-04T00:49:42","guid":{"rendered":"http:\/\/www.eg.bucknell.edu\/~perrone\/?p=161"},"modified":"2010-08-27T21:17:59","modified_gmt":"2010-08-28T01:17:59","slug":"fear-of-the-big-hammer","status":"publish","type":"post","link":"https:\/\/www.eg.bucknell.edu\/~perrone\/2010\/08\/03\/fear-of-the-big-hammer\/","title":{"rendered":"Fear of the big hammer"},"content":{"rendered":"<p>Power tools are dangerous. Be afraid of power tools. For instance &#8220;rm&#8221;, in a MacPorts installation is a power tool that can easily mutilate your set up. <\/p>\n<p>I was annoyed at the amount of junk that got thrown into my system by a MacPorts install poorly done two years ago. So, I started removing packages (ports) here and there. At one point, Zeus knows why, I ended up at <code>\/opt\/local\/lib<\/code> and noticed that I had a few &#8220;flavors&#8221; of <code>libiconv<\/code>. Like a <code>n00b<\/code>, I thought that the one with a number &#8220;2&#8221; in the file name was a file too many; maybe it had been left behind from the installation of a previous version. So, I did the unthinkable and &#8220;rm&#8221;-ed it. <\/p>\n<p>It just so happened that that file was the newer version of the library, which was required by ns-3. What followed were almost two hours of irritation, as I tried to reinstall the <code>libiconv<\/code> port. It couldn&#8217;t be removed because of a large number of dependencies, so I tried &#8220;upgrade&#8221; and &#8220;build&#8221; and a few other port commands, but no luck: <code>libiconv.2.dylib<\/code> wasn&#8217;t being rebuilt. The next great idea I had was to try to remove <strong>all<\/strong> the dependents on <code>libiconv<\/code>, so that I could remove the library package and succeed at rebuilding from a fresh install. Considering that many of these dependents were involved in other long dependency chains, it turned out to be a bad proposition. <\/p>\n<p>There was only one option left: the <strong>BIG<\/strong> hammer, the power-power-tool: do a <code>port -f uninstall<\/code> and assume that I could reinstall <code>libiconv<\/code> before any of its dependents would notice. The <code>-f<\/code> should scare any one once bitten. If I had been foolish enough to remove the <code>libiconv.2.dylib<\/code> in the broader of my Mac OS X installation, I&#8217;d gave gone up the proverbial creek. This was only MacPorts, though, so I thought it would be worth the risk. It was. I followed the uninstall with <code>port clean libiconv<\/code>, then with <code>port install libiconv<\/code> and <em>voil\u00e0<\/em>, I was back in business. ns-3 running happily again. <\/p>\n<p>A post that was helpful in this venture can be found <a href=\"https:\/\/trac.macports.org\/ticket\/21488\">here<\/a> &#8211; it taught me about <code>otool(1)<\/code> and reminded me of <code>file(1)<\/code>, two commands that self-respecting hackers should keep in mind for the future. I have so much faith that this is good knowledge that I wrote this post out of selfishness first and foremost. Wanting to share it with you was only a side effect; sorry!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Power tools are dangerous. Be afraid of power tools. For instance &#8220;rm&#8221;, in a MacPorts installation is a power tool that can easily mutilate your set up. I was annoyed at the amount of junk that got thrown into my system by a MacPorts install poorly done two years ago. So, I started removing packages&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[5,15],"class_list":["post-161","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-macosx","tag-ns-3"],"_links":{"self":[{"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/posts\/161"}],"collection":[{"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/comments?post=161"}],"version-history":[{"count":8,"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/posts\/161\/revisions"}],"predecessor-version":[{"id":347,"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/posts\/161\/revisions\/347"}],"wp:attachment":[{"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/media?parent=161"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/categories?post=161"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.eg.bucknell.edu\/~perrone\/wp-json\/wp\/v2\/tags?post=161"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}