1. Linux

1.1. Installation

wget https://golang.org/dl/go1.18.2.linux-amd64.tar.gz
sudo tar -zxvf go1.18.2.linux-amd64.tar.gz -C /usr/local/
echo "export PATH=/usr/local/go/bin:${PATH}" | sudo tee /etc/profile.d/go.sh
source /etc/profile.d/go.sh


go version
go env

1.2. Usage

env GOOS=windows GOARCH=amd64 go build github.com/lxc/lxd/lxc

2. macOS

3. Windows

3.1. Installation

  • Run the go1.18.2.windows-amd64.msi file with administrative privileges.

  • Click Next.

  • Check I accept the terms in the License Agreement.

  • Click Next.

    C:\Program Files\Go\
  • Click Next.

  • Click Install.

  • Click Finish.

3.2. Usage

  • See https://ubuntu.com/blog/lxd-client-on-windows-and-macos.

  • Install Git.

  • Enter the following commands at a Command Prompt with administrative privileges.

    git config --global http.https://gopkg.in.followRedirects true
    go install -v -x github.com/lxc/lxd/lxc@latest
    Administrator@TBHFWS-IT01 C:\Users\Administrator> go install -v -x github.com/lxc/lxd/lxc@latest
    # get https://proxy.golang.org/github.com/lxc/lxd/@v/list
    # get https://proxy.golang.org/github.com/lxc/@v/list
    # get https://proxy.golang.org/github.com/@v/list
    # get https://proxy.golang.org/github.com/lxc/lxd/lxc/@v/list
    # get https://proxy.golang.org/github.com/@v/list: 410 Gone (0.265s)
    # get https://proxy.golang.org/github.com/lxc/@v/list: 410 Gone (0.534s)
    # get https://proxy.golang.org/github.com/lxc/lxd/@v/list: 200 OK (0.644s)
    # get https://proxy.golang.org/github.com/lxc/lxd/@latest
    # get https://proxy.golang.org/github.com/lxc/lxd/@latest: 200 OK (0.100s)
    # get https://proxy.golang.org/github.com/lxc/lxd/@v/v0.0.0-20220519165253-4de2c3611e54.mod
    # get https://proxy.golang.org/github.com/lxc/lxd/@v/v0.0.0-20220519165253-4de2c3611e54.mod: 200 OK (0.248s)
    # get https://proxy.golang.org/sumdb/sum.golang.org/supported
    # get https://proxy.golang.org/sumdb/sum.golang.org/supported: 410 Gone (0.042s)
    # get https://sum.golang.org/lookup/github.com/lxc/lxd@v0.0.0-20220519165253-4de2c3611e54
    # get https://sum.golang.org/lookup/github.com/lxc/lxd@v0.0.0-20220519165253-4de2c3611e54: 200 OK (0.510s)
    # get https://sum.golang.org/tile/8/0/x041/473
    # get https://sum.golang.org/tile/8/1/162.p/32
    # get https://sum.golang.org/tile/8/2/000.p/162
    # get https://sum.golang.org/tile/8/0/x041/504.p/49
    # get https://sum.golang.org/tile/8/2/000.p/162: 200 OK (0.044s)
    # get https://sum.golang.org/tile/8/1/162.p/32: 200 OK (0.056s)
    # get https://sum.golang.org/tile/8/0/x041/473: 200 OK (0.094s)
    # get https://sum.golang.org/tile/8/0/x041/504.p/49: 200 OK (0.343s)
    go: downloading github.com/lxc/lxd v0.0.0-20220519165253-4de2c3611e54
    # get https://proxy.golang.org/github.com/lxc/lxd/@v/v0.0.0-20220519165253-4de2c3611e54.zip
    # get https://proxy.golang.org/github.com/lxc/lxd/@v/v0.0.0-20220519165253-4de2c3611e54.zip: 200 OK (0.200s)
    # get https://proxy.golang.org/github.com/lxc/lxd/lxc/@v/list: 410 Gone (3.674s)
    go: github.com/lxc/lxd/lxc@latest (in github.com/lxc/lxd@v0.0.0-20220519165253-4de2c3611e54):
            The go.mod file for the module providing named packages contains one or
            more replace directives. It must not contain directives that would cause
            it to be interpreted differently than if it were the main module.