-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patharchRiceSystem.fish
More file actions
executable file
·621 lines (556 loc) · 20.5 KB
/
archRiceSystem.fish
File metadata and controls
executable file
·621 lines (556 loc) · 20.5 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
#! /bin/env fish
# A collection of functions to setup an Arch Linux system.
# It is interactive and asks for confirmation before performing actions.
# scope env vars
begin
# Setup environment variables for optimized build
set -gx CFLAGS "-O2 -march=native -flto"
set -gx CXXFLAGS "-O2 -march=native -flto"
set -gx RUSTFLAGS "-C opt-level=2 -C target-cpu=native -C lto=fat"
set -gx MAKEFLAGS "-j$(nproc)"
set -gx USE_CCACHE 1
set -gx CCACHE_DIR "$HOME/.ccache"
if command -sq ccache
mkdir $CCACHE_DIR
ccache -M 10G # allocate 10GB cache
end
printf "✅ Environment configured for optimized builds.\n"
printf "Using %s threads and CPU-specific optimizations:\n" "$MAKEFLAGS"
printf " CFLAGS: %s\n" "$CFLAGS"
printf " CXXFLAGS: %s\n" "$CXXFLAGS"
printf " RUSTFLAGS: %s\n" "$RUSTFLAGS"
function install -d "Install packages using pikaur with optimizations"
pikaur -S --needed --noconfirm $argv
end
function install-confirm -d "Install packages using pikaur with optimizations"
pikaur -S --needed $argv
end
function ask -d "Ask for confirmation"
read -P "$argv[1] " -n 1 confirm
echo
test "$confirm" = y
end
end
mkdir -p ~/Downloads
mkdir -p ~/.config ~/.local/sources
touch ~/.vimrc.local
touch ~/.bashrc.local
touch ~/.config/Xresources.local
# IS STEAMDECK (includes running in distrobox)
set -l HOSTNAME (uname --nodename)
set -g is_steam false
if string match -q 'steamdeck*' $HOSTNAME
set is_steam true
end
# IS STEAMDECK METAL
set -g is_steam_host false
if test "$HOSTNAME" = steamdeck
set is_steam_host true
end
if test "$is_steam" = true
printf "Host is steamdeck\n"
else
printf "Host is not steamdeck\n"
end
# on steamdeck: first make writeable
if test "$is_steam_host" = true
if ask "Did you manually set 'passwd'?"
# make writeable
sudo steamos-readonly disable
# enable ssh access
sudo systemctl enable --now sshd
# disable wifi powersave for lagfree ssh
sudo iw dev wlan0 set power_save off
# fix permission problems for X11 sockets for distrobox
sudo cp ~/scripts/fix_tmp_x11.sh /etc/profile.d/
else
exit
end
end #/steamdeck
if ask "Init keys ( and full upgrade on NON steamdeck)?"
# init & refresh keys
if not test "$is_steam_host" = true
sudo env bash ~/archlinux/init-pacman-keys.sh # also does full system upgrades
end
if test "$is_steam_host" = true
echo "Installing holo-keyring"
sudo pacman-key --init
sudo pacman-key --populate archlinux
sudo pacman-key --populate holo
sudo pacman -Sy --noconfirm holo-keyring
sudo pacman -S --noconfirm tmux fish base-devel git
sudo pacman -Sy --noconfirm
end
# STEAMDECK: fix broken headers
if test "$is_steam_host" = true
echo "Steamdeck: fixing broken headers of buildtools"
# no --needed, doesn't updated headers
sudo pacman -S --noconfirm gcc glibc lib32-glibc linux-headers linux-api-headers cmake ncurses
# FIX ALL THE BROKEN HEADERS
if ask "Re-install all packages with missing headers?"
# installs packages with missing files
cat ~/.local/sources/steam-missing.txt | sudo pacman -S --noconfirm -
end
end
end # / full upgrade
if ask "Rank mirrors?"
env bash ~/archlinux/install-aur-and-mirror-helpers.sh rank_mirrors
end
# install AUR helper:
if not command -sq pikaur
if ask "Install pikaur"
if test "$is_steam_host" = true
# need build tools first
sudo env bash ~/archlinux/install-buildtools.sh
cd ~/.local/sources/
git clone https://aur.archlinux.org/pikaur.git
cd pikaur
# pikaur > 1.20 needed python^3.12
# git checkout 75bc4f07
makepkg -si
cd ~/archlinux/
else
# need build tools first
sudo env bash ~/archlinux/install-buildtools.sh
env bash ~/archlinux/install-aur-and-mirror-helpers.sh
end
echo $PWD
end
end
if test "$is_steam_host" = true
if ask "Install steamos-btrfs"
set t "$(mktemp -d)"
curl -sSL https://gitlab.com/popsulfr/steamos-btrfs/-/archive/main/steamos-btrfs-main.tar.gz | tar -xzf - -C "$t" --strip-components=1
"$t/install.sh"
env rm -rf "$t"
end
end
if ask "Install advcpmv"
set t "$(mktemp -d)"
curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o $t/advcpmv/install.sh; and begin
cd $t/advcpmv; and sh install.sh; and mv $t/advcpmv/advcp $HOME/.local/bin/; and mv $t/advcpmv/advmv $HOME/.local/bin/
end
env rm -rf "$t"
end
# FIRST TRY SCRIPT, MAY FAIL BECAUSE GIT SUBMODULES NOT CHECKED OUT
if ask "Install CLI essentials (and GUI on steamdeck)"
install rustup
# prep for rust based pkgs e.g. fish-git, yazi-git
rustup default stable
if test "$is_steam_host" = true
echo "~/archlinux/install-cli-essentials.sh"
env bash ~/archlinux/install-cli-essentials.sh
echo "~/archlinux/install-steamdeck-essentials.sh"
env bash ~/archlinux/install-steamdeck-essentials.sh
else
echo "~/archlinux/install-cli-essentials.sh"
env bash ~/archlinux/install-cli-essentials.sh
if ask "Install cli-extra?"
echo "~/archlinux/install-cli-extra.sh"
env bash ~/archlinux/install-cli-extra.sh
end
end
end
# ESSENTIALS SYSTEM
if ask "FIX (e.g. rbenv, sshuttle, fish-git)"
install rustup
# prep for rust based pkgs e.g. fish-git, yazi-git
rustup default stable
# if ask "setup 'rbenv install' and latest stable ruby"
# # `rbenv install` command isn't installed by default via pacman
# git clone https://github.com/rbenv/ruby-build.git "$(rbenv root)"/plugins/ruby-build
# # Install latest stable ruby
# # Source - https://stackoverflow.com/a/30191850
# if test "$is_steam_host" = true
# # fallback on steamdeck, build 4.0 fails
# install-confirm gcc6
# rbenv install 3.4.8
# # back to modern gcc
# install-confirm gc6
# else
# rbenv install $(rbenv install -l | grep -v - | tail -1)
# end
# end
if ask "setup fish-git and latest stable fish?"
install-confirm \
fish-git \
# fish uses "hostname" in many scripts
inetutils
# folder watchers
inotify-tools
end
if ask "install pikaur -G sshuttle"
# sshuttle neovim-nightly see below for steamdeck special case
# ESSENTIALS w/ STEAM special cases
# eg. neovim-git htop mosh urlview
if test "$is_steam" = true
# sshuttle
install sshuttle --overwrite "/usr/lib/python3.*" && sudo pacman -S python
else # not steam should just work
install \
neovim-nightly tree-sitter-cli xsel nvimpager \
urlview sshuttle
# keep empty line for "end"
end
end
install direnv \
babashka-bin \
ripgrep \
# modern cli
fzf fd duf dust exa bottom bat procs tldr rm-improved-bin \
python3 python-pip python-pipx uv python-poetry \
yazi-git \
# fish z
zoxide
end
# NVIM need confirm because of old nvim
printf "nvim --version: " && nvim --version
if ask "Manually install NEOVIM-GIT (version >= 7 needed)?"
install-confirm neovim-nightly-bin tree-sitter-cli xsel
if ask "git install neovim-git?"
# pikaur -S --needed neovim-git
cd ~/.local/sources
pikaur -G neovim-nightly
cd neovim-nightly
makepkg --syncdeps --install --clean
cd
end
end
if ask "--overwrite install urlview?"
# URLVIEW
install urlview --overwrite "/etc/urlview/*"
end
# HTOP
if ask "git clone install htop?"
# need at least this version for current ~/.htop
if not test "htop 3.2.1" = (htop --version)
install ncurses libnl libcap && install htop-git
# manually (fallback)
htop --version
if ask "Manually install HTOP?"
git clone https://github.com/htop-dev/htop ~/.local/sources/htop
cd ~/.local/sources/htop
./autogen.sh && ./configure \
--prefix=/usr \
--sysconfdir=/etc \
--enable-unicode \
--enable-openvz \
--enable-vserver
sudo make install
cd ~
end
end
end
# NVIMPAGER
if not command nvimpager
if ask "Manually install NVIMPAGER?"
cd ~/Downloads
git clone https://git.sr.ht/~sircmpwn/scdoc
cd scdoc
make
sudo make install
cd ~/Downloads
git clone https://github.com/lucc/nvimpager
cd nvimpager/
make PREFIX=$HOME/.local/bin install
cd ~
rm -rf ~/Downloads/nvimpager ~/Downloads/scdoc
end
# keep empty line
end # / if cli essentials
if ask "Install pip wheel pynvim autopep8 flake8?"
pip3 install --user wheel pynvim
pip3 install --user autopep8 # might fail
pip3 install --user flake8 # might fail
end
if ask "Setup fishlogin?"
# FISH DEFAULT SHELL
# 1. Copy this file to /usr/local/bin/fishlogin
sudo ln -s ~/.local/bin/fishlogin /usr/local/bin/fishlogin
# 2. Make it executable:
sudo chmod +x /usr/local/bin/fishlogin
# 3. Add it to /etc/shells
echo /usr/local/bin/fishlogin | sudo tee -a /etc/shells
# 4. print Instructions
printf "4. Switch your login shell:\n
chsh -s /usr/local/bin/fishlogin $USER\n
# source: https://superuser.com/a/1046884\n"
end
if ask "Install fisher + theme + plugins?"
# fix weird symbols when connecting via JuiceSSH
# set -Ua fish_features no-keyboard-protocols
# FISHER
fish -c 'curl -sL https://git.io/fisher | source && fisher install jorgebucaran/fisher'
# fzf
fish -c 'fisher install PatrickF1/fzf.fish'
# ssh-agent
fish -c 'fisher install danhper/fish-ssh-agent'
# zoxide: fish helper
# use:
# z alias cd
# zi => interactive
fish -c 'fisher install jethrokuan/z'
# replay: take bash commands and use return value
# e.g.: replay "source /usr/share/nvm.sh --no-use && nvm use latest" # installs and uses latest nvm
fish -c 'fisher install jorgebucaran/replay.fish'
# switches shell between 1 or 2 lines
fish -c 'fisher install zzhaolei/transient.fish'
# NOT USED ANYMORE
# bass: makes it easy to use utilities written for Bash in fish shell.
# e.g.: bass export X=
# fish -c 'fisher install edc/bass'
# fish -c 'fisher install andreiborisov/sponge'
# fish -c 'fisher install gazorby/fish-abbreviation-tips'
# DONT USE omf!!
# `omf destroy` on existing setups
# Oh My Fish has been unmaintained for years
# only needed for yimmy
# curl https://raw.githubusercontent.com/oh-my-fish/oh-my-fish/master/bin/install | NONINTERACTIVE=true fish
# omf theme
# fish -c 'omf install yimmy'
# MANUAL: install OH-MY-FISH
if ask "Manually install OMF (please don't)?"
mkdir -p ~/.local/sources
cd ~/.local/sources
git clone -c core.autocrlf=false https://github.com/oh-my-fish/oh-my-fish
cd oh-my-fish
bin/install --offline --noninteractive
cd
end
end
# NPM / YARN / NODE / NVM
if ask "Setup NPM / YARN / NODE / NVM installations?"
install nvm
# install ~/.nvm
bash --norc /usr/share/nvm/init-nvm.sh
cd ~
mkdir -p ~/.local/share/nvm
fish -c 'fisher install jorgebucaran/nvm.fish'
nvm install lts
nvm use lts
npm install -G yarn
end
# CLOJURE (steamdeck)
if ask "Install CLOJURE?"
cd ~/.local/sources
# build clojure
pikaur -G clojure && cd clojure/repos/community-any && makepkg --noconfirm --syncdeps --clean --force && sudo pacman -U --noconfirm clojure-*.pkg.tar.zst --overwrite "*" && \
# leiningen
gpg --receive-keys 040193357D0606ED && sudo pacman -S --noconfirm readline && pikaur -S --noconfirm leiningen rlwrap
cd ~
end
if ask "Install 1password + CLI"
curl -sS https://downloads.1password.com/linux/keys/1password.asc | gpg --import
install --overwrite "/opt/1Password/*" 1password 1password-cli
end
# 1. create some space on steamdeck
if test "$is_steam" = true
if ask "Create some space on steamdeck?"
# delete unneeded docs/fonts
pikaur -R \
qt5-examples qt5-doc
pikaur -R \
noto-fonts-cjk
# MOVE steam
if ask "Move /usr/lib/steam?"
sudo rsync -avzh --remove-source-files --progress /usr/lib/steam ~/.local/lib/ && sudo rmdir /usr/lib/steam/steam_launcher/ && sudo rmdir /usr/lib/steam/ && sudo ln -s /home/deck/.local/lib/steam/ /usr/lib/steam
end
# MOVE signal-desktop
if ask "Move /usr/lib/signal-desktop?"
sudo rsync -avzh --remove-source-files --progress /usr/lib/signal-desktop ~/.local/lib/ && sudo rm -rf /usr/lib/signal-desktop/ && sudo ln -s /home/deck/.local/lib/signal-desktop/ /usr/lib/signal-desktop
end
# MOVE insync
if ask "Move /usr/lib/insync?"
sudo rsync -avzh --remove-source-files --progress /usr/lib/insync ~/.local/lib/ && sudo rm -rf /usr/lib/insync/ && sudo ln -s /home/deck/.local/lib/insync/ /usr/lib/insync
end
# MOVE jvm
if ask "Move /usr/lib/jvm?"
sudo rsync -avzh --remove-source-files --progress /usr/lib/jvm ~/.local/lib/ && sudo rm -rf /usr/lib/jvm/ && sudo ln -s /home/deck/.local/lib/jvm/ /usr/lib/jvm
end
end
end
if ask "Install install-gui-essentials (ghostty, signal, steam)"
# ESSENTIALS GUI & DESKTOP
echo "~/archlinux/install-gui-essentials.csv"
env bash ~/archlinux/install-gui-essentials.csv
if not test "$is_steam" = true
# not available on steamdeck
install \
appimagelauncher-git
else
# APPIMAGELAUNCHER
if ask "Manually install APPIMAGELAUNCHER?"
cd ~/.local/sources/
pikaur -G appimagelauncher-git
cd appimagelauncher-git
sudo pacman -S libxpm lib32-glibc make cmake glib2 cairo librsvg zlib sysprof
makepkg --noconfirm --syncdeps --install --clean
cd ~
end
# 1PASSWORD
if ask "Manually install 1PASSWORD?"
cd ~/.local/sources/
curl -sS https://downloads.1password.com/linux/keys/1password.asc | gpg --import
git clone https://aur.archlinux.org/1password.git
cd 1password && makepkg -si --overwrite "/opt/1Password/*"
cd ~
end
end
end # GUI essentials
if ask "Install ta-lib"
# TA-LIB
cd ~/Downloads \
&& wget http://prdownloads.sourceforge.net/ta-lib/ta-lib-0.4.0-src.tar.gz \
&& tar xvzf ta-lib-0.4.0-src.tar.gz \
&& cd ta-lib \
&& sed -i.bak "s|0.00000001|0.000000000000000001 |g" src/ta_func/ta_utility.h \
&& ./configure --prefix=/usr/local \
&& make \
&& sudo make install \ && cd .. \
&& mv ta-lib/ ~/.local/sources/ta-lib
end
# MANUALLY powerline fonts
if ask "Manually install POWERLINE-FONTS?"
cd ~/Downloads
git clone https://github.com/powerline/fonts.git --depth=1
cd fonts
./install.sh
cd ..
rm -rf fonts
cd ~/Downloads
end
if not test "$is_steam" = true
if ask "Install docker/podman"
# DOCKER/PODMAN
pikaur -S --noconfirm podman catatonit crun
# needed for cgroups
# see: https://wiki.archlinux.org/index.php/Podman
sudo touch /etc/sub{u,g}id
sudo usermod --add-subuids 165536-231072 --add-subgids 165536-231072 $USER
# add dockerhub
echo "[registries.search]
registries = ['docker.io']" | sudo tee -a /etc/containers/registries.conf
# DOCKER-COMPOSE
sudo curl -L https://github.com/docker/compose/releases/download/1.27.4/docker-compose-(uname -s)-(uname -m) -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
# OPEN SHIFT
# Minishift & OC Cli
pikaur -Sy minishift origin-client
# ODO Cli
sudo curl -L https://mirror.openshift.com/pub/openshift-v4/clients/odo/latest/odo-linux-amd64 -o /usr/local/bin/odo
sudo chmod +x /usr/local/bin/odo
# openshift crc
# install `crc` first from here:
# https://access.redhat.com/documentation/en-us/red_hat_codeready_containers/1.20/html/getting_started_guide/using-codeready-containers_gsg
# https://wiki.archlinux.org/index.php/OpenShift#openshift_v4
# # CRC SETUP
# crc setup
# crc start
end
# bluetooth a2dp
# pikaur -Sy pulseaudio-bt-auto-enable-a2dp pulseaudio-bluetooth
# equalizer
# pikaur -Sy pulseeffects
# NVIDIA INTEL HYBRID STUFF
# sudo mhwd -i pci video-hybrid-intel-nvidia-450xx-prime
# pikaur -S cuda vulkan-mesa-layers vulkan-intel lib32-vulkan-intel lib32-amdvlk lib32-nvidia-utils lib32-vulkan-mesa-layers
# sudo mhwd -r pci video-nvidia-455xx
# sudo pikaur -S lib32-opencl-nvidia-455xx opencl-nvidia
# sudo pikaur -S nvidia-dkms-beta vulkan-mesa-layers lib32-vulkan-intel lib32-nvidia-utils-beta lib32-vulkan-mesa-layers
if ask "Install qemu/libwirt"
pikaur -S libvirt qemu qemu-arch-extra
sudo pacman -Syu ebtables dnsmasq
sudo systemctl restart libvirtd
end
# MANUAL/LOCAL BUILDS
# CUSTOM KERNEL
if ask "Install xenomod"
## xenomod
gpg --receive-keys 38DBBDC86092693E
pikaur -S linux-manjaro-xanmod linux-manjaro-xanmod-headers
sudo ln -s /usr/src/linux-manjaro-xanmod /usr/src/linux
end
if ask "Install nvidia-beta driver?"
# install beta, because of DKMS
pikaur -Sy nvidia-beta-dkms xorg-server-devel lib32-nvidia-utils-beta nvidia-settings-beta opencl-nvidia-beta
sudo groupadd plugdev
sudo usermod -aG plugdev $USER
end
end
# chrome-remote-desktop
if ask "Install chrome-remote-desktop?"
cd ~/Downloads
install chrome-remote-desktop
if type -q chrome-remote-desktop-patch
chrome-remote-desktop-patch
else
cp /opt/google/chrome-remote-desktop/chrome-remote-desktop .
patch -i chrome-remote-desktop--use_existing_session.patch chrome-remote-desktop
sudo cp ./chrome-remote-desktop /opt/google/chrome-remote-desktop/chrome-remote-desktop
end
end
# TWEAKS
if not test "$is_steam" = true
if ask "Fix ntfs-3g disk access? on mount as user?"
# fix ntfs-3g disk access on mount as user
sudo usermod -a -G disk $USER
end
if ask "Install system76 scheduler?"
# System76 scheduler
install system76-scheduler-git
sudo systemctl enable --now com.system76.Scheduler.service
end
end
if ask "Increase number of file watchers?"
# increase number of file watcher
echo fs.inotify.max_user_watches=1048576 | sudo tee -a /etc/sysctl.d/50-max_user_watches.conf && sudo touch /etc/sysctl.conf && sudo sysctl -p
end
# fix .ssh
if ask "Fix .ssh/* permissions"
chmod 600 "~/.ssh/*"
end
if ask "Fix moonlander rules?"
# moonlander
sudo ln -s ~/.local/share/50-zsa.rules /etc/udev/rules.d/50-zsa.rules
end
if ask "Fix groups for nordvpn, 1password, docker?"
# nordvpn
sudo groupadd -r nordvpn
sudo systemctl enable --now nordvpnd.service
sudo gpasswd -a $USER nordvpn
# 1password
sudo groupadd onepassword-cli
sudo chown root:onepassword-cli (which op) && sudo chmod g+s (which op)
# DOCKER (REFRESH GROUP)
# needs to be at end, because it sources .bashrc again
# DOCKER
sudo systemctl stop docker
sudo groupadd docker
sudo usermod -aG docker $USER
# Note that docker.service starts the service on boot, whereas docker.socket starts Docker on first usage which can decrease boot times
sudo systemctl enable docker.socket
sudo systemctl start docker
sudo chown (id -u):(id -g) /var/run/docker.sock
# creates newshell
# newgrp docker
end
# DELETE UNNEEDED PACKAGES
if ask "Remove all unneeded packages?"
sudo pacman -Rs (pacman -Qtdq)
end
#
# LAST RESORT KEY DB RESET
# # update mirror-list
# pacman-mirrors -g
# # update keydatabases
# sudo rm -R /etc/pacman.d/gnupg
# sudo rm -R /root/.gnupg
# sudo dirmngr </dev/null
# sudo pacman-key --init
# sudo pacman-key --populate
# sudo pacman -Sy gnupg archlinux-keyring manjaro-keyring
# sudo pacman-key --refresh-keys
# sudo systemctl restart pacman-init
# update databases
# sudo pacman -Fy
# sudo pacman -Syy