Skip to content

Commit 8a18a00

Browse files
committed
[refactor][arch] backup mirrorlist first
1 parent 8a9f8ec commit 8a18a00

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

arch/init.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@
44
# Source: https://gist.github.com/bouroo/b750d3fa357362772082407cfa21fb4a
55
# Fork: https://gist.github.com/jcchikikomori/0984ae8111496ea7544b6452adbbe180
66

7+
# Backup mirrorlist
8+
cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
9+
# Install essential packages
10+
pacman -Syy --noconfirm --noprogressbar sudo gvim nano htop iftop mtr dkms lz4 bash-completion base-devel pacman-contrib git zsh unzip
711
# Init pacman mirror
812
curl -s -L "https://archlinux.org/mirrorlist/?country=CN&country=JP&country=SG&country=KR&protocol=https&ip_version=4&use_mirror_status=on" | sed -e 's/^#Server/Server/' -e '/^#/d' > /etc/pacman.d/mirrorlist
913
# Init key
@@ -12,8 +16,5 @@ pacman-key --init
1216
pacman-key --populate archlinux
1317
# Sync repo
1418
pacman -Syyu --noconfirm --noprogressbar
15-
# Install essential packages
16-
pacman -S --noconfirm --noprogressbar sudo gvim nano htop iftop mtr dkms lz4 bash-completion base-devel pacman-contrib git zsh unzip
17-
# Sort repo by speed
18-
cp -f /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.backup
19+
# Sort repo by speed (pacman-contrib package required)
1920
rankmirrors -n 5 /etc/pacman.d/mirrorlist.backup > /etc/pacman.d/mirrorlist

0 commit comments

Comments
 (0)