{"id":1343,"date":"2025-03-13T10:56:02","date_gmt":"2025-03-13T10:56:02","guid":{"rendered":"https:\/\/haxed.me.uk\/?p=1343"},"modified":"2025-03-13T10:57:40","modified_gmt":"2025-03-13T10:57:40","slug":"installing-brew-on-centos-9","status":"publish","type":"post","link":"https:\/\/haxed.me.uk\/index.php\/2025\/03\/13\/installing-brew-on-centos-9\/","title":{"rendered":"Installing Brew on centos 9"},"content":{"rendered":"\n<p>It&#8217;s a straightforward process to install brew on centos9. Here is how. First you will want to create a user with sudo. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nadduser github\nvisudo\n<\/pre><\/div>\n\n\n<p>Then you will want to add something like;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ngithub  ALL=(ALL)       NOPASSWD: ALL\n\n<\/pre><\/div>\n\n\n<p>If you want to authenticate maunally when running sudo commands, which might be important in stricter security setups remove the NOPASSWD: section.<\/p>\n\n\n\n<p>On the <a href=\"https:\/\/brew.sh\/\" data-type=\"link\" data-id=\"https:\/\/brew.sh\/\">brew official site<\/a> you&#8217;ll usually find the oneliner install for brew;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n\/bin\/bash -c &quot;$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)&quot;\n\n<\/pre><\/div>\n\n\n<p>If you are like me, you will want to inspect something before piping it to bash, or better wget the file yourself to do so;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\ncurl https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh\n<\/pre><\/div>\n\n\n[github@localhost github]# brew<br>bash: brew: command not found\u2026<\/p>\n\n\n\n<p>Simply create an alias for the brew binary or alternatively append the new path for brew to your existing shell $PATH variable like so;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\n    echo &gt;&gt; \/home\/github\/.bashrc\n    echo 'eval &quot;$(\/home\/linuxbrew\/.linuxbrew\/bin\/brew shellenv)&quot;' &gt;&gt; \/home\/github\/.bashrc\n    eval &quot;$(\/home\/linuxbrew\/.linuxbrew\/bin\/brew shellenv)&quot;\n\n<\/pre><\/div>\n\n\n<p>The .bashrc file is used to execute commands on user login, and is triggered by the su switch or sshd\/pamd. you can check your linuxbrew binary path has been added afterwards by typing &#8216;brew&#8217;.  <\/p>\n\n\n\n<p>Of course you can add the PATH the old fashioned way in .bash_profile instead if you don&#8217;t want to use eval to alias the brew binary; remember adding the whole path means any binaries can be executed there so be mindful of whether you need really need a path export.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nexport PATH=&quot;\/home\/linuxbrew\/.linuxbrew\/bin\/:$PATH&quot;&amp;lt;br&gt;\n<\/pre><\/div>\n\n\n<p>It&#8217;s pretty simple, in my case I&#8217;m installing brew so I can access the github api, which allows a lot more flexibility of the commands I can run compared to the traditional github binary most people use.<br><br>Lets install the &#8216;github gh&#8217; tool for github api like so;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nbrew install gh\n<\/pre><\/div>\n\n\n<p>For a successful installation of brew and its toolsets you may also require the development tools group package available on centos9 stream;<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nsudo yum groupinstall 'Development Tools'\n<\/pre><\/div>\n\n\n<p>Pretty simples. But handy if your are using an operating system like centos 9 stream which simply doesn&#8217;t have a safe official repo like redhat or debian operating systems.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>It&#8217;s a straightforward process to install brew on centos9. Here is how. First you will want to create a user with sudo. Then you will want to add something like; If you want to authenticate maunally when running sudo commands, &hellip; <a href=\"https:\/\/haxed.me.uk\/index.php\/2025\/03\/13\/installing-brew-on-centos-9\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1343","post","type-post","status-publish","format-standard","hentry","category-uncategorised"],"_links":{"self":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1343","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/comments?post=1343"}],"version-history":[{"count":3,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1343\/revisions"}],"predecessor-version":[{"id":1348,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/posts\/1343\/revisions\/1348"}],"wp:attachment":[{"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/media?parent=1343"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/categories?post=1343"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/haxed.me.uk\/index.php\/wp-json\/wp\/v2\/tags?post=1343"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}