Chowhowse.com

Home

Arch Linux Re-Installation - Part 1

January 15, 2019


I use GNU/Linux as a daily driver on all of my home PCs. My main two computers are a Lenovo laptop that I put Ubuntu 18.04 on, and a custom-built PC that I have Arch Linux on. I installed Arch for the first time about a year ago, and I managed to do decently well with it as my main distro. However, due to a few mistakes I made over time, it became clear to me that a reinstall of my Arch system was becoming increasingly necessary. The main issue I had stemmed from an early mistake I made. Shortly after installing my system for the first time, I installed Python and the pip package manager. Pip can download and set up Python libraries and packages for you. However, I misused it out of ignorance (I have since learned the correct way to do it) and ended up installing some Python packages in a way that conflicted with Arch's built-in pacman package management utility. At first there were no major issues, but successive updates worsened the problem to the point where, eventually, I could no longer fully update my system due to package conflicts. After trying to manually fix the problem for a while, I finally decided that I would just do a total system reinstallation and do things right from the beginning.


I backed up all my data and got to work reinstalling the system. This was made a bit more difficult by the fact that it had been about a year since my last install, so I had forgotten a lot of steps. Using the Arch Wiki and some other sites, I managed to work my way through the install process, but the whole time I was kicking myself for not making notes of what I had done the first time through.


That is what this series of articles will be: a walthrough of my installation of Arch Linux. It is mostly for my benefit, and will stop at the point where I begin to set up my windowing environment. However, I figured it might be of use to someone else out there, so here it is on the Internet!


The Bootable Thumbdrive

My first step was to create a bootable USB thumbdrive containing a recent version of the Arch Linux ISO. I did this using the 'dd' command, using my current Arch install (NOTE - it is important to make sure the drive you are writing to is unmounted):


dd bs=4M if=[PATH TO ISO] of=[PATH TO USB DEVICE FILE] status=progress


After this process finishes, run the 'sync' command.


sync


This will result in a working, bootable USB drive containing Arch Linux. The next step is to boot up into this drive and test it.


Setting Up Networking

I plugged in the USB and booted to my BIOS to set the boot order, then loaded up into the live disk. It worked OK, however, I did not have functioning internet access. I have an Android phone that is tethered via USB to my PC, and that is the source of my internet connection. For some reason, the phone does not report a correct and usable MAC address to the OS, which prevents me from using the device that appears as a network interface.


You may have a different, more traditional Internet setup, such as a wired connection to a router or modem. If you have the same setup as me and experience this issue, however, I have discovered a workaround. Firstly, bring down the interface with the 'ip' command (NOTE - you can use 'ifconfig', but it is deprecated and may not be on future realeases of the Arch Linux ISO):


ip link set dev [INTERFACE NAME] down


Next, change the MAC address of the device using the 'address' option of the 'ip' command (I just used random hex values for the MAC address):


ip link set dev [INTERFACE NAME] address [VALID MAC ADDRESS]


Finally, bring the interface back up:


ip link set dev [INTERFACE NAME] up


You can verify the new MAC address by running:


ip link


Locate the interface by name in the table that appears. The 'link/ether' value should be set to the MAC address that was provided in the above commands.


Next, test the internet connection. The best way is with the 'ping' command:


ping [WEBSITE]


Make sure it is a website you are sure is functioning, such as google.com. If you get a pingback response, it worked, and you are on the Internet!


This of course only covers the very beginning of the process of reinstalling Arch. I will continue on, starting with formating the hard disk you are installing to, in the next part of this article series. I hope you will join me then. See you around!


UPDATE: The second part of the series is out now. Read it here.