{"id":753,"date":"2020-06-04T10:28:55","date_gmt":"2020-06-04T01:28:55","guid":{"rendered":"https:\/\/mitsudo.net\/?p=753"},"modified":"2023-05-10T15:07:08","modified_gmt":"2023-05-10T06:07:08","slug":"mac-homebrew","status":"publish","type":"post","link":"https:\/\/mitsudo.net\/en\/mac-homebrew\/","title":{"rendered":"Mac with Homebrew for Organic Chemists (for Intel Mac)"},"content":{"rendered":"<h2>Homebrew (A Package Manager for Mac)<\/h2>\n<p>For organic chemists, <strong>Homebrew<\/strong> is a very useful software, although it is not as essential as <strong>MS Office<\/strong> or <strong>ChemDraw<\/strong>. <strong>Homebrew<\/strong> is a package management system for Mac. Herein, I would like to explain how to build an environment on a Mac using Homebrew.<\/p>\n<ul>\n<li><strong>Homebrew<br \/>\nHomebrew<\/strong> is a package management system used from a terminal (software to type commands). <span class=\"marker-halfPink\">You can easily install various UNIX-based softwares by <strong>Homebrew<\/strong><\/span>.<br \/>\n<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/1b98339dbb959f57f17ae2092bedbf97-300x197.png\" alt=\"\" width=\"300\" height=\"197\" class=\"alignnone wp-image-591 size-medium\" \/><\/li>\n<li><strong>iTerm2<\/strong><br \/>\n<strong>iTerm2<\/strong> is a widely used terminal for Mac. It is more powerful than the standard terminal. <strong>Homebrew<\/strong> can be used from <strong>iTerm2<\/strong> (also from the standard terminal). It is useful to run Gaussian, python, etc. on a Mac and to connect to remote servers.<br \/>\n<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/ebd8530bc83a4c86731006d86c5c3532-300x106.png\" alt=\"\" width=\"300\" height=\"106\" class=\"alignnone wp-image-592 size-medium\" \/><\/li>\n<\/ul>\n<h2>Building an Environment with Homebrew<\/h2>\n<h3>Installation of Homebrew<\/h3>\n<p><strong>Homebrew<\/strong> is installed from <strong>Terminal<\/strong> with commands. <strong>Terminal<\/strong> can be found in Launchpad.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/Launchpad.png\" alt=\"Launchpad\" width=\"128\" height=\"149\" class=\"alignnone wp-image-595\" \/>\u00a0 \u00a0<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/cfb7f1192a2397f392a90493076962d3-150x150.png\" alt=\"\" width=\"150\" height=\"150\" class=\"alignnone wp-image-596 size-thumbnail\" \/><\/p>\n<p>Below is the <strong>Terminal<\/strong> screen. Type a command here to install <strong>Homebrew<\/strong>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/c881740139e3b76705ec49565e26487d.png\" alt=\"Terminal Screenshot\" width=\"697\" height=\"477\" class=\"alignnone wp-image-598 size-full\" \/><\/p>\n<p>First, <span class=\"marker-halfPink\">before installing <strong>Homebrew<\/strong>, <strong>command line tools<\/strong> should be installed.<\/span> Open <strong>terminal<\/strong> and type the following command ($ is not included). (Added on April 7, 2021)<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ xcode-select --install<\/code><\/pre>\n<\/div>\n<p>The command to install <strong>Homebrew<\/strong> changes occasionally, so check the Homebrew site (<a href=\"https:\/\/brew.sh\/\" target=\"_blank\" rel=\"noopener noreferrer\">https:\/\/brew.sh\/<\/a>) and enter it in the terminal (as of May 24, 2020, the following command is available. $ is not included). Enter your login password if required.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ \/usr\/bin\/ruby -e \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/master\/install)\"<\/code><\/pre>\n<\/div>\n<p>It takes a while to install <strong>Homebrew<\/strong>. After the installation, run the following commands in the <strong>terminal<\/strong>.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ brew doctor<\/code><\/pre>\n<\/div>\n<p>If you run it and there is no error, you have succeeded. It&#8217;s a kind of strict check, so even if an error appears, it often works without a problem.<\/p>\n<h4 class=\"icon-pencil\">How to Use Homebrew<\/h4>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ brew update #update Homebrew\r\n$ brew upgrade #upgrade applications installed by Homebrew\r\n$ brew install hogehoge #command to install hogehoge<\/code><\/pre>\n<\/div>\n<p>It is better to run &#8220;<strong>brew update<\/strong>&#8221; and &#8220;<strong>brew upgrade<\/strong>&#8221; occasionally.<\/p>\n<h3>Installation of iTerm2<\/h3>\n<p>You can easily install <strong>iTerm2<\/strong> by using the <strong>brew cask<\/strong> command.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ brew install --cask iterm2<\/code><\/pre>\n<\/div>\n<p>After the installation, commands are entered from <strong>iTerm2<\/strong>, not from the terminal.<\/p>\n<p>You can change the default color scheme of iTerm2 as you like. Change it from Color Presets in [Preferences]-[Profiles]-[Colors]. My setting is <strong>Pastel<\/strong> as you can see below.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/cf5edece10bd49e88a424b62812628c8.png\" alt=\"\" width=\"857\" height=\"614\" class=\"alignnone wp-image-613 size-full\" \/><\/p>\n<h3>Installation of zsh and etc.<\/h3>\n<p>Enter the following commands into <strong>iTerm2<\/strong> to install the major programs.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Bash\"><code>$ brew install vim zsh coreutils wget gcc openssl<\/code><\/pre>\n<\/div>\n<p>The latest version of vim, zsh, etc. will be installed.<\/p>\n<p>(For Macs before Mojave) Open <strong>iTerm2<\/strong> and select [iTerm2]-[Preferences]-[Profiles]-[General], and choose <strong>Command<\/strong> from the pull-down list, and type zsh to the right of it. For Catalina, zsh is the default shell, so this operation is not necessary.<br \/>\n<img decoding=\"async\" src=\"https:\/\/mitsudo.net\/wp-content\/uploads\/2020\/05\/command-1.png\" alt=\"\" width=\"1030\" height=\"730\" class=\"alignnone wp-image-561 size-full\" \/><\/p>\n<h3>Settings for zsh<\/h3>\n<p>You can configure zsh by creating a <strong>.zshrc<\/strong> file in your home folder (\/Users\/&lt;username&gt;\/). Add the following to your .zshrc<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>#\u3000Aliases\r\nalias vi=vim\r\n\r\n# path\r\nexport PATH=\/usr\/local\/bin:\/usr\/local\/sbin:\/usr\/sbin:\/sbin:$PATH<\/code><\/pre>\n<\/div>\n<h3>Installation of Dropbox, Evernote, Google Chrome, Skitch by brew cask<\/h3>\n<p>With brew cask, you can easily install <strong>Dropbox<\/strong>, <strong>Evernote<\/strong>, <strong>Google Chrome<\/strong>, <strong>Skicth<\/strong>, etc. from the command line. You do not need to download each package at all.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask dropbox evernote google-chrome skitch<\/code><\/pre>\n<\/div>\n<h3>Installation of VSCode by brew cask<\/h3>\n<p>You can also install VSCode, a cool text editor, with brew cask.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask visual-studio-code<\/code><\/pre>\n<\/div>\n<h3>Installation of XQuartz<\/h3>\n<p>If <strong>XQuartz<\/strong> is not installed, some applications such as <strong>Mercury<\/strong> will not start. It is better to be installed in your Mac. You can easily install it with brew cask command.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><code>$ brew install --cask xquartz<\/code><\/pre>\n<\/div>\n<h3>Installation of FileZilla<\/h3>\n<p><del><strong>FileZilla<\/strong>, which is used for FTP connections to remote servers, can also be easily installed with <strong>Homebrew<\/strong>.<\/del><\/p>\n<p>Now, <strong>Filezilla<\/strong> cannot be installed by <strong>Homebrew<\/strong>. <strong>Filezilla<\/strong> should be download from the <a href=\"https:\/\/filezilla-project.org\/\" target=\"_blank\" rel=\"noopener\">download site<\/a>.<\/p>\n<div class=\"hcb_wrap\">\n<pre class=\"prism undefined-numbers lang-bash\" data-lang=\"Zsh\"><del><code>$ brew cask install filezilla<\/code><\/del><\/pre>\n<\/div>\n<h2>Installation of Other Softwares<\/h2>\n<p>The following softwares cannot be installed by <strong>Homebrew<\/strong>, so you need to install them manually.<\/p>\n<ul>\n<li><strong>Microsoft Office<\/strong><\/li>\n<li><strong>ChemDraw<\/strong><\/li>\n<li><strong>Gaussian<\/strong> &amp; <strong>GaussView<\/strong><\/li>\n<li><strong>Mercury<\/strong><br \/>\nFreeware for viewing cif files. You can download it from <a href=\"https:\/\/www.ccdc.cam.ac.uk\/support-and-resources\/downloads\/\" target=\"_blank\" rel=\"noopener noreferrer\">The Cambridge Crystallographic Data Centre (CCDC)<\/a>.<\/li>\n<li><strong>CYLView<\/strong><br \/>\nFreeware for viewing and visualizing calculated chemical structures. You can download if from <a href=\"https:\/\/www.cylview.org\/index.html\" target=\"_blank\" rel=\"noopener noreferrer\">cylview.org<\/a>.<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Homebrew (A Package Manager for Mac) For organic chemists, Homebrew is a very useful software, although it is not as essential as MS Office or ChemDraw. Homebrew is a package management system for Mac [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":643,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/mitsudo.net\/?p=320","footnotes":""},"categories":[26],"tags":[25],"class_list":["post-753","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-chem-with-mac","tag-mac","en-US"],"_links":{"self":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts\/753","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/comments?post=753"}],"version-history":[{"count":13,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts\/753\/revisions"}],"predecessor-version":[{"id":2075,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/posts\/753\/revisions\/2075"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/media\/643"}],"wp:attachment":[{"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/media?parent=753"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/categories?post=753"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mitsudo.net\/wp-json\/wp\/v2\/tags?post=753"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}