<ruby id="27277"></ruby>

<meter id="27277"></meter>
      <menuitem id="27277"></menuitem>

      1. 葵花寶典教程,一個自學編程平臺

        葵花寶典教程,一個自學編程平臺

        sudo go 提示找不到命令:sudo: go: command not found

        環境變量配置:

        # ~/.bash_profile

        export GOROOT=/usr/local/go

        export GOPATH=/usr/local/GO

        export PATH=$PATH:$GOROOT/bin:$GOPATH/bin

        錯誤描述:

        使用非root用戶,執行 go version 獲得正確輸出。

        使用root用戶,執行 go verison 獲得正確輸出。

        使用非root用戶,執行 sudo go version 獲得輸出 sudo: go: command not found。

        解決辦法:

        根據 Some programs not found when used with sudo 中的回答。


        我們使用 sudo 時,使用的配置文件是 /etc/sudoers。


        配置 /etc/sudoers 文件中的 Defaults secure_path 這一項。將 $GOROOT/bin 目錄加入進去。(請使用絕對目錄,如:/usr/local/go/bin/)


        Defaults secure_path 這一行:

        Defaults    secure_path = /usr/local/go/bin/:/sbin:/bin:/usr/sbin:/usr/bin

        第2條葵花寶典
        == ==

        Copyright www.chinohillsfirstimehomebuyer.com Rights Reserved葵花寶典教程.鄂icp2022001145號-1

        分享:

        支付寶

        微信

        97色伦午夜国产亚洲精品

        <ruby id="27277"></ruby>

        <meter id="27277"></meter>
          <menuitem id="27277"></menuitem>