-
Notifications
You must be signed in to change notification settings - Fork 2
/
install.sh
83 lines (83 loc) · 3.72 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#!/bin/bash
#########################################################
# Manjaro Linux常用软件一键安装脚本 #
# v0.39.1 #
# Author: zhouxuanyi #
# Copyright (c) 2021 zhouxuanyi #
# URL: https://github.com/zhouxuanyi-zxy/Manjaro-linux #
# License: MIT #
#########################################################
if [ `whoami` != "root" ];
then
echo "请使用root权限执行此脚本!"
exit
fi
read -r -p "您是否要安装此工具?(Y/N)" install
install=${install,,} # tolower
if [[ $install =~ ^(yes|y| ) ]] || [[ -z $install ]]; then
mkdir /tmp/Manjaro-linux #设置/tmp/为临时目录
cd /tmp/Manjaro-linux
echo 正在备份默认安装源
sudo cp /etc/pacman.conf /etc/pacman.conf.bak #备份源
sudo cp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak
clear
echo 正在修改源
sudo echo '[archlinuxcn]' >> /etc/pacman.conf
sudo echo 'SigLevel = Optional TrustedOnly' >> /etc/pacman.conf
sudo echo '##中科大源##' >> /etc/pacman.conf
sudo echo 'Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch' >> /etc/pacman.conf
sudo echo '##阿里源##' >> /etc/pacman.conf
sudo echo 'Server = https://mirrors.aliyun.com/archlinuxcn/$arch' >> /etc/pacman.conf
sudo echo '##清华源##' >> /etc/pacman.conf
sudo echo 'Server = https://mirrors.ustc.edu.cn/archlinuxcn/$arch' >> /etc/pacman.conf
sudo echo '## Country : China' >> /etc/pacman.d/mirrorlist
sudo echo 'Server = https://mirrors.huaweicloud.com/manjaro/stable/$repo/$arch' >> /etc/pacman.d/mirrorlist
sudo echo '## Country : China' >> /etc/pacman.d/mirrorlist
sudo echo 'Server = https://mirrors.ustc.edu.cn/manjaro/stable/$repo/$arch' >> /etc/pacman.d/mirrorlist
clear
echo 正在更新软件源
sudo pacman -Syy --noconfirm && sudo pacman -S --noconfirm archlinuxcn-keyring
clear
echo 开始安装常用软件
sudo pacman -S --noconfirm vim #安装vim
clear
sudo pacman -S --noconfirm netease-cloud-music #安装网易云音乐
clear
sudo pacman -S --noconfirm google-chrome #安装谷歌浏览器
clear
echo 安装zsh
sudo pacman -S --noconfirm zsh #安装zsh
clear
cd /tmp/Manjaro-linux
echo 安装Virtual Box
sudo pacman -S --noconfirm virtualbox
#wget https://download.virtualbox.org/virtualbox/6.1.18/VirtualBox-6.1.18-142142-Linux_amd64.run
#chmod 777 VirtualBox-6.1.18-142142-Linux_amd64.run
#sudo ./VirtualBox-6.1.18-142142-Linux_amd64.run
clear
#echo 安装QQ
#wget http://down.qq.com/qqweb/LinuxQQ/linuxqq_2.0.0-b2-1084_x86_64.pkg.tar.xz
#sudo pacman -U --noconfirm linuxqq_2.0.0-b2-1084_x86_64.pkg.tar.xz
#clear
echo 安装Arch Linux AUR管理器
sudo pacman -S --noconfirm yay
#yay --aururl "https://aur.tuna.tsinghua.edu.cn" --save
clear
echo 安装QQ
yay -S --noconfirm linuxqq
clear
echo 安装python
sudo pacman -S --noconfirm python
clear
echo 安装visual studio code
sudo pacman -S --noconfirm visual-studio-code-bin ##安装vs code
clear
echo 安装ohmyzsh
sudo pacman -S --noconfirm oh-my-zsh-git
#sh -c "$(curl -fsSL https://raw.githubusercontent.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" "" --unattended
echo 正在清理残余文件
sudo rm -f -r /tmp/Manjaro-linux/
clear
echo 成功安装完成!已安装:vim、网易云音乐、Google Chrome、zsh、Virtual Box、QQ、ohmyzsh、yay。
exit 1
fi