Skip to Content
Egirna Technologies
    Contact Us
  • Home
  • About Us
  • Services
  • Blog
  • Events
  • Jobs
Egirna Technologies
      • Home
      • About Us
      • Services
      • Blog
      • Events
      • Jobs
      Contact Us
  • All Blogs
  • News
  • How To Install Golang on FreeBSD
  • How To Install Golang on FreeBSD

    October 16, 2022 by
    How To Install Golang on FreeBSD
    Amany Mahmoud
    | No comments yet


    In this article, we will install go on FreeBSD OS:

    We'll use the OPNsense firewall as an example of FreeBSD OS. 

    OPNsense is an open-source, easy-to-use, and easy-to-build FreeBSD-based firewall and routing platform.

     For downloading Golang on FreeBSD OS follow these steps: 

    1. Install Git 

    •  $ sudo pkg update -f
    • $​ sudo pkg install git

    2. Install  Go 

    We'll install  Go version "1.19.2" in this article. 

    Now we want to make a source directory. This can be any directory you want.

    • $ mkdir ~/src
    • $ cd ~/src

    We are going to use "wget" to download Go

    •  $ wgethttps://go.dev/dl/go1.19.2.src.tar.gz

    This downloads the archive to our system. Let’s unzip it.

    • $ tar  xvfgo1.19.2.src.tar.gz 

    Now that it’s unzipped, we can verify the files extracted.


     

    Move it to our local folder.

    • $ sudo mv go /usr/local 

    Now  open up our profile with text editor. Install any text editor (ex: vim)

    • $ pkg install vim
    • $ sudo vim ~/.profile

    In that file, we want to add the following:

         1. we’re doing here is setting our go root to /usr/local/go:

    • export GOROOT=/usr/loc​al/go​

         2.  Then we’re putting the gopath and go root into our main path.

    • export PATH=$GOPATH/bin:$GOROOT/bin:$PATH
    • export PATH=$PATH:/usr/local/go/bin
    • set path = ($path /usr/local/go/bin /root/.gopkg/bin)

    Then we’ll save that file.

    3. Now  verify our installation.

    • $ go version



    in News
    Sign in to leave a comment

    Read Next
    Monitoring Squid Proxy traffic using ELK Stack (Elasticsearch/Logstash/Kibana)

    Explore  

    Privacy Policy

    Terms & Conditions

    Our Locations

    An address must be specified for a map to be embedded
    Free Zone Services Complex , Ismailia Free Zone ,Ismailia 41511, Egypt


    Get in Touch

    • sales@egirna.com
    • +201150995051

        Follow Us

    Social Media