Install Manjaro Like A Pro Using CLI
Install Manjaro Like A Pro Using CLI
Install Manjaro Like A Pro Using CLI
This is how you install Manjaro like a pro using the Arch Way.
This guide uses the Manjaro Architect ISO but you can use any Manjaro ISO - just flip to TTY to get that
pro feeling of installing entirely using the terminal.
The guide can also be used to install an Arch Linux - just substitute the arch equivalent (linux or linux-lts,
pacstrap and arch-chroot)
Many of you know Architect - the installer framework originally created by @carlduff back in 2016 to
install ArchLinux® and later modified by @Chrysostomus to install Manjaro’s iso-profiles.
This guide is intended as a reference for basics abstracted by the Architect framework (Steps not
guaranteed to be the same order). The guide can be applied as a virtual machine or hardware.
Overview
1. VirtualBox or Hardware
2. Installation prerquisites
3. Partitioning
4. Formatting
5. Mounting
6. Base installation
7. Base configuration
Vconsole
Locale
Timezone
Clock
Hostname
Sudo
Network
Time sync
Root password
8. Bootloader
Init
Bootloader
9. Conclusion
This guide is a generic guide targeted at UEFI based systems. If you test this using a virtual machine please
use the recommended configuration for Manjaro VM.
2 CPU
2 GB memory
32 GB disk (this guide uses 128G disk)
Enable EFI
Graphics 128MB
For the best result download the most recent Manjaro ISO from OSDN either official or community and
write it to an USB or start a virtual machine with the ISO as selected boot media. To write an ISO to USB
you can use CLI or install the packge mintstick and use USB Image Writer.
2. Installation prerquisites
When you have loaded the system be sure to set the following items.
1. Keyboard
2. System time
3. Branch and mirror
4. Pacman databases and keyrings
5. Trust database (pacman keys)
If you used a GUI ISO you have initially selected your preferred keyboard and you can skip this step.
1. Keyboard
Set keyboard on Architect ISO by using loadkeys followed by a country code e.g. for Denmark
# loadkeys dk
2. System time
Ensure system time is correct - necessary for SSL certificates
You can replace the branch with stable or testing and you can remove the –url argument and use e.g. –
continent for closer mirrors or leave it out for a complete run against all mirrors.
5. Trust database
Create trust database, populate and refresh keys
# pacman-key --init
# pacman-key --populate archlinux manjaro
# pacman-key --refresh-keys
3. Partitioning disk
If you are using a system with multiple disk devices you need to make sure of you are targeting the right
disk, so start with listing your devices. By doing this you will determine which device you want to target for
the installation.
NOTE: All your disk devices will be listed - including your removable devices. Removable devices will have 1
in the RM column of the output.
List the devices using the command lsblk. Depending on your system your output may look like this
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 52.5M 1 loop /run/miso/sfs/livefs
loop0 7:1 0 501.3M 1 loop /run/miso/sfs/rootfs
sda 8:0 0 128G 0 disk
sr0 11:0 1 617.4M 0 rom /run/miso/bootmnt
Partition layout
Depending on your system and the intended use you need to consider making room for swap. Swap space is
a temporary storage location for memory shared by applications. If you are using integrated graphics
(shared system memory) a swap partition of the same size as your RAM will do it.
A Manjaro system can run with a root partition of less than 10G but doing so will require strict dicipline
and maintenance to avoid your system root from running full. A root partition of 20-32G is more than
adequate.
Many experienced users like to setup partitions for different purposes. The only extra I will recommend
here is a partition to hold the home folders.
The partitions can be created by script commands or you can use interactive console programs like fdisk or
cfdisk. The programs is navigated by keys (arrows, letters, enter and esc) or you can script it using sfdisk.
From our example system listing above - our main disk device is labeled sda and for this guide we use
cfdisk.
Note: This command uses the –zero argument to empty the partition table of the selected disk.
object cursor
action cursor
1. EFI or $esp
Select Free space using ↑ or ↓ .
Select New using ← or → → Enter .
300M press Enter .
Select Type → Enter .
Select EFI System → Enter .
2. swap partition.
Select Free space → New → Enter .
Enter size 2G → Enter .
Select Type → Enter .
Select Linux swap → Enter .
3. root partition.
Select Free space → New &rarr Enter .
Enter size 32G → Enter
Select Type → Enter .
Select Linux root (x86_64) → Enter .
4. home partition.
Select Free space → New → Enter .
Enter to assign the remaining space to home.
Select Type → Enter .
Select Linux home → Enter .
5. Save the changes
Select Write → Enter
Input yes when prompted → Enter
Select Quit → Enter
4. Formatting
List your partitions and note that each partition is listed as part of our sda disk device.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 52.5M 1 loop /run/miso/sfs/livefs
loop0 7:1 0 501.3M 1 loop /run/miso/sfs/rootfs
sda 8:0 0 128G 0 disk
├─sda1 8:1 0 300M 0 part
├─sda2 8:2 0 2G 0 part
├─sda3 8:3 0 32G 0 part
└─sda4 8:4 0 93.7G 0 part
sr0 11:0 1 617.4M 0 rom /run/miso/bootmnt
EFI ($esp)
# mkfs.fat -F 32 /dev/sda1
Swap
# mkswap /dev/sda2
Root
# mkfs.ext4 /dev/sda3
Home
# mkfs.ext4 /dev/sda4
5. Mounting
Before we install the base system we need to mount the devices. First we mount the root system - using the
folder /mnt for the temporary mount, then we make folders for /boot/efi and /home.
# lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
loop0 7:0 0 52.5M 1 loop /run/miso/sfs/livefs
loop0 7:1 0 501.3M 1 loop /run/miso/sfs/rootfs
sda 8:0 0 128G 0 disk
├─sda1 8:1 0 300M 0 part /mnt/boot/efi
├─sda2 8:2 0 2G 0 part
├─sda3 8:3 0 32G 0 part /mnt
└─sdc4 8:4 0 93.7G 0 part /mnt/home
sr0 11:0 1 617.4M 0 rom /run/miso/bootmnt
6. Base installation
When your folder structure and mounts are in place you install the base system into the new partitions.
And let’s kick in a text mode web browser - just for the fun of it - links - it works everywhere :slight_smile: -
easy to check out network connection.
Use basestrap command to install a base set of packages into the newly mounted root
# basestrap /mnt base linux53 dhcpcd networkmanager grub mkinitcpio efibootmgr vi nano sudo links
7. Base configuration
Next thing is to configure the system in a chrooted environment. The tasks to be performed creating the
necessary configurations for you new system. We will use bash as shell.
Console keyboard
KEYMAP=dk
FONT=
FONT_MAP=
Locale
To generate the messages edit /etc/locale.gen and remove the comment for locale(s) to be generated (UTF-
8 is the recommend choice).
Select locale
Example for a system in Denmark using english messages
...
#en_CA ISO-8859-1
en_DK.UTF-8 UTF-8
#en_DK ISO-8869-1
...
# locale-gen
locale.conf
Edit your locale configuration in /etc/locale.conf to match above choice - example for Denmark
LANG=en_DK.UTF8
Timezone
Set the time zone for location (the available zones is listed in /usr/share/zoneinfo/ using the
Continent/Capitol format).
Clock
Linux clock runs using the timezone info and UTC time.
Hostname
Set hostname
Hosts configuration
# nano /etc/hosts
127.0.0.1 localhost
::1 localhost
127.0.1.1 manjaro.localdomain manjaro
Note: If the system has a static IP replace 127.0.1.1 with the IP.
System administration
Allow members of the wheel group to perform administrative tasks.
Run visudo
# visudo
Locate the line reading # %wheel ALL=(ALL) ALL and remove the # in the beginning of the line
Network
Time syncronization
Root password
# passwd
8. Bootloader
Initramfs
Build the initramfs according to your chosen kernel e.g. linux53
# mkinitcpio -p linux53
Bootloader
# grub-mkconfig -o /boot/grub/grub.cfg
9. Conclusion
Close chroot
# exit
# umount -R /mnt
# reboot
$ links manjaro.org
Variations