centos7安裝pcstat教程

2021-10-20 18:45:06 字數 1325 閱讀 8662

首先安裝golang

root@ububtu:~# cd /usr/local/

root@ububtu:/usr/local#

root@ububtu:/usr/local# wget

2.使用tar名號令解壓安裝包

root@ububtu:/usr/local# tar -c /usr/local -xzf go1.13.4.linux-amd64.tar.gz 

cd進入解壓後產生的go目錄:執行go version

root@ububtu:/usr/local/go# bin/go version

顯示:go version go1.13.4 linux/amd64

3.配置環境

我們需要配置 2 個環境變數分別是 goroot 和 path。

為了方便以後的使用,需要把這幾個環境變數新增 profile 檔案中(~/.bash_profile 或 /etc/profile)。如果是單使用者使用,可以將環境變數新增在 home 目錄下的 bash_profile 檔案中,如果是多使用者使用,需要新增在 /etc/profile 檔案。(推薦大家在 /etc/profile 檔案中設定環境變數)

使用vi /etc/profile 命令開啟 profile 檔案,並將環境變數新增到檔案末尾。

:wq 儲存退出

4.使用 source /etc/profile 命令使配置檔案生效,現在就可以在任意目錄使用go語言命令了

5.一次執行下列命令安裝pcstat

如果中間報錯

unrecognized import path "[golang.org/x/sys/unix](" (https fetch: get [ dial tcp 216.239.37.1:443: i/o timeout)
解決辦法:

這裡需要golang.org/x/sys/unix

mkdir -p $gopath/src/golang.org/x

cd $gopath/src/golang.org/x

git clone

然後繼續執行上面5中未執行完的步驟!

終於成了!

centos7 安裝centos桌面

一 輸入命令 yum groupinstall gnome desktop graphical administration tools 二 設定系統啟動等級。systemctl get default 獲取當前系統執行形式,會顯示multi user.target 命令列終端 或者 graphic...

centos7安裝nginx(yum安裝)

感興趣的可以檢視用壓縮包安裝的過程 1 通過檢視當前linux核心以及版本號進行獲取nginx的rpm安裝源適配。uname a2 獲取nginx相關的rpm源 防止版本號不對應產生的各種問題 rpm uvh3 yum安裝nginx yum install nginx等待安裝完成。1 安裝完成後,n...

CentOS7安裝docker(yum安裝)

1.中文文件 2.檢視linux版本 cat etc redhat release3.是否聯網 這裡yun安裝,不聯網gg 4.解除安裝舊版本 sudo yum remove docker docker client docker client latest docker common docker...