# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, zypper 安装 gopls

查看 gopls 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:gopls
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install gopls
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install gopls
```

  证据: MacPorts ports tree: devel/gopls/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add gopls
```

  证据: Alpine Linux edge package indexes: gopls from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install gopls
```

  证据: Debian stable package indexes: gopls from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install gopls
```

  证据: Fedora Rawhide package metadata: gopls from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#gopls
```

  证据: nixpkgs package indexes: pkgs/by-name/go/gopls/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- pacman (92%):

```sh
sudo pacman -S gopls
```

  证据: Arch Linux sync databases: gopls from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

- zypper (92%):

```sh
sudo zypper install gopls
```

  证据: openSUSE Tumbleweed package metadata: gopls from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst

## 软件包事实

- **软件包键:** brew:gopls
- **软件包管理器:** Homebrew
- **版本:** 0.23.0
- **来源摘要:** Language server for the Go language
- **主页:** <https://github.com/golang/tools/tree/master/gopls>
- **仓库:** <https://github.com/golang/tools>
- **最后更新:** 2026-07-27T14:57:51+02:00
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- gopls (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.23.0
## 项目历史与用法

gopls, pronounced go please, is the official Go language server developed by the Go team. It made Go editor support less dependent on one editor plugin by concentrating language intelligence behind the Language Server Protocol.

### 项目历史

gopls lives in the Go project's x/tools repository, the long-running home for Go analysis and developer tooling outside the main Go distribution. The gopls module appears as `golang.org/x/tools/gopls` and is documented on go.dev as the official language server for Go.

The project emerged during the Go modules era, when editor tooling needed to understand module-aware package loading, workspaces, diagnostics, code actions, and analysis across a changing build environment. Early tagged gopls releases in the tools repository begin with the `gopls/v0.2.x` series.

Over time, gopls moved from editor helper to a central Go development service. Its documentation covers editor-specific setup, LSP features, workspace behavior, analyzers, design notes, troubleshooting, and release notes.

### 采用历史

The Go FAQ describes gopls as the Go team's supported language server for LSP-capable tools. That endorsement turned gopls into the default backend for many editors rather than a niche optional package.

Package-manager adoption is broad for a Go developer tool: the input facts list packages across Homebrew, Debian, Ubuntu, Fedora, Arch, Alpine, MacPorts, Nix, and openSUSE. That spread reflects its role as infrastructure for editors and CI-style tooling rather than a command users run manually every day.

Go telemetry planning has treated LSP-capable editors using gopls as a major part of the Go tool ecosystem, which is another sign that gopls became part of ordinary Go development workflows.

### 使用方式

Most users do not invoke gopls directly. Editors start it automatically to provide completion, hover, go-to-definition, diagnostics, formatting support, semantic tokens, code actions, references, and workspace operations.

Power users and editor maintainers use the documented settings, feature index, workspace documentation, and design notes to tune behavior or integrate gopls with less common LSP clients.

The gopls release documentation also shows it absorbing newer workflow surfaces, including an experimental MCP server mode in the v0.20.0 release line.

### 为什么软件包爱好者会关心

gopls is one of the clearest examples of a package-manager formula that is not an end-user app in the traditional sense but a local editor daemon. Installing it makes other tools work better.

It also matters because it centralizes Go-specific analysis in a versioned Go module. Package maintainers have to care about Go toolchain compatibility, editor compatibility, and x/tools release cadence, not just a single executable.

For Go ecosystem nerds, gopls marks the shift from editor-specific Go integrations such as gocode-era completion toward a shared language-server backend maintained by the Go project.

### 时间线

- 2014: golang/tools repository created as the Go tools mirror.
- 2019: Early gopls tags appear in the x/tools repository.
- 2019: Go 1.13 makes module-aware workflows the default context for many Go developers.
- 2020s: go.dev publishes dedicated gopls documentation, editor guides, feature docs, and design notes.
- 2024: Go telemetry planning explicitly discusses LSP-capable editors that use gopls.
- 2025: gopls v0.20.0 release notes document experimental MCP server support.

### Related projects

- golang.org/x/tools contains gopls and related Go developer tools such as goimports and stringer.
- The Language Server Protocol defines the editor-server boundary that gopls implements.
- The Go module system and proxy infrastructure shape how gopls loads and analyzes workspaces.

### 来源

- <https://github.com/golang/tools/tree/master/gopls>
- <https://go.dev/blog/gotelemetry>
- <https://go.dev/doc/faq>
- <https://go.dev/gopls/>
- <https://go.dev/gopls/release/v0.20.0>
- <https://go.dev/ref/mod>
- <https://pkg.go.dev/golang.org/x/tools/gopls>


## 安全说明

没有找到 gopls 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。


## 其他软件包管理器记录

- Debian apt - gopls - 2:0.16.1+ds-1: normalized package name match | Debian stable package indexes: gopls from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | language server for the Go language | https://golang.org/x/tools
- Nix - gopls: normalized package name match | nixpkgs package indexes: pkgs/by-name/go/gopls/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - gopls - 1:0.18.0+ds-1: normalized package name match | Ubuntu 24.04 LTS package indexes: gopls from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | language server for the Go language | https://golang.org/x/tools
- apk - gopls - 0.21.1-r4: normalized package name match | Alpine Linux edge package indexes: gopls from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Language server for Go programming language | https://github.com/golang/tools/blob/master/gopls
- dnf - gopls - 0.18.1-2.fc43: normalized package name match | Fedora Rawhide package metadata: gopls from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | gopls, the Go language server | https://github.com/golang/tools
- pacman - gopls - 0.23.0-1: normalized package name match | Arch Linux sync databases: gopls from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Language server for Go programming language | https://github.com/golang/tools/tree/master/gopls
- zypper - gopls - 0.23.0-1.2: normalized package name match | openSUSE Tumbleweed package metadata: gopls from https://download.opensuse.org/tumbleweed/repo/oss/repodata/50b07339cb64c8ed4091bdbabddadc1ff5737b090e478818a195b40d8a3292861a879139b4a3987c31109699fde9fbf4a716367ddf4eef77da75f96e3193d6ed-primary.xml.zst | Go LSP protocol language server | https://pkg.go.dev/golang.org/x/tools/gopls
- MacPorts - gopls: normalized package name match | MacPorts ports tree: devel/gopls/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1


## Combined YAML source

View the package source record on GitHub. [combined/gopls.yml](https://github.com/mxcl/pkgdb/blob/main/combined/gopls.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
