How to install Arch Linux

Today I’m going to instruct you through the steps of installing your own Arch Linux system.

Download the ISO

You can find the downloads for Arch Linux by clicking here.

1. Partition the drive

Determine your drive name by running lsblk. Run the following command to start the partitioning (with /dev/sda replaced by your drive):

# fdisk /dev/sda
  1. Enter n to create a new partition.
  2. Press Enter on the following prompts to accept the defaults.
  3. Enter w to write your changes to the disk.

2. Create the File System and mount it

Next, you need to create a filesystem on the partition that you’ve made. After you’ve created the filesystem, you can mount it.

# mkfs.ext4 /dev/sda1
# mount -t ext4 /dev/sda1 /mnt

3. Install Arch Linux system

This is maybe the most important step in the progress. This is the step where you are actually installing the system. For that, you need to run pacstrap followed by the packages you want to install. In this case, we’ll install base and grub for the bootloader.

# pacstrap -i /mnt base grub

4. Generate File System Tab

The file fstab contains descriptive information about the filesystems the system can mount.

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

5. Enter the system via chroot

Now, we’re ready to set up the system by going inside it. For this, we’ll be running arch-chroot. Do NOT reboot at this stage!

# arch-chroot /mnt /bin/bash

6. Setting up locales

Locales are basically the language files your system will be using.

# nano /etc/locale.gen
Uncomment line en_US.UTF-8 UTF-8
Uncomment line en_US ISO-8859-1

