alpine系统尝试记录

alpine系统尝试记录

配置 alpine 清华源

1
sed -i 's#https\?://dl-cdn.alpinelinux.org/alpine#https://mirrors.tuna.tsinghua.edu.cn/alpine#g' /etc/apk/repositories

安装zsh git curl vim zsh-vcs

1
apk add zsh git curl vim zsh-vcs

创建源码目录

1
2
mkdir src
cd src

安装oh-my-zsh

1
sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)"

字体安装

1
2
3
git clone https://gh-proxy.org/https://github.com/powerline/fonts.git --depth=1
cd fonts
zsh install.sh

安装字体

1
2
3
4
curl -OL https://gh-proxy.org/https://github.com/ryanoasis/nerd-fonts/releases/latest/download/JetBrainsMono.tar.xz
mkdir fonts-JetBrainsMono
tar -xvf JetBrainsMono.tar.xz -C fonts-JetBrainsMono
cp *.ttf /root/.local/share/fonts

额外字体

1
2
3
4
curl -OL https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Regular.ttf
curl -OL https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold.ttf
curl -OL https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Italic.ttf
curl -OL https://github.com/romkatv/powerlevel10k-media/raw/master/MesloLGS%20NF%20Bold%20Italic.ttf

安装powerlevel10k

1
git clone --depth=1 https://gitee.com/romkatv/powerlevel10k.git "${ZSH_CUSTOM:-$HOME/.oh-my-zsh/custom}/themes/powerlevel10k"

配置p10k

1
p10k configure

安装字体与字体配置

1
apk add ttf-dejavu fontconfig

刷新字体

1
mkfontscale && mkfontdir && fc-cache

配置alpine glibc兼容

1
2
3
4
5
6
7
8
wget -q -O /etc/apk/keys/sgerrand.rsa.pub https://alpine-pkgs.sgerrand.com/sgerrand.rsa.pub
wget https://gh-proxy.org/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-2.35-r1.apk
apk add glibc-2.35-r1.apk

wget https://gh-proxy.org/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-bin-2.35-r1.apk
wget https://gh-proxy.org/https://github.com/sgerrand/alpine-pkg-glibc/releases/download/2.35-r1/glibc-i18n-2.35-r1.apk

apk add glibc-bin-2.35-r1.apk glibc-i18n-2.35-r1.apk

配置英文

1
/usr/glibc-compat/bin/localedef -i en_US -f UTF-8 en_US.UTF-8

配置中文

1
/usr/glibc-compat/bin/localedef -i zh_CN -f UTF-8 zh_CN.UTF-8

配置环境变量

1
2
3
/etc/profile
export LANG=zh_CN.UTF-8
export LC_ALL=zh_CN.UTF-8

安装neovim

1
apk add neovim

配置neovim

1
git clone https://gh-proxy.org/https://github.com/NvChad/starter ~/.config/nvim

配置lazynvim

1
git clone https://gh-proxy.org/https://github.com/folke/lazy.nvim.git /root/.local/share/nvim/lazy/lazy.nvim

等待安装所有依赖

1
nvim

github代理

1
git config --global url."https://gh-proxy.org/https://github.com/".insteadof "https://github.com/"

查看git配置

1
git config --list

取消代理

1
git config --global --unset url.https://gh-proxy.com/https://github.com/.insteadof