{"id":26076789,"url":"https://github.com/amirk1998/arch-linux-installation","last_synced_at":"2025-12-07T11:03:40.474Z","repository":{"id":191792199,"uuid":"685405065","full_name":"amirk1998/Arch-Linux-Installation","owner":"amirk1998","description":"A tutorial for Arch Linux Installation","archived":false,"fork":false,"pushed_at":"2023-08-31T07:09:00.000Z","size":130,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T02:33:40.381Z","etag":null,"topics":["arch-linux","archlinux","linux","linux-kernel","pacman","shell","tutorial"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/amirk1998.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-08-31T06:45:10.000Z","updated_at":"2023-08-31T07:05:28.000Z","dependencies_parsed_at":"2023-08-31T19:24:18.842Z","dependency_job_id":null,"html_url":"https://github.com/amirk1998/Arch-Linux-Installation","commit_stats":null,"previous_names":["amirk1998/arch-linux-installation"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/amirk1998/Arch-Linux-Installation","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirk1998%2FArch-Linux-Installation","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirk1998%2FArch-Linux-Installation/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirk1998%2FArch-Linux-Installation/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirk1998%2FArch-Linux-Installation/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amirk1998","download_url":"https://codeload.github.com/amirk1998/Arch-Linux-Installation/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirk1998%2FArch-Linux-Installation/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27567215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-12-07T02:00:07.896Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arch-linux","archlinux","linux","linux-kernel","pacman","shell","tutorial"],"created_at":"2025-03-09T02:33:42.851Z","updated_at":"2025-12-07T11:03:40.457Z","avatar_url":"https://github.com/amirk1998.png","language":null,"readme":"# Arch Linux Installation as a Virtual Machine\n\n1) First set boot to UEFI\n   \n   ![UEFI](./01.png \"UEFI\")\n\nwe can verify the boot using the following command\n\n```bash\nls /sys/firmware/efi/efivars\n```\n\n2) Set a good font for high resolution screens\n\n```bash\nsetfont ter-132b\n```\n\n3) Then Set password for root user to able to connect through SSH using Termianl\n\n```bash\npasswd\n```\n\n4) Connect to the Arch Live using SSH\n\n```bash\nssh root@IP\n```\n\n5) Ping to ensure network works fine\n\n```bash\nping -c 3 archlinux.org\n```\n\n6) Set Time and date to ensure work correctly\n\n```bash\ntimedatectl set-ntp true\n```\n\n```bash\ntimedatectl status\n```\n\n7) Then see what partitions do we have\n\n```bash\nlsblk\n```\n\nAlso we can use this command \n\n```bash\nfdisk -l\n```\n\nImagine that the partition we want to create on `/dev/sda`\n\n8) Now we start the partitioning \n\n```bash\ncfdisk /dev/sda\n```\n\n![Cfdisk](./02.jpg \"cfdisk\")\n\nwe use GPT for UEFI boot .\n\nNow we want 3 partitions\n\n- `/dev/sda1`   # choose 512Mb of space (UEFI)\n- `/dev/sda2`  # choose 2GB to 4GB for Swap (Swap)\n- `/dev/sda3`   # choose at least 10 GB of space (root)\n\n![Partition](./03.png)\n\nThe first partition is the UEFI partition. It needs to be formatted with a FAT file system:\n\n```bash\nmkfs.fat -F32 /dev/sda1\n```\n\nFor Swap Partition we use this command to format:\n\n```bash\nmkswap /dev/sda2\n```\n\nAnd then use this command to mount the swap partition:\n\n```bash\nswapon /dev/sda2\n```\n\nFor root partition we use this command to format :\n\n```bash\nmkfs.ext4 /dev/sda3\n```\n\n8-A)  **[OPTIONAL]** ****Configure the Mirrors****\n\nThe installer comes with Reflector, a Python script written for retrieving the latest mirror list the [Arch Linux Mirror Status](https://archlinux.org/mirrors/status/) page. To print out the latest mirror list, simply execute the following command:\n\n```bash\nreflector\n```\n\nIf you have a slow internet connection, you may encounter an error message as follows:\n\n```bash\nfailed to rate http(s) download (https://arch.jensgutermuth.de/community/os/x86_64/community.db): Download timed out after 5 second(s).\n```\n\nThis happens when the default timeout (5 seconds) is lower than the actual time it's taking to download the information.\n\nYou can remedy to this problem by using the `--download-timeout` option:\n\n```bash\nreflector --download-timeout 60\n```\n\nNow reflector will wait for a whole minute before starting to scream. A long list of mirrors should show up on your screen:\n\nGoing through the entire list to find nearby mirrors would be a pain. That's why reflector can do that for you.\n\nReflector can generate a list of mirrors based on a plethora of given constraints. For example, I want a list of mirrors that were synchronized within the last 12 hours and that are located either in India or Singapore (these two are closest to my location), and sort the mirrors by download speed.\n\nTurns out, reflector can do that:\n\n```bash\nreflector --download-timeout 60 --country Germany --age 12 --protocol https --sort rate\n```\n\nPrinting out a mirror list like this is not enough. You'll have to persist the list in the `/etc/pacman.d/mirrorlist` location. Pacman, the default package manager for Arch Linux, uses this file to learn about the mirrors.\n\nBefore overwriting the default mirror list, make a copy of it:\n\n```bash\ncp /etc/pacman.d/mirrorlist /etc/pacman.d/mirrorlist.bak\n```\n\nNow execute the reflector command with the `--save` option as follows:\n\n```bash\nreflector --download-timeout 60 --country Germany --age 12 --protocol https --sort rate --save /etc/pacman.d/mirrorlist\n```\n\nSource : \n\n[The Arch Linux Handbook – Learn Arch Linux for Beginners](https://www.freecodecamp.org/news/how-to-install-arch-linux/)\n\n9) **Install Arch Linux**\n\nFirst, sync the Pacman repository so that you can download and install any software:\n\n```bash\npacman -Syy\n```\n\nNow that you've created and formatted your partitions, you're ready mount them. You can use the mount command with appropriate mount points to mount any partition:\nWe must mount the root partition (“`/dev/sda3`“) to the “`/mnt`” directory before we can perform any installation.\n\n```bash\n# mount \u003cdevice\u003e \u003cmount point\u003e\n\nmount /dev/sda3 /mnt\n```\n\nWith root mounted, it’s time to install all the necessary packages. Use the pacstrap command to install Arch Linux required packages:\n\n```bash\npacstrap -K /mnt base linux linux-firmware sudo nano vim\n```\n\n10) **Configure the Installed Arch System**\n\nAfter the installation completes, generate a “*`/etc/fstab`*” file for your new Arch Linux system by issuing the following command:\n\n```bash\ngenfstab -U /mnt \u003e\u003e /mnt/etc/fstab\n```\n\nNow that we have installed Arch Linux, we need to switch to the physically installed root partition using the `**arch-chroot**` command.\n\n```bash\narch-chroot /mnt\n```\n\n****Set Time Zone****\n\nNext, let’s configure the timezone. To find your timezone, you can list (`ls -l`) the contents of the “*`/usr/share/zoneinfo/`*” directory.\n\nFind your preferred timezone (“*`/usr/share/zoneinfo/Zone/SubZone`*“) where “*`Zone/SubZone`*” is your selection, such as “*`America/New_York`*,” “*`Europe/Paris`*,” “*`Asia/Bangkok*,`” and so on. You got the idea.\nFor example we choose “ `Asia/Tehran` ”\n\n```bash\nln -sf /usr/share/zoneinfo/Asia/Tehran /etc/localtime\n```\n\n**Set Locale**\n\nNow we need to set up the locale. The file “*`/etc/locale.gen`*” contains locale settings and system languages and is commented on by default. We must open this file using a text editor and uncomment the line which contains the desired locale.\n\n```bash\nvim /etc/locale.gen\n```\n\nUncomnent “*`en_US.UTF-8 UTF-8`*” and “*`en_US ISO-8859-1`*” (by removing the “*#*” sign), and any other needed locales in “*`/etc/locale.gen`*.” Then, press “*Ctrl+O*” followed by “*Enter*” to save, and finally, “*Ctrl+X*” to exit the editor.\n\n![locale.gen](./04.png \"locale.gen\")\n\nvim /etc/hosts\n\nNow generate the locale config file using the below commands one by one:\n\n```bash\nlocale-gen\n```\n\nRun the command below to synchronize the hardware clock, automatically creating a “*`/etc/adjtime`*” file containing descriptive information about the hardware mode clock setting and clock drift factor.\n\n```bash\nhwclock --systohc\n```\n\nNow we will move ahead and [set the hostname](https://linuxiac.com/change-hostname-linux/). A hostname is the computer’s name. So let’s name it, for example, “`archvbox`”. Use the following command:\n\n```bash\necho archvbox \u003e /etc/hostname\n```\n\nAdd this name to the “*`/etc/hosts`*” file also. Edit the file with Nano editor and add the following lines (replace “`archvbox`” with the hostname you chose earlier).\n\n```bash\nvim /etc/hosts\n```\n\n```bash\n127.0.0.1      localhost\n::1            localhost\n127.0.1.1      archvbox.localdomain   archvbox\n```\n\nRemember to set the password for the root account using the `passwd` command:\n\n```bash\npasswd\n```\n\n**Create User**\n\nNow we create new user (Change `USER_NAME` ):\n\n```bash\nuseradd -m USER_NAME\n```\n\nAnd then set password for this user\n\n```bash\npasswd USER_NAME\n```\n\nAnd then add user to the wheel group\n\n```bash\nusermod -aG wheel,audio,video,optical,storage USER_NAME\n```\n\nFinally, you'll have to enable `sudo` privilege for this new user. To do so, open the `/etc/sudoers` file using nano. Once open, locate the following line and uncomment it:\n\n```bash\nvisudo\n```\n\nAnd then uncomment this line :\n\n```bash\n%wheel ALL=(ALL) ALL\n```\n\n11 ) **Install GRUB Bootloader on Arch Linux**\n\nNow we install the boot loader for Arch to boot up after restart. The default boot loader for Linux distributions and Arch Linux also is represented by the GRUB package.\n\nInstall the GRUB bootloader and EFI boot manager packages:\n\n```bash\npacman -S grub efibootmgr os-prober dosfstools mtools\n```\n\nThen create the mount point for “*`/dev/sda1`*” and mount it.\n\n```bash\nmkdir /boot/EFI\nmount /dev/sda1 /boot/EFI\n```\n\nNow let’s install our boot loader.\n\n```bash\ngrub-install --target=x86_64-efi --bootloader-id=grub_uefi --recheck\n```\n\n```bash\n# Output\n# Installing for x86_64-efi platform.\n# Installation finished. No error reported.\n```\n\nFinally, generate the “*`/boot/grub/grub.cfg`*” file.\n\n```bash\ngrub-mkconfig -o /boot/grub/grub.cfg\n```\n\n12) ****Configure the Network Manager****\n\nConfiguring a network manually in any Linux distribution can be tricky. That's why I advised you to install the `networkmanager` package during the system installation. If you did as I said, you're good to go. Otherwise, use `pacman` to install the package now:\n\n```bash\npacman -S networkmanager vim git\n```\n\n```bash\nsystemctl enable NetworkManager\nsystemctl status NetworkManager\n```\n\n13) **Final Step**\n\nFirst we should exit from chroot\n\n```bash\nexit\n```\n\nThen unmount `/mnt`\n\n```bash\numount -R /mnt\n```\n\nAnd reboot\n\n```bash\nreboot\n```\n\n14) **[OPTIONAL] X-Org Configuration**\n\n****Install X window system and audio****\n\nOur Arch Linux currently contains only the essential software packages needed to manage the system from the command line, with no GUI (Graphical User Interface).\n\nArch Linux supports a wide range of desktop environments. I will install GNOME as a desktop environment example.\n\nThe first step is to install the X environment. Type the below command to install the Xorg as a display server.\n\n```bash\npacman -S xorg-server xorg-apps\n```\n\nOr\n\n```bash\npacman -S pulseaudio pulseaudio-alsa xorg xorg-xinit xorg-server\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirk1998%2Farch-linux-installation","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famirk1998%2Farch-linux-installation","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirk1998%2Farch-linux-installation/lists"}