Switch from Manjaro to Arch without fresh install

Posted on 03 October 2016 in Linux

WARNING!!! After the switch neither Manjaro nor Arch community will be supporting you. No guarantee. What are you doing is your own risk! Make a backup first!

Pacman config

First of all you will need to download a new mirrorlist

sudo wget -O /etc/pacman.d/mirrorlist https://www.archlinux.org/mirrorlist/all/

then edit your new mirrorlist and remove any mentions of manjaro* from /etc/pacman.conf

sudo rm /etc/lsb-release

Reinstall pacman-mirrorlist

sudo pacman -Syyu pacman-mirrorlist

If you are faced with errors due to broken dependencies- remove the issue package before. (in my case it was linux41-nvidia* to be removed).

Updating pacman

sudo pacman -R manjaro-system
sudo pacman -Syyu pacman

Note that if you start getting "warning ... SyncFirst in section 'options' not recognised" you will need to comment that line out.

sudo sed -i 's/^SyncFirst/#&/' /etc/pacman.conf

Removing and reinstalling packages

sudo pacman -Rsn $(pacman -Qsq manjaro-)
sudo pacman -Syu alsa-utils alsa-firmware lib32-alsa-plugins 
sudo pacman -Rsn pulseaudio pulseaudio-alsa
sudo pacman -Sy pulseaudio pulseaudio-alsa 
sudo pacman -Rsn lib32-mesa lib32-nvidia-utils libgl lib32-libgl

If you don't have libgl* packages installed go ahead to the next step

sudo pacman -Sy libgl lib32-libgl --force

You will want to choose an appropriate packages to be installed (in my case it was nvidia-related ones). You will want to agree to remove mhwd. If during removing there is an error regarding mhwd-tui remove it first.

sudo pacman -Rsn $(pacman -Qsq mhwd)

Setting up Arch installation

sudo pacman -S grub

You will want to merge /etc/default/grub.pacnew with the existing one (especially replacing GRUB_DISTRIBUTOR and commenting out color options).

sudo sed -i 's/^Manjaro/^Arch/' /etc/issue

Edit /etc/release to have it look like this:

NAME="Arch Linux"
ID=arch
PRETTY_NAME="Arch Linux"
ANSI_COLOR="0;36"
HOME_URL="https://www.archlinux.org/";
SUPPORT_URL="https://bbs.archlinux.org/";
BUG_REPORT_URL="https://bugs.archlinux.org/";

Copy the file to /etc/os-release and remove /etc/manjaro-release.

Installing kernel and graphics

sudo pacman -Sy nvidia-340xx

Replace it with your driver.

sudo pacman -Sy linux linux-api-headers linux-headers linux-firmware

Final steps

  1. Boot to grub and choose Arch Linux
  2. Remove remained Manjaro Linux kernels
  3. Reinstall packages that are marked as newer than available.

Done!

Congratulations!