Day-00010

原文

Linux

  1. Remove any previous Go installation by deleting the /usr/local/go folder (if it exists), then extract the archive you just downloaded into /usr/local, creating a fresh Go tree in /usr/local/go:

    $ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.25.5.linux-amd64.tar.gz
    

    (You may need to run each command separately with the necessary permissions, as root or through sudo.)

    Do not untar the archive into an existing /usr/local/go tree. This is known to produce broken Go installations.

  2. Add /usr/local/go/bin to the PATH environment variable.

    You can do this by adding the following line to your $HOME/.profile or /etc/profile (for a system-wide installation):

    export PATH=$PATH:/usr/local/go/bin
    

    Note: Changes made to a profile file may not apply until the next time you log into your computer. To apply the changes immediately, just run the shell commands directly or execute them from the profile using a command such as source $HOME/.profile.

  3. Verify that you've installed Go by opening a command prompt and typing the following command:

    $ go version
    
  4. Confirm that the command prints the installed version of Go.

MAC

  1. Open the package file you downloaded and follow the prompts to install Go.

    The package installs the Go distribution to /usr/local/go. The package should put the /usr/local/go/bin directory in your PATH environment variable. You may need to restart any open Terminal sessions for the change to take effect.

  2. Verify that you've installed Go by opening a command prompt and typing the following command:

    $ go version
    
  3. Confirm that the command prints the installed version of Go.

1. 全文专业翻译(英译汉)

Linux

请先删除任何先前的 Go 安装:若存在 /usr/local/go 目录,请将其移除。随后,将您刚刚下载的压缩包解压至 /usr/local 目录,从而在 /usr/local/go 下创建一个全新的 Go 目录树:

$ rm -rf /usr/local/go && tar -C /usr/local -xzf go1.25.5.linux-amd64.tar.gz

(您可能需要以 root 权限或通过 sudo 分别执行上述命令。)

切勿将压缩包解压到已存在的 /usr/local/go 目录树中。这种做法已被证实会导致 Go 安装损坏。

/usr/local/go/bin 添加到 PATH 环境变量中。
您可通过在 $HOME/.profile 文件(针对当前用户)或 /etc/profile 文件(针对系统全局安装)末尾添加以下行来实现:

export PATH=$PATH:/usr/local/go/bin

注意:对 profile 配置文件所做的修改,通常需在下次登录系统后才会生效。若要立即应用更改,可直接在终端中运行上述 shell 命令,或使用如下命令重新加载配置文件:

source $HOME/.profile

通过打开命令行终端并输入以下命令,验证 Go 是否已成功安装:

$ go version

确认该命令输出了已安装的 Go 版本信息。


macOS

双击您下载的 .pkg 安装包文件,并按照安装向导提示完成 Go 的安装。
该安装包会将 Go 发行版部署至 /usr/local/go 目录,并自动将 /usr/local/go/bin 目录加入您的 PATH 环境变量。
您可能需要重启所有已打开的 Terminal 会话,以使环境变量变更生效。

通过打开命令行终端并输入以下命令,验证 Go 是否已成功安装:

$ go version

确认该命令输出了已安装的 Go 版本信息。


