1.在https://go.dev/dl/下載相應的golang 的版本。
wget https://dl.google.com/go/go1.21.13.linux-amd64.tar.gz 解壓
tar -xvf go1.21.13.linux-amd64.tar.gz
2.安裝go
開啟配置檔案
vim /etc/profile
export GOPROXY=https://goproxy.cn export GOROOT=/opt/go (自己解壓的目錄) export PATH=$PATH:$GOROOT/bin export GOPATH=/opt/go/pkg(自己解壓的目錄)
export PATH=$PATH:$GOPATH/bin
:wq
儲存退出vim
go version
3.安裝wails
go install github.com/wailsapp/wails/v2/cmd/wails@latest
檢查wails健康
wails doctor
根據需要安裝的包進行安裝。
4.Linux 安裝 libwebkit
Ubuntu24.04已經移除了libwebkit2gtk-4.0的庫
sudo vim /etc/apt/sources.list.d/ubuntu.sources
開啟之後,在裡面新增以下內容
Types: deb URIs: http://br.archive.ubuntu.com/ubuntu/ Suites: jammy noble-updates noble-backports Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg Types: deb URIs: http://security.ubuntu.com/ubuntu/ Suites: jammy-security Components: main restricted universe multiverse Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
更新源
sudo apt update
安裝libwebkit2gtk-4.0
sudo apt install libwebkit2gtk-4.0-dev