I alway put my chroots in / for shorter paths For example: /arch
sudo mkdir /arch
cd /arch
Go to https://archlinux.org/download/ then select and open a mirror close to you
Download a file named archlinux-bootstrap-x86_64.tar.gz
For example: bootstrap from a Dutch server: http://arch.mirrors.lavatech.top/iso/2022.12.01/archlinux-bootstrap-x86_64.tar.gz
sudo tar xpvf archlinux-bootstrap-x86_64.tar.gz --xattrs-include='*.*' --numeric-owner
All mirrors are commented out by default. We have to select a mirror server that works best for us. Ideally, select a mirror that is in your own country.
For example: Uncomment 3 first mirrors from France
sudo nano root.x86_64/etc/pacman.d/mirrorlist
There are some settings we need to change in order for pacman to work in our chroot.
sudo nano root.x86_64/etc/pacman.conf
uncomment Color
comment CheckSpace
uncomment ParallelDownloads and set it to your liking (I set it to 20)
CheckSpace must be uncommented in a chroot because of this: error: could not determine cachedir mount point /var/cache/pacman/pkg error: failed to commit transaction (not enough free disk space)
cd $HOME
mkdir bin
cd bin
nano arch-start
#!/bin/bash
xhost +local:
sudo mount -t proc none /arch/root.x86_64/proc
sudo mount -t sysfs none /arch/root.x86_64/sys
sudo mount --rbind /dev /arch/root.x86_64/dev
sudo mount --rbind /run /arch/root.x86_64/run
sudo cp /etc/resolv.conf /arch/root.x86_64/etc/resolv.conf
sudo chroot /arch/root.x86_64 /bin/bash
In order to have a working internet connection, we have to copy resolv.conf to our chroot.
Let's just copy it every time we start our chroot.
xhost is needed in case you want to run a GUI application from within your chroot.
chmod +x arch-start
Add $HOME/bin to your PATH
nano $HOME/.bashrc
PATH=/home/your_username/bin:$PATH
You are able to type arch-start
in your terminal and you will automatically mount all needed folders and chroot into Arch.
From within the chroot:
pacman-key --init
pacman-key --populate
pacman -Syyuu
pacman -S neofetch nano sudo python3 python-pip xorg git base-devel wget yajl gradle jdk17-openjdk jdk8-openjdk
After everything above is installed:
pip install setuptools
useradd -m -s /bin/bash username
(set the password)
passwd username
nano +83 /etc/sudoers
add: username ALL=(ALL:ALL) ALL
su username
( https://www.tecmint.com/install-yaourt-in-arch-linux/ )
mkdir $HOME/git
cd $HOME/git
git clone https://aur.archlinux.org/package-query.git
cd package-query
makepkg -si && cd ..
git clone https://aur.archlinux.org/yaourt.git
cd yaourt
makepkg -si
https://gist.github.com/dianjuar/a86814b592dad96cfa9d9540cb5acbe0
yaourt android-sdk-platform-tools
yaourt android-udev
yaourt android-sdk
sudo chmod -R 777 /opt/android-sdk
On ~/.bashrc of you are using bash or ~/.zshrc if you are using zsh in the last line put
export ANDROID_HOME=/opt/android-sdk
export PATH=$PATH:$ANDROID_HOME/tools
export PATH=$PATH:$ANDROID_HOME/platform-tools
type
source $HOME/.bashrc
sudo archlinux-java set java-8-openjdk
This is needed to accept licenses.
( https://github.com/iNPUTmice/Conversations/issues/4252 )
go to $ANDROID_HOME/tools/bin/
Either do:
./sdkmanager --licenses
and accept all licenses or do:
yes | ./sdkmanager --licenses
to accept all licenses
sudo archlinux-java set java-17-openjdk
cd $HOME
cd git
git clone https://codeberg.org/iNPUTmice/Conversations.git
cd Conversations
./gradlew assembleConversationsFree
WARNING! Do not just rm -rf your chroot!
There are still mounted files!!!!!
Before deleting your chroot, best thing to do is to reboot your whole machine to make sure there's nothing mounted.
Optional:
sudo pacman -S scrcpy
sudo adb start-server
scrcpy &
adb install build/outputs/apk/conversationsFree/debug/Conversations....
sudo adb kill-server