Linux 环境基础搭建记录
安装brew
安装命令
第一步
$ export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
第一步
$ export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git/"
第三步 开始安装
$ /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
安装后配置 环境变量
第一步
$ (echo; echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"') >> /home/User/.bashrc
第二步
$ eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"
第三步
$ echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /home/Helix/.bashrc
第四步
$ echo '# Set PATH, MANPATH, etc., for Homebrew.' >> /home/Helix/.bashrc
第五步
$ echo 'export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"' >> /home/Helix/.bashrc
$ echo 'export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git/"' >> /home/Helix/.bashrc
$ export HOMEBREW_BREW_GIT_REMOTE="https://mirrors.ustc.edu.cn/brew.git"
$ export HOMEBREW_CORE_GIT_REMOTE="https://mirrors.ustc.edu.cn/homebrew-core.git/"
$ brew
// 如果命令成功出来 那么就安装成功
$ brew update
第六步 设置镜像地址
$ cd "$(brew --repo)"
$ git remote set-url origin https://mirrors.aliyun.com/homebrew/brew.git
$ echo 'export HOMEBREW_BOTTLE_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles"' >> ~/.bashrc
$ echo 'export HOMEBREW_API_DOMAIN="https://mirrors.ustc.edu.cn/homebrew-bottles/api"' >> ~/.bashrc
source ~/.bashrc
brew update
到这里我们的brew已经安装好了
安装 docker
安装命令
// 先查询一下 docker
$ apt search docker-ce
// 执行 安装命令
$ sudo apt-get install docker-ce
设置用户权限
$ sudo groupadd docker
$ sudo gpasswd -a ${user} docker
$ sudo service docker restart
$ sudo chmod a+rw /var/run/docker.sock
安装 docker-compose
$ apt search docker-compose
$ sudo apt-get install docker-compose
安装PHP
安装命令
brew search php
brew install php@8.1
安装后执行命令
$ echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/php@8.1/bin:$PATH"' >> /home/Helix/.bashrc
$ echo 'export PATH="/home/linuxbrew/.linuxbrew/opt/php@8.1/sbin:$PATH"' >> /home/Helix/.bashrc
$ export LDFLAGS="-L/home/linuxbrew/.linuxbrew/opt/php@8.1/lib"
$ export CPPFLAGS="-I/home/linuxbrew/.linuxbrew/opt/php@8.1/include"
$ source ~/.bashrc
在使用 docker
的情况下最好 composer 是在 docker 容器里面来执行,而不是在宿主机执行,宿主机安装 php
是用于编辑器 质检工具
安装 composer
$ brew search composer
$ brew install composer
安装 node
brew install node
shell 链接工具
termius 支持全平台哦
本作品采用《CC 协议》,转载必须注明作者和本文链接
20230413 安装错误记录
解决方案