目录一、为ubuntu20.04更新源二、设置允许以root用户登录三、安装Go四、安装goland工具五、安装ssh并配置允许root登录总结一、为ubuntu20.04更新源 给
sudo passwd root
sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak
sudo apt install vim
sudo vim /etc/apt/sources.list
,将里面的内容全删后,配置为清华源,清华源如下:deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiversedeb-src Https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-updates main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-backports main restricted universe multiversedeb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiversedeb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ focal-security main restricted universe multiverse
sudo apt-get update
sudo apt-get -f install
sudo apt-get upgrade
执行命令:sudo vim /usr/share/lightdm/lightdm.conf.d/50-ubuntu.conf
, 把配置改为如下所示
[Seat:*]
user-session=ubuntu
greeter-show-manual-login= true
all-guest=false #这个可以 不用配置
执行sudo vim /etc/pam.d/gdm-autologin
注释掉auth required pam_succeed_if.so user != root quiet_success这一行(第三行左右)
执行sudo vim /etc/pam.d/gdm-passWord
注释掉 auth required pam_succeed_if.so user != root quiet_success这一行(第三行左右)
执行sudo vim /root/.profile
修改配置文件如下
# ~/.profile: executed by Bourne-compatible login shells.
if [ "$BASH" ]; then
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
fi
tty -s && mesg n || true
mesg n || true
重启:reboot
,选择root用户
export GOROOT=/home/go/go
export GOPATH=/home/go/goProject
export GOPROXY=https://goproxy.cn
export PATH=$PATH:$GOROOT/bin
wget https://download.jetbrains.com.cn/go/goland-2021.3.3.tar.gz
sudo tar -zxvf goland-2021.3.3.tar.gz
mv GoLand-2021.3.3/ goland
/home/go/goland/bin/goland.sh
安装ssh服务,命令:sudo apt-get install openssh-server
开启ssh的22端口,命令:sudo vim /etc/ssh/sshd_config
,将Port注释去掉
允许root用户远程登录,命令:sudo vim /etc/ssh/sshd_config
,修改成如下
重启服务,命令:sudo /etc/init.d/ssh restart
到此这篇关于在ubuntu下安装go开发环境的文章就介绍到这了,更多相关ubuntu安装go开发环境内容请搜索编程网以前的文章或继续浏览下面的相关文章希望大家以后多多支持编程网!
--结束END--
本文标题: 在ubuntu下安装go开发环境的全过程
本文链接: https://lsjlt.com/news/120993.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-04-05
2024-04-05
2024-04-05
2024-04-04
2024-04-05
2024-04-05
2024-04-05
2024-04-05
2024-04-04
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0