【Ubuntu】双系统安装记录(三):Github访问、Steam++及Git安装与配置
# Steam++ 安装
# 下载
-
会下载一个集合包,包含了各个平台的安装包,选择 Linux 的 deb 安装包
# 安装
sudo dpkg -i Steam++_linux_x64_[version].deb
# 问题
-
端口无法监听
-
命令允许程序监听 1024 以下端口
sudo setcap cap_net_bind_service=+eip /usr/share/Steam++/Steam++
-
Host 文件读取权限受限
仅限于 Host 代理模式下
-
避免每次启动关闭加速需要输入密码,打开终端执行以下命令:
sudo chmod a+w /etc/hosts
-
如输入上面命令还提示无法 hosts 错误请尝试执行下面命令:
sudo chmod a+r /etc/hosts
-
-
被浏览器拦截
显示 “不是专有连接” 等提示,无效证书
-
解决办法:在浏览器设置中导入证书,从
颁发机构
导入 -
证书本地存放地址:
-
~/.local/share/Steam++
(用户文件夹下) -
通过 GUI 打开:
网络加速
=>...
=>打开证书文件夹
-
-
# Git 安装及配置
Git 已经在 22-12-16 安装但未记录
22-12-20 使用 Steam 设置代理代替 Clash,原来使用 Clash 时需设置手动代理,给 Git 也设置了代理,在使用 Steam 导致 GitHub 无法访问,删除原来的代理即可
# 安装
-
更新 apt
sudo apt update sudo apt upgrade
-
下载 Git
sudo apt install git
# 配置
设置代理
-
使用命令设置 socks 或者 http 代理
# http git config --global http.proxy http://127.0.0.1:8080 git config --global https.proxy https://127.0.0.1:8080 # socks git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks5://127.0.0.1:1080'
-
使用命令行取消代理
git config --global --unset http.proxy git config --global --unset https.proxy http
-
直接修改.gitconfig 文件,新建或修改以下内容
vim ~/.gitconfig
[http] proxy = socks5://127.0.0.1:1080 [https] proxy = socks5://127.0.0.1:1080
# 使用
-
初始化本地仓库
git init
-
更新修改
git add .
-
提交版本到本地
git commit -m '版本号'
-
添加远程仓库链接
git remote add origin [repository address]
-
更新本地文件到远程仓库
由于远程库是空的,我们第一次推送
master
分支时,加上了-u
参数,Git 不但会把本地的master
分支内容推送的远程新的master
分支,还会把本地的master
分支和远程的master
分支关联起来,在以后的推送或者拉取时就可以简化命令git push -u origin master
-
git push -u origin master
-