Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Teach you how to install Arch Linux step by step

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces the step-by-step teaching you how to install Arch Linux, has a certain reference value, interested friends can refer to the next, I hope you read this article after a great harvest, the following let Xiaobian take you to understand.

Arch Linux is an x86-64 general purpose distribution popular with DIY Linux users and hardcore Linux fans. The default installation file contains only a basic system, and it expects users to configure and use Arch themselves. Based on the KISS principle (Keep It Simple, Stupid!), Arch Linux is a system focused on elegance, code correctness, simplicity and simplicity.

Arch supports rolling release mode and has its own package manager, pacman. In order to provide a cutting-edge operating system, Arch will never miss a single source. In fact, it provides a minimal base operating system that allows you to install Arch on low-end hardware and install only the software packages you need.

It is also one of the best operating systems to learn Linux from scratch. If you want to experience it yourself in the DIY spirit, you should try Arch Linux. This is seen by many Linux users as the core of the Linux experience.

How to install Arch Linux

The installation method discussed here is to remove the existing operating system completely from your computer and install Arch Linux on it. If you want to follow this tutorial to install Arch, make sure you have backed up all your files or you will lose them. Cut it.

Before you install Arch from USB, make sure you have met the following conditions:

Conditions for installing Arch Linux:

A machine compatible with x86_64 (e.g. 64 bit)

Minimum 512 MB memory (2GB recommended)

Minimum of 1GB free disk space (20GB recommended for daily use)

can access the internet

USB memory with at least 2GB of storage

Familiarity with Linux command line

Once you have confirmed that all conditions are met, you can start installing Arch Linux.

*** Step: Download ISO file

You can download ISO from the website. Arch Linux installation requires a machine with at least 512 MB of RAM and 800 MB of disk space and x86_64 (e.g. 64-bit) compatibility. However, it is recommended that you have at least 2 gigabytes of memory and 20 gigabytes of disk space so you don't have trouble installing your desktop environment.

Step 2: Create an Arch Linux field USB drive

We need to create a live USB drive for Arch Linux using the ISO file you just downloaded.

If you are using Linux, you can create a live USB memory with dd command. Remember to change/path/to/archlinux.iso in the example below to the actual storage location of your ISO file and/dev/sdx to your disk device number (e.g./dev/sdb). You can learn about your device by using the lsblk command.

dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress && sync

Under Windows, there are several ways to create a live version of USB memory. The recommended tool is Rufus. We've already had a tutorial on how to use this tool to create Antergos Live USB memory. Because the Antergos distribution is based on Arc h, you can use the same tutorial.

Step 3: Boot from the Field USB Memory

Once you have created Arch Linux Live USB drive, shut down your computer. Plug in your USB drive and boot up the system. At boot, press F2, F10, or F1 (depending on your computer model) to access boot settings. Here, select the item "Boot from USB memory or removable device."

Once you select it, you'll see an option like this:

Arch Linux

Select Boot Arch Linux (x86_64). After various system checks, Arch Linux boots to the root user's command line interface.

The next steps include partitioning the disk, creating the file system, and mounting it.

Step 4: Disk Partitioning

*** Step is to partition your hard disk. A single root partition is the simplest, just create the root (/) partition, swap partition, and home partition on top of it.

I have a 19 gigabyte hard drive and I want to install Arch Linux here. To create a partition, enter:

fdisk /dev/sda

Press n to create a new partition. Press p to create the primary partition, and then select the partition number.

*** Sectors will be selected automatically, you just press Enter. When determining *** a sector of a partition, enter the size of the partition.

Create two partitions in the same way for the home and swap partitions, press w to save the changes and exit.

root partition

Step 4: Create a file system

Since we already have three partitions, the next step is to create a file system to format the partitions.

We create file systems on the root and home partitions with the mkfs command, and swap partitions with mkswap. We format the disk with ext4 file system.

mkfs.ext4 /dev/sda1mkfs.ext4 /dev/sda3 mkswap /dev/sda2swapon /dev/sda2

Mount these partitions under the root and home partitions:

mount /dev/sda1/mntmkdir /mnt/homemount /dev/sda3/mnt/homeStep 5: Install

We have created and mounted partitions and started installing the most basic packages. The basic package includes all the packages necessary for the system to run. For example, GNU BASH shell, file compression tools, file system management tools, C language library, compression tools, Linux kernel and its modules, class libraries, system tools, USB device tools, Vi text editor, etc.

pacstrap /mnt base base-devel Step 6: Configure the system

Generate an fstab file that specifies how disk partitions, block devices, or remote file systems are mounted into the file system.

genfstab -U /mnt >> /mnt/etc/fstab

Enter the chroot environment so that you can switch the current root directory for the current process and its children.

arch-chroot /mnt

Some systemd tools that need to remain connected to the data bus cannot be used in chroot environments, so you need to exit from the current environment. To exit chroot, use the following command:

exit Step 7: Set Time Zone

Set the time zone with this command:

ln -sf /usr/share/// /etc/localtime

For a list of time zones, enter:

ls /usr/share/zoneinfo

Set the hardware clock with the hwclock command:

hwclock --systohc --utc Step 8: Set Region

The file/etc/locale.gen contains all locale and system language settings in comments. Open it with Vi and remove the comments before the language you want to select. I chose en_GB. UTF-8.

Now generate a configuration file for the locale in the/etc folder using the following command:

locale-genecho LANG=en_GB. UTF-8> /etc/locale.confexport LANG=en_GB. UTF-8 Step 9: Install bootloader, set hostname and root password

Create the/etc/hostname file and add a corresponding hostname:

127.0.1.1 myhostname.localdomain myhostname

I added ItsFossArch as my hostname:

echo ItsFossArch > /etc/hostname

Then add it to/etc/hosts as well

To install bootloader use the following command:

pacman -S grubgrub-install /dev/sdagrub-mkconfig -o /boot/grub/grub.cfg

To create a root password, enter:

passwd

Enter the password you want.

When you're done, update your system. But it is very likely that your system is already ***, because you downloaded *** ISO.

pacman -Syu

Congratulations! You have installed the command line version of Arch Linux.

Next, we'll learn how to set up and install a desktop environment for Arch. I love the GNOME desktop environment, so I chose it here.

Step 10: Install Desktop (GNOME in this case)

Before you install desktop, you need to set up network.

You can see your port with the following command:

ip link

On my computer, the port name is enp0s3.

Add the following paragraph to the document:

vi /etc/systemd/network/enp0s3.network [Match]name=en*[Network]DHCP=yes

Save and exit. Restart the network to apply your changes.

systemctl restart systemd-networkdsystemctl enable systemd-networkd

Add the following two sentences to/etc/resolv.conf

nameserver 8.8.8.8nameserver 8.8.4.4

The next step is to install the X environment.

Enter the command below to install Xorg and use it as a display server.

pacman -S xorg xorg-server

gnome contains the basic GNOME desktop, gnome-extra contains GNOME applications, archive manager, disk manager, text editor and other applications.

pacman -S gnome gnome-extra

*** One step is to open the GDM Display Manager on Arch.

systemctl start gdm.servicesystemctl enable gdm.service

Restart your system and you will see the GNOME login screen.

Thank you for reading this article carefully. I hope that the article "Teach you how to install Arch Linux step by step" shared by Xiaobian will be helpful to everyone. At the same time, I hope that everyone will support you a lot and pay attention to the industry information channel. More relevant knowledge is waiting for you to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report