(uncomment by removing the # in front)

After that, you have to generate the locale files.

# locale-gen

And then put them into effect on the system.

# echo LANG=en_US.UTF-8 > /etc/locale.conf
# export LANG=en_US.UTF-8

7. Setting the timezone

All timezone files can be found in /usr/share/zoneinfo/. You need to create a link to /etc/localtime with the timezone you want.

# ln -s /usr/share/zoneinfo/LOCATION/CITY /etc/localtime

8. Set the hardware clock

This command sets the hardware clock from system time. --utc implies that your hardware clock is in the UTC timezone. More information here

# hwclock --systohc --utc

9. Set your system’s hostname

This can be anything you want.

# echo "my-computer" > /etc/hostname

10. Set up simple networking

Before you do the following, please run ip a to determine your interface. It’s generally called eth0, but it may be different on some machines.

  1. Copy the example

    # cp /etc/netctl/examples/ethernet-dhcp /etc/netctl/my_network
  2. Modify the interface name

    # nano /etc/netctl/my_network
    Replace the "Interface=eth0" line with the one shown by the "ip a" command.
  3. Enable the network

    # netctl enable my_network

Setting a password on your root user is highly recommended. You can do that now by running passwd

12. Install the boot loader (grub)

You can find information on how to install GRUB on various systems on the Arch Linux Wiki. The following is a simple installation on a system with a BIOS (not UEFI). You can find more boot loaders here.

# grub-install --recheck /dev/sda
# grub-mkconfig -o /boot/grub/grub.cfg

13. Reboot the machine

You are now ready to boot into your new system.

# exit
# umount /mnt
# shutdown

After shutting down, remove the disk image and boot the system again. You can now use your newly installed system!

More things to do

Creating an user account

The first user you create should also be added to the wheel group. This will be kind of like an administrator.

# useradd -m -G wheel -s /bin/bash usernamehere
# passwd usernamehere

For creating other users, you should omit the -G wheel part unless you want them to be able to use sudo.

Enabling sudo

  1. Install sudo - # pacman -S sudo
  2. Create a file in /etc/sudoers.d/99-wheel with the following lines:
    %wheel ALL=(ALL) ALL

If you want the wheel group to be able to use sudo without password, you can replace the last ALL with NOPASSWD: ALL.

Installing a Desktop Environment

Firstly, you should install xorg packages.

# pacman -S xorg-server xorg-xinit xorg-server-utils mesa xterm

For graphics drivers, you can look at the wiki: Intel, ATI, AMD and NVIDIA.

You can find packages for various desktop environments here.

Install lightdm

Some desktop environments don’t have a system to log you in to a session. This is where lightdm comes to play.

# pacman -S lightdm lightdm-gtk-greeter
# systemctl enable lightdm.service

You can find lightdm configuration at /etc/lightdm/lightdm.conf.

After you’ve installed what you want, you can reboot the system and it should either load up the desktop environment or the lightdm-gtk-greeter, which will allow you to select a desktop environment to log in to.

Keeping your system up-to-date

You should keep your system up-to-date to get the latest packages and security patches. Arch Linux is a rolling release distribution, meaning that you don’t have to reinstall the entire system and package updates are rolled separately instead of in bundles.

# pacman -Syu

This command synchronizes your system with the latest repositories and installs all available updates.

That’s it!

This should be your basic Arch Linux system ready to go! Always remember that the Arch Linux Wiki is a great place to find help for all things Linux, not just Arch!

Giving a shot at making a game using Godot Engine 3.0

In the past week, I’ve been working on a simple 3D game using Godot Engine 3.0 (go-doh). In this article, I will show off some of the features and discuss how it all works. Here’s a quick demo of the gameplay:


Block breaking

Blocks can be broken by just clicking on a tile of the chunk. The speed of the breaking and the damage dealt to the tile depend on the current pickaxe. Pickaxes can be upgraded in the Shop GUI. Pickaxes also have a durability value, which will always be kept at maximum when you’re on the surface. The current pickaxe along with it’s durability is displayed in the bottom right corner of the screen. When your pickaxe “breaks”, you will stop mining and you won’t be able to start mining until you repair it or return to the surface.


Blocks can also be broken using bombs. By placing a bomb, it takes approximately 3 seconds to detonate and it damages blocks in a 4 tile radius. Tougher blocks located deeper in the mine wont be broken by a bomb, instead made softer and thus they will take less time to mine with a pickaxe. When a bomb blows up tiles, you won’t get them in your inventory.


In the shop GUI, you can sell your mined blocks for money or buy items like torches, bombs and better pickaxes. Money can only be earned by selling the blocks you’ve mined.


This is the list of minerals currently generated in the chunk and their yield when sold:

  • Copper - $15
  • Iron - $20
  • Silver - $50
  • Gold - $100
  • Amethyst - $250
  • Emerald - $300
  • Sapphire - $400
  • Ruby - $500
  • Diamond - $1000
  • Flawless Diamond - $2500 (rarest)

Note that all of these are not guaranteed to generate. It depends on the random seed and the y value.


Godot uses Scenes, which can be easily instanced. The following image is the Godot editor, in it I have opened the root scene, which will be the point where the game runs.
Root Scene
On the right, you can see the scene tree.

  • Root - This is the first node in the scene, containing everything.
  • WorldEnvironment - Controls the overall look of the scene. I have configured it to give me a completely black scene without a background.
  • All of my other custom scenes follow these.

The Chunk

The Chunk is a MeshInstance which I use to generate a random mine with. I’ve attached a script to this node which generates a mesh and assigns it to the MeshInstance.
Using SurfaceTool, you can create geometry by specifying the vertices individually.

# Create a new SurfaceTool instance
var st =

# Begin specifying your vertices using primitive type of triangles. Every 3 vertices is a triangle.

# Half of a quad



# Output the mesh
var mesh = st.commit()

This is just a basic example of what you can do with SurfaceTool, but as you can see, it’s a great way to create procedural geometry. Alongside this I use some code to decide which material to use for which tile and the ability to regenerate the mesh when a tile is changed.

The Player

The player is currently just a simple CapsuleMesh with a camera, a light, some raycasts and some sounds attached to it.

Player Scene
The script attached to it deals with KinematicBody movement and the block break animation. The RayCasts are used to determine whether the player is colliding with the chunk or not. The RayCast pointing up is used to cancel the jump when player hits a tile from below.


GUI Scene
GUI in Godot is created using the Control class and it’s inherited classes.
In the GUI scene I have a simple ItemList inventory and a few other items. The main thing the GUI does is the shop: buy and sell system.

The Shop Dialog

On the righthand side, there are two image buttons that spawn an instance of another scene and translate it to the player’s current position. These two buttons are Bomb and Torch, which “place” their respective item.

# Load the scene
var scene = load("res://scene/props/bomb.tscn")

# Get the root instance of the scene, in this case it's a Spatial
var node = scene.instance()

# Translate the Spatial
node.set_translation(Vector3(x, y, z))

# Add it to the Root scene


This scene generates 4 quads that cover the chunk. These prevent the player from walking off of the chunk or falling out the bottom.


This scene generates a quad that has a variable texture. This scene is used to display the breaking animation of a tile, by translating it to the currently “broken” tile and setting the Texture of the material to one of the 6 crack textures.
The 6 textures used to represent the tile breaking

The Source

The source of this project is available on my GitHub account. I’ve laid out the scenes, scripts, etc. into a nice folder structure so you can easily see where the things are located. I recommend you do the same when you’re making a game in Godot. If you want to try the game yourself, you can clone or download the repository onto your computer and Import it in the project list of the editor. Downloads are not currently available as the game is still in development, but you can easily export them in the editor.


I think that Godot is a really great game engine. It lets you do amazing things quite easily. The community is also very helpful and the documentation is good enough for you to get started. This game still needs work for it to be enjoyable, but it’s been quite fun getting this far and I thought I’d share it with you.

Welcome to my blog!

So, I’ve decided to start a new blog using Hexo.
I’ll probably be using this to share my projects and write some tutorials.

Current projects

I’m currently taking a break from writing code due to personal reasons, but I’m mainly working on my network, Icy Network. The main project in the works is Episodes.Community, which is basically a site where people can watch and share links to their favorite TV shows and cartoons.