arch滚动更新,搜狗输入法挂了,想要修复,不小心删错东西,系统挂了。只好重新安装,但是重新配置又比较麻烦,简单写一个脚本,安装一些常用软件,做一个简单的备份。一些自己平常使用习惯的东西,就不写在这里了。
主要是之前写的教程,做成一个简单的脚本,只适合刚刚重新安装完的arch+deepin:
https://bbs.zsxwz.com/thread-2827.htm
https://bbs.zsxwz.com/thread-2828.htm
https://bbs.zsxwz.com/thread-2829.htm
把脚本里的zsxwz,改成你自己的用户名,把你自己不需要的部分删掉即可。
sudo -i
# 切换root
nano arsh.sh
# 编辑脚本,复制以下脚本内容
sh arsh.sh
# 运行脚本
#!/bin/bash
echo "修改软件源"
sed -i '1i\Server = rsync://mirror.chaoticum.net/arch/$repo/os/$arc' /etc/pacman.d/mirrorlist
sed -i '1i\Server = https://mirror.pseudoform.org/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = https://mirror.chaoticum.net/arch/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = http://mirror.chaoticum.net/arch/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = http://mirror.pseudoform.org/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = rsync://mirror.chaoticum.net/arch/$repo/os/$arc' /etc/pacman.d/mirrorlist
sed -i '1i\Server = http://mirrors.aliyun.com/archlinux/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = https://mirrors.cloud.tencent.com/archlinux/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = https://mirrors.tuna.tsinghua.edu.cn/archlinux/$repo/os/$arch' /etc/pacman.d/mirrorlist
sed -i '1i\Server = https://mirrors.huaweicloud.com/archlinux/$repo/os/$arch' /etc/pacman.d/mirrorlist
cat >> /etc/pacman.conf <<-'EOF'
Color
[multilib]
Include = /etc/pacman.d/mirrorlist
[archlinuxcn]
SigLevel = Optional TrustAll
Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/$arch
Server = https://mirrors.lzu.edu.cn/archlinuxcn/$arch
Server = https://repo.archlinuxcn.org/$arch
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
Server = https://mirrors.163.com/archlinuxcn/$arch
Server = https://mirrors.cqu.edu.cn/archlinuxcn/$arch
Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch
Server = https://mirrors.zju.edu.cn/archlinuxcn/$arch
Server = https://mirrors.redrock.team/archlinuxcn/$arch
EOF
echo "更新源"
pacman -Syyu
echo "修改dns"
cat >/etc/resolv.conf <<-'EOF'
nameserver 208.67.222.222
nameserver 8.8.8.8
nameserver 1.1.1.1
nameserver 117.50.11.11
EOF
chattr +i /etc/resolv.conf
echo "网络优化"
cat >/etc/modprobe.d/iwlwifi.conf <<-'EOF'
options iwlwifi 11n_disable=8 bt_coex_active=0 power_save=0 swcrypto=1
EOF
echo "创建swap虚拟内存4g"
mkdir /home/zsxwz/swap
dd if=/dev/zero of=/home/zsxwz/swap/swap bs=1k count=4096k
chmod 0600 /home/zsxwz/swap/swap
mkswap /home/zsxwz/swap/swap
swapon /home/zsxwz/swap/swap
echo '/home/zsxwz/swap/swap swap swap default 0 0' >> /etc/fstab
echo "安装输入法"
pacman -S yay
pacman -S archlinuxcn-keyring
pacman -S fcitx-im fcitx-configtool
echo "添加环境变量"
cat >/root/xprofile <<-'EOF'
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFFIERS="@im=fcitx"
EOF
cat >> /etc/environment <<-'EOF'
export GTK_IM_MODULE=fcitx
export QT_IM_MODULE=fcitx
export XMODIFFIERS="@im=fcitx"
EOF
echo "安装wps"
pacman -S wps-office-cn wps-office-mui-zh-cn ttf-wps-fonts
sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/wps
sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/wps
sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/wpp
sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/wpp
sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/wpspdf
sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/wpspdf
sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /usr/bin/et
sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /usr/bin/et
echo "安装常用软件"
echo "视频音乐"
pacman -S vlc mpv netease-cloud-music-gtk
echo "下载工具
pacman -S aria2-fast motrix wget axel
echo "文本编辑器"
pacman -S vim code gedit
echo "笔记"
pacman -S joplin
echo "解压工具"
pacman -S file-roller p7zip unzip
echo "代理工具"
pacman -S v2ray qv2ray
echo "视频图片编辑"
pacman -S kdenlive krita
echo "Wireshark"
pacman -S Wireshark-qt
usermod -a -G wireshark zsxwz
echo "浏览器"
pacman -S google-chrome firefox
echo "scrcpy投屏"
pacman -S scrcpy adb
echo "python"
pacman -S python-pip nodejs npm
echo "安装视频下载工具"
pip3 install youtube-dl
pip3 install ykdl
pip3 install you-get
echo "一些小工具"
pacman -S git screen screenfetch qrencode flameshot zssh lrzsz parcellite rclone catfish remmina zsh openssh cron net-tools dnsutils
echo "鼠标滚轮优化"
pacman -S imwheel
cat > /home/zsxwz/.config/autostart/imwheel.desktop <<-'EOF'
[Desktop Entry]
Name=imwheel
Exec=setsid imwheel
Type=Application
EOF
echo "关闭省电"
iw dev wlan0 set power_save off
echo "cpu优化"
pacman -S cpupower
cpupower frequency-set -g performance
echo "安装虚拟机"
pscman -S virtualbox linux-headers
usermod -a -G vboxusers zsxwz
echo "卸载不常用"
pacman -R deepin-music deepin-clone
echo "aria2下载"
su - zsxwz -c "mkdir /home/zsxwz/.config/aria2"
cat >/home/zsxwz/.config/aria2/aria2.conf <<-'EOF'
dir=/home/zsxwz/Downloads
disk-cache=32M
continue=true
max-connection-per-server=16
min-split-size=10M
split=32
event-poll=select
rpc-listen-port=6800
listen-port=51413
bt-max-peers=100
enable-dht=true
#enable-dht6=false
dht-listen-port=6881-6999
bt-enable-lpd=true
enable-peer-exchange=true
seed-time=0
bt-tracker=udp://tracker.opentrackr.org:1337/announce,http://tracker.opentrackr.org:1337/announce
EOF
cat >/etc/systemd/system/aria2.service <<-'EOF'
[Unit]
Description=aria2c
After=network.target
[Service]
ExecStart=/usr/bin/aria2c --enable-rpc --rpc-listen-all --conf-path=/home/zsxwz/.config/aria2/aria2.conf
[Install]
WantedBy=multi-user.target
EOF
systemctl enable aria2
systemctl start aria2
echo "自动更新tracker"
cat >/home/zsxwz/tracker.sh <<-'EOF'
#!/bin/bash
list=`wget -qO- https://raw.githubusercontent.com/ngosang/trackerslist/master/trackers_all.txt|awk NF|sed ":a;N;s/\n/,/g;ta"`
sed -i "s@bt-tracker.*@bt-tracker=$list@g" /home/zsxwz/.config/aria2/aria2.conf
EOF
bash /home/zsxwz/tracker.sh
echo "ssh远程"
cat >> /etc/ssh/sshd_config <<-'EOF'
RSAAuthentication yes
PubkeyAuthentication yes
ClientAliveInterval 120
ClientAliveCountMax 720
EOF
systemctl enable sshd
systemctl start sshd
echo "禁用ipv6"
su - zsxwz -c "yay -S rc-local"
systemctl enable rc-local
sed -i "/exit 0/i\sysctl -w net.ipv6.conf.all.disable_ipv6=1" /etc/rc.local
echo "安装微信,qq"
su - zsxwz -c "yay -S deepin.com.qq.im deepin.com.wechat2"
sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /opt/deepinwine/apps/Deepin-WeChat/run.sh
sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /opt/deepinwine/apps/Deepin-WeChat/run.sh
sed -i "/#\!\/bin\/bash/a\export XMODIFIERS=\"@im=fcit\"" /opt/deepinwine/apps/Deepin-QQ/run.sh
sed -i "/#\!\/bin\/bash/a\export QT_IM_MODULE=\"fcitx\"" /opt/deepinwine/apps/Deepin-QQ/run.sh
echo "vnc远程"
pacman -S x11vnc
cat >/etc/systemd/system/x11vnc.service <<-'EOF'
[Unit]
Description=x11vnc
After=network.target
[Service]
ExecStart=/usr/bin/x11vnc -auth guess -once -loop -noxdamage -repeat -rfbauth /root/.vnc/passwd -rfbport 5900 -shared -xrandr "resize" -display :0
[Install]
WantedBy=multi-user.target
EOF
systemctl enable x11vnc
echo "设置vnc密码"
x11vnc -storepasswd
echo "修复箭头乱码"
git clone https://github.com/powerline/fonts.git
cd fonts
./install.sh
cd ~
echo "ohmyzsh ,代码高亮"
cat > /home/zsxwz/zsh.sh <<-'EOF'
sh -c "$(curl -fsSL https://www.zsxwz.com/deepin/zsh.sh)
git clone https://github.com/zsh-users/zsh-syntax-highlighting.git
echo "
source ${(q-)PWD}/zsh-syntax-highlighting/zsh-syntax-highlighting.zs" >> ${ZDOTDIR:-$HOME}/.zshrc
source ~/.zshrc
EOF
sh /home/zsxwz/zsh.sh
最后于 20/05.10 13:42
被zsxwz编辑
,原因:
上一篇:
Win10安装AutoRclone下一篇:
新轮子——GDindex搭建在cf的谷歌网盘列表程序