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
标签:ubuntu,export,linux,go,wails,com,搭建 From: https://www.cnblogs.com/lecone/p/18500193