1、安装manjaro
manjaro是一款基于arch的linux发行版,是目前非常热门的一款发行版,总所周知arch的软件包非常之多,而且很新,manjaro完美继承了arch的aur,而且比arch更加好的一点是拥有gui安装界面,不至于新手一上来就懵逼。
2、安装archlinuxcn中国源
编辑/etc/pacman.conf
,在最后面加上
[archlinuxcn]
SigLevel = Optional TrustAll
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
更新系统
sudo pacman -Syu
3、安装常用软件
安装yaourt
sudo pacman -S yaourt
导入GPG Key,否则通过Yaourt安装软件会经常出错
sudo pacman -S archlinuxcn-keyring
安装chrome
sudo pacman -S google-chrome
安装phpstorm
yaourt -S phpstorm
安装搜狗输入法
sudo pacman -S fcitx-im fcitx-configtool
默认全部选中
创建配置文件~/.xprofile
sudo vim ~/.xprofile
添加以下内容
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFIERS="@im=fcitx"
执行
sudo pacman -S fcitx-sogoupinyin
安装vscode
sudo pacman -S visual-studio-code-bin
为了能sudo 下运行 , 配置一下.zshrc
alias scode="sudo code --user-data-dir=~/.config/Code/"
之后用scode命令就是sudo code
安装shadowsocks-qt5
sudo pacman -S shadowsocks-qt5
安装ProxyChains
sudo pacman -S proxychains
编辑配置文件/etc/proxychains.conf
,将最后一行替换成自己的配置,例如
socks5 127.0.0.1 1080
使用方法是在命令前面加一句proxychains4
4、配置php开发环境
1、安装nginx
安装
sudo pacman -S nginx
常用命令
sudo systemctl [start|stop|restart] nginx
注册为开机启动
sudo systemctl enable nginx
修改配置文件
配置文件在/etc/nginx/nginx.conf
,编辑这个文件
user 用户名
...
root /home/ibluesoul/junan/public;
location / {
try_files $uri $uri/ /index.php?$query_string;
index index.php index.html index.htm;
}
...
location ~ \.php$ {
fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
2、安装php、php-fpm
安装
sudo pacman -S php-fpm
php会被依赖安装
常用命令
sudo systemctl [start|stop|restart] php-fpm
注册为开机启动
sudo systemctl enable php-fpm
配置文件/etc/php/php-fpm.d/www/conf
user = 用户名
group = 用户组
...
listen.owner = 用户名
listen.group = 用户组
3、安装MariaDB
安装
sudo pacman -S mariadb
启动服务前先运行
sudo mysql_install_db --user=mysql --basedir=/usr --datadir=/var/lib/mysql
启动mariadb
sudo systemctl start mariadb
运行以下命令完成安全措施
mysql_secure_installation
完成~
4、安装nodejs(npm)
这里采用nvm管理nodejs的版本
安装nvm
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.33.8/install.sh | bash
source .bashrc
查看nodejs版本
nvm ls-remote
选择版本安装
nvm install 8.10.0
查看npm是否安装成功
npm -v
切换成淘宝镜像
临时使用
npm --registry https://regstry.npm.taobao.org install express
持久使用
npm config set registry https://registry.npm.taobao.org
5、安装composer
composer的官方推荐的安装方式不翻墙基本没法用,自己想办法吧2333333
我这里采用手动安装
手动下载composer.phar
wget -c https://getcomposer.org/download/1.6.3/composer.phar
妈个鸡下不来,参考之前那篇自建离线下载服务器,下到服务器上再载下来。
php composer.phar
就可以用了 方便起见就把composer.phar
放在~/composer
下
.bashrc
里面加上一句
alids composer='php /home/ibluesoul/composer/composer.phar'
最后运行一下
source ~/.bashrc
尝试一下是否成功
composer -V
替换中国镜像
composer config -g repo.packagist composer https://packagist.phpcomposer.com
配置文件在~/.config/composer/config,json
我试了下我这样安装 配置还是成功的
5、其他的一些配置
1、zsh
安装zsh
sudo pacman -S zsh
安装oh-my-zsh
sh -c "$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)"
安装zsh-autosuggestions
sudo pacman -S zsh-autosuggestions
在.zshrc下添加
source /usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
这边需要配置一下颜色 编辑/usr/share/zsh/plugins/zsh-autosuggestions/zsh-autosuggestions.zsh
ZSH_AUTOSUGGEST_HIGHLIGHT_STYLE='fg=blue'