2. 词汇表梳理(共收获 24 个单词)

  1. Remove
    词性:动词
    音标:/rɪˈmuːv/(“瑞-穆-夫”)
    音节划分:Re·move
    释义:移除。指从系统中彻底删除文件、目录或软件组件。
    扩展信息:过去式 removed;名词 removal;形容词 removable。词根 re-(回)+ move(移动)。近义词:delete, uninstall。
    注意事项:在 Linux 中常与 rm 命令对应;强调物理删除而非逻辑隐藏。
    例句:Remove the old configuration files before reinstalling.
    中文翻译:重新安装前请移除旧的配置文件。
  2. Previous
    词性:形容词
    音标:/ˈpriːviəs/(“普-瑞-维-欧-斯”)
    音节划分:Pre·vi·ous
    释义:先前的。指在时间或顺序上早于当前状态的版本或实例。
    扩展信息:副词 previously;名词 precedence。近义词:prior, earlier。
    注意事项:常用于描述旧版本、历史安装等场景。
    例句:The previous installation may conflict with the new one.
    中文翻译:先前的安装可能与新版本冲突。
  3. Folder
    词性:名词
    音标:/ˈfoʊldər/(“佛-尔-德-欧”)
    音节划分:Fold·er
    释义:文件夹。指文件系统中用于组织和存储文件的目录结构。
    扩展信息:动词 fold;名词 folding。近义词:directory(技术语境更常用)。
    注意事项:在 Unix/Linux 系统中通常称 “directory”,但文档为通用性使用 “folder”。
    例句:The Go binaries are stored in the /usr/local/go folder.
    中文翻译:Go 可执行文件存储在 /usr/local/go 文件夹中。
  4. Extract
    词性:动词
    音标:/ɪkˈstrækt/(“伊-克-斯特-拉-克-特”)
    音节划分:Ex·tract
    释义:解压。指从压缩归档文件(如 .tar.gz)中还原原始文件和目录结构。
    扩展信息:名词 extraction;形容词 extractive。词根 ex-(出)+ tract(拉)。近义词:unzip, decompress。
    注意事项:IT 领域特指从归档中恢复数据,非“提取信息”之义。
    例句:Extract the archive to the target directory using tar.
    中文翻译:使用 tar 将归档解压到目标目录。
  5. Archive
    词性:名词
    音标:/ˈɑːrkaɪv/(“阿-尔-凯-夫”)
    音节划分:Ar·chive
    释义:归档文件。指将多个文件和目录打包并压缩后的单一文件,如 .tar.gz、.zip。
    扩展信息:动词 archive;形容词 archived。近义词:compressed file, package。
    注意事项:此处指下载的 Go 安装包(go1.25.5.linux-amd64.tar.gz)。
    例句:Download the official Go archive for your architecture.
    中文翻译:为您的架构下载官方 Go 归档文件。
  6. Fresh
    词性:形容词
    音标:/freʃ/(“弗-雷-什”)
    音节划分:Fresh
    释义:全新的。指未被修改、污染或残留旧数据的干净状态。
    扩展信息:副词 freshly;名词 freshness。近义词:clean, new。
    注意事项:强调安装环境的纯净性,避免旧文件干扰。
    例句:A fresh Go tree ensures no conflicts from prior builds.
    中文翻译:全新的 Go 目录树可确保不会受先前构建的干扰。
  7. Tree
    词性:名词
    音标:/triː/(“特-瑞”)
    音节划分:Tree
    释义:目录树。指具有层级结构的文件和子目录集合。
    扩展信息:形容词 treelike;复数 trees。近义词:hierarchy, structure。
    注意事项:在 IT 中常指 “directory tree” 或 “source tree”。
    例句:The Go installation creates a standard directory tree under /usr/local/go.
    中文翻译:Go 安装会在 /usr/local/go 下创建标准的目录树。
  8. Permissions
    词性:名词(复数)
    音标:/pərˈmɪʃənz/(“珀-米-申-兹”)
    音节划分:Per·mis·sions
    释义:权限。指操作系统授予用户或进程对文件、目录或资源的访问控制级别。
    扩展信息:单数 permission;动词 permit。近义词:access rights, privileges。
    注意事项:Linux/macOS 中常见 root 或 sudo 权限需求。
    例句:You need write permissions to modify system directories.
    中文翻译:您需要写权限才能修改系统目录。
  9. Root
    词性:名词
    音标:/ruːt/(“鲁-特”)
    音节划分:Root
    释义:根用户。Unix/Linux 系统中的超级管理员账户,拥有最高权限。
    扩展信息:形容词 rooted;动词 root(植根)。近义词:superuser, admin。
    注意事项:执行高危操作时需谨慎使用 root 权限。
    例句:Only the root user can write to /usr/local without sudo.
    中文翻译:只有 root 用户无需 sudo 即可写入 /usr/local。
  10. Sudo
    词性:名词 / 动词
    音标:/ˈsuːdoʊ/(“苏-兜”)
    音节划分:Su·do
    释义:以超级用户权限执行命令。Linux/macOS 中的特权提升工具(substitute user do)。
    扩展信息:全称 substitute user do;无派生词。近义词:run as admin。
    注意事项:安全机制,避免直接使用 root 账户。
    例句:Use sudo to install packages that require elevated privileges.
    中文翻译:使用 sudo 安装需要提升权限的软件包。
  11. Untar
    词性:动词
    音标:/ʌnˈtɑːr/(“安-塔-尔”)
    音节划分:Un·tar
    释义:解压 tar 归档。特指使用 tar 工具解包 .tar、.tar.gz 等格式文件。
    扩展信息:由 un- + tar 构成;非正式但广泛使用的技术动词。近义词:extract, decompress.
    注意事项:仅用于 tar 格式,不适用于 zip 等其他压缩格式。
    例句:Do not untar the archive into an existing Go directory.
    中文翻译:切勿将归档解压到已存在的 Go 目录中。
  12. Existing
    词性:形容词
    音标:/ɪɡˈzɪstɪŋ/(“伊-格-西-斯-廷”)
    音节划分:Ex·ist·ing
    释义:已存在的。指当前系统中已经建立的文件、目录或配置。
    扩展信息:动词 exist;名词 existence。近义词:current, present.
    注意事项:常用于警告避免覆盖或混合新旧内容。
    例句:Overwriting an existing installation may cause instability.
    中文翻译:覆盖已存在的安装可能导致系统不稳定。
  13. Broken
    词性:形容词
    音标:/ˈbroʊkən/(“布-柔-肯”)
    音节划分:Bro·ken
    释义:损坏的。指因错误操作或配置导致无法正常工作的软件状态。
    扩展信息:动词 break;过去分词 broken。近义词:corrupted, malfunctioning.
    注意事项:技术文档中表示“功能异常”而非物理破损。
    例句:Mixing old and new files often results in a broken Go toolchain.
    中文翻译:混合新旧文件通常会导致 Go 工具链损坏。
  14. Add
    词性:动词
    音标:/æd/(“艾-德”)
    音节划分:Add
    释义:添加。指将新元素插入到现有集合、列表或配置中。
    扩展信息:过去式 added;名词 addition;形容词 additional.
    注意事项:常用于环境变量、路径、依赖项等上下文。
    例句:Add the Go binary path to your PATH variable.
    中文翻译:将 Go 二进制路径添加到您的 PATH 变量中。
  15. Profile
    词性:名词
    音标:/ˈproʊfaɪl/(“普-柔-法-伊-欧”)
    音节划分:Pro·file
    释义:配置文件。指包含用户或系统启动时加载的环境设置的脚本文件,如 .profile。
    扩展信息:动词 profile(分析性能);形容词 profiled.
    注意事项:此处指 shell 初始化脚本,非“用户资料”。
    例句:Edit your ~/.profile to persist environment changes.
    中文翻译:编辑您的 ~/.profile 以持久化环境变量更改。
  16. System-wide
    词性:形容词
    音标:/ˈsɪstəm waɪd/(“西-斯-特-姆 怀-德”)
    音节划分:Sys·tem-wide
    释义:系统级的。指影响整个操作系统所有用户的配置或安装。
    扩展信息:由 system + wide 构成;无独立派生词。近义词:global, universal.
    注意事项:与 per-user(每用户)安装相对。
    例句:A system-wide installation places files in /etc or /usr.
    中文翻译:系统级安装会将文件置于 /etc 或 /usr 目录。
  17. Log
    词性:动词
    音标:/lɔːɡ/(“洛-格”)
    音节划分:Log
    释义:登录。指用户通过身份验证进入操作系统会话的过程。
    扩展信息:名词 login/logout;过去式 logged。近义词:sign in.
    注意事项:此处指系统登录,非“日志记录”。
    例句:Environment changes take effect after you log in again.
    中文翻译:环境变量更改在您再次登录后生效。
  18. Immediately
    词性:副词
    音标:/ɪˈmiːdiətli/(“伊-米-迪-欧-特-里”)
    音节划分:Im·me·di·ate·ly
    释义:立即。指无需等待延迟或重启即可执行的操作。
    扩展信息:形容词 immediate;名词 immediacy. 近义词:right away, instantly.
    注意事项:常用于强调即时生效的替代方案。
    例句:Run source to apply changes immediately.
    中文翻译:运行 source 命令以立即应用更改。
  19. Execute
    词性:动词
    音标:/ˈɛksɪkjuːt/(“艾-克-西-丘-特”)
    音节划分:Ex·e·cute
    释义:执行。指运行命令、脚本或程序使其产生效果。
    扩展信息:名词 execution;形容词 executable. 近义词:run, launch.
    注意事项:技术文档中比 run 更正式。
    例句:Execute the script from the profile using source.
    中文翻译:使用 source 从配置文件中执行该脚本。
  20. Sessions
    词性:名词(复数)
    音标:/ˈseʃənz/(“塞-申-兹”)
    音节划分:Ses·sions
    释义:会话。指用户与终端或系统之间的一次交互过程。
    扩展信息:单数 session;动词 session(罕见)。近义词:terminals, shells.
    注意事项:关闭终端即结束会话,新会话需重新加载环境。
    例句:Restart your Terminal sessions to apply PATH changes.
    中文翻译:重启您的 Terminal 会话以应用 PATH 更改。
  21. Distribution
    词性:名词
    音标:/ˌdɪstrɪˈbjuːʃən/(“迪-斯-特-瑞-比-优-申”)
    音节划分:Dis·tri·bu·tion
    释义:发行版。指软件的完整可安装版本,包含编译后的二进制文件、文档和库。
    扩展信息:动词 distribute;形容词 distributable. 近义词:release, build.
    注意事项:Go distribution 指官方发布的完整 Go 工具链。
    例句:The Go distribution includes the compiler, linker, and standard library.
    中文翻译:Go 发行版包含编译器、链接器和标准库。
  22. Deploy
    词性:动词
    音标:/dɪˈplɔɪ/(“迪-普-洛-伊”)
    音标模拟:迪-普-洛-伊
    音节划分:De·ploy
    释义:部署。指将软件安装并配置到目标运行环境中。
    扩展信息:名词 deployment;形容词 deployable. 近义词:install, roll out.
    注意事项:比 install 更强调“投入生产使用”。
    例句:The installer deploys Go to /usr/local/go on macOS.
    中文翻译:安装程序将 Go 部署到 macOS 的 /usr/local/go 目录。
  23. Automatically
    词性:副词
    音标:/ˌɔːtəˈmætɪkli/(“奥-特-欧-曼-提-克-里”)
    音节划分:Au·to·mat·ic·al·ly
    释义:自动地。指无需人工干预即可完成的操作。
    扩展信息:形容词 automatic;名词 automation. 近义词:implicitly, by default.
    注意事项:强调安装包的智能配置能力。
    例句:The package automatically updates your PATH variable.
    中文翻译:该安装包会自动更新您的 PATH 变量。
  24. Terminal
    词性:名词
    音标:/ˈtɜːrmɪnl/(“特-尔-米-诺”)
    音节划分:Ter·mi·nal
    释义:终端。指用于与操作系统进行文本交互的命令行界面程序,在 macOS 和 Linux 中通常称为 Terminal,Windows 中对应 Command Prompt 或 PowerShell。
    扩展信息:形容词 terminal(末期的、终点的);动词 terminate(终止)。词根 termin- 表示“边界、终点”。在 IT 领域中,“terminal” 特指用户与 shell 交互的窗口或设备。近义词:console, shell window, CLI interface。
    注意事项:首字母常大写(如 macOS 的 “Terminal.app”),但在泛指时小写;不可与 “command prompt” 完全等同——terminal 是运行 shell 的环境,而 prompt 是 shell 显示的提示符。
    例句:Open a new Terminal window to test the updated PATH variable.
    中文翻译:打开一个新的终端窗口以测试已更新的 PATH 变量。

3. 短语表梳理(共收获 10 个短语)

  1. Remove any previous Go installation
    释义:移除任何先前的 Go 安装。指彻底清除旧版本 Go 以避免冲突。
    注意事项:强调“any”表示全部清理;常作为安装前的标准步骤。
    例句:Always remove any previous Go installation before installing a new version.
    中文翻译:安装新版本前,务必移除任何先前的 Go 安装。
  2. Extract the archive into
    释义:将归档解压到……。指将压缩包内容释放到指定目标目录。
    注意事项:into 强调目标位置;常与 -C 参数配合使用。
    例句:Extract the archive into /usr/local to set up Go correctly.
    中文翻译:将归档解压到 /usr/local 以正确设置 Go。
  3. Do not untar the archive into
    释义:切勿将归档解压到……。用于发出明确禁止性警告。
    注意事项:语气强烈,常见于易错操作提示;untar 为技术社区惯用语。
    例句:Do not untar the archive into an existing Go directory—it breaks the installation.
    中文翻译:切勿将归档解压到已存在的 Go 目录中——这会破坏安装。
  4. Add to the PATH environment variable
    释义:添加到 PATH 环境变量中。指将目录路径加入系统搜索路径,使命令可全局调用。
    注意事项:PATH 是核心环境变量;操作方式因 shell 和 OS 而异。
    例句:You must add /usr/local/go/bin to the PATH environment variable.
    中文翻译:您必须将 /usr/local/go/bin 添加到 PATH 环境变量中。
  5. Changes made to a profile file
    释义:对配置文件所做的更改。指修改 .profile、.bashrc 等 shell 初始化脚本。
    注意事项:此类更改通常需重新登录或 source 才能生效。
    例句:Changes made to a profile file are not active in current sessions.
    中文翻译:对配置文件所做的更改在当前会话中不会生效。
  6. Apply the changes immediately
    释义:立即应用更改。指无需重启或重新登录即可使配置生效。
    注意事项:常通过 source 或直接执行命令实现。
    例句:To apply the changes immediately, run source ~/.profile.
    中文翻译:要立即应用更改,请运行 source ~/.profile。
  7. Execute them from the profile
    释义:从配置文件中执行它们。指通过加载 profile 脚本来运行其中定义的命令。
    注意事项:execute 在此指“运行脚本内容”,非“执行外部程序”。
    例句:You can execute them from the profile using the source command.
    中文翻译:您可以使用 source 命令从配置文件中执行它们。
  8. Take effect
    释义:生效。指配置、更改或设置开始发挥作用。
    注意事项:不及物动词短语;常与 “changes”, “settings” 搭配;需主语为复数或不可数名词。
    例句:The new PATH settings will take effect after you restart the terminal.
    中文翻译:新的 PATH 设置将在您重启终端后生效。
  9. Put ... in your PATH environment variable
    释义:将……加入您的 PATH 环境变量。macOS 安装包的自动化行为描述。
    注意事项:put 为口语化表达,技术文档中也可用 “add”;强调自动配置。
    例句:The installer puts /usr/local/go/bin in your PATH environment variable.
    中文翻译:安装程序会将 /usr/local/go/bin 加入您的 PATH 环境变量。
  10. Restart any open Terminal sessions
    释义:重启所有已打开的 Terminal 会话。指关闭并重新打开终端窗口以加载新环境。
    注意事项:macOS/Linux 通用操作;“sessions” 强调每个终端实例。
    例句:You may need to restart any open Terminal sessions for the PATH update to take effect.
    中文翻译:您可能需要重启所有已打开的 Terminal 会话,以使 PATH 更新生效。
posted @ 2026-01-14 07:31  红尘过客2022  阅读(0)  评论(0)    收藏  举报