最近入了個(gè)斐訊n1,安裝了Armbian勃刨,在家里做個(gè)微服務(wù)器。記錄下安裝完成后常用的配置修改:
配置國內(nèi)鏡像
tee /etc/apt/sources.list <<-'EOF'
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ buster-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
# deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security buster/updates main contrib non-free
EOF
tee /etc/apt/sources.list.d/armbian.list <<-'EOF'
# deb http://apt.armbian.com buster main buster-utils buster-desktop
deb https://mirrors.tuna.tsinghua.edu.cn/armbian/ buster main buster-utils buster-desktop
EOF
常規(guī)配置
# 修改時(shí)區(qū)
timedatectl set-timezone Asia/Shanghai
# 刪除 LC_ALL默認(rèn)配置
sed -i '/LC_ALL/d' /etc/environment
# swappiness參數(shù)設(shè)置與內(nèi)存交換
sed -i 's/vm.swappiness=100/vm.swappiness=10/' /etc/sysctl.conf
sysctl -p
安裝oh-my-zsh
apt-get install -y zsh
sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
# 替換主題
sed -i 's/ZSH_THEME="robbyrussell"/ZSH_THEME="ys"/' ~/.zshrc
usb自動(dòng)掛載
apt-get install -y udevil
# 修改默認(rèn)掛載路徑到/media
sed -i 's/allowed_media_dirs\ =\ \/media\/$USER,\ \/run\/media\/$USER/allowed_media_dirs\ =\ \/media,\ \/media\/$USER,\ \/run\/media\/$USER/' /etc/udevil/udevil.conf
systemctl start devmon@your-username.service
systemctl enable devmon@your-username.service
安裝docker
#安裝
export DOWNLOAD_URL=https://mirrors.tuna.tsinghua.edu.cn/docker-ce
sh -c "$(curl -fsSL https://get.docker.com)"
#配置加速鏡像
mkdir -p /etc/docker
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": [
"https://docker.mirrors.ustc.edu.cn"
]
}
EOF
systemctl daemon-reload
systemctl restart docker
#安裝GUI工具
docker volume create portainer_data
docker run -d -p 9000:9000 --name portainer --restart always -v /var/run/docker.sock:/var/run/docker.sock -v portainer_data:/data portainer/portainer