Convert Manjaro to Arch

Migrate Manjaro to Arch

This is a rewrite of Jonathon's guide with some additions discovered while migrating a test system.

Note that your resulting system does not count as a real Arch installation because real Arch requires knowledge of what you need, why you need it and the process to achieve your goal.

Manjaro, EndeavourOS and any other Archbased distribution out there is not considered a real Arch system.

Catch up with unstable

Switch Manjaro to unstable branch and run a full update

sudo pacman-mirrors -aB unstable
sudo pacman -Syyu

Graphic drivers

If you are using Nvidia proprietary - switch to the opensource driver - ensure your graphic driver are in a working state before you begin the migration. Manjaro nvidia drivers is tied into the different kernels - so you will get into trouble when replacing the Manjaro kernel with Arch Linux stock kernel.

As a - sort of - failsafe, install all free drivers using the meta package xorg-drivers

sudo pacman -Syu xorg-drivers

Replace mirrors

Pick up a set of Arch mirrors from https://www.archlinux.org/mirrorlist/ 1 , e.g.:

/etc/pacman.d/mirrorlist

## United Kingdom
Server = https://mirror.netweaver.uk/archlinux/$repo/os/$arch
## Netherlands
Server = https://mirror.mijn.host/archlinux/$repo/os/$arch

Remove Manjaro packages

Remove a few Manjaro specific packages

Note that -Rdd won't check for dependencies so you will have to go back later and look over your packages.

sudo pacman -Rdd pacman-mirrors manjaro-release bashrc-manjaro

Install the Arch equivalent and yes, -Sy is discouraged but we need to do it this way - we will fix later in the process.

sudo pacman -Syy pacman pacman-contrib

Upgrade, install kernel, replace overlay packages

Check this list yourself to make sure you're happy with it. You might want to tweak it:

sudo pacman -Syu base linux linux-headers filesystem grub sudo systemd systemd-libs systemd-sysvcompat xorg-server xorg-server-common xorg-xwayland

Watch out for changes resulting in a .pacsave

Resolve those now, e.g. move the files back into place. Important ones are covered below.

You will need to restore your vconsole.conf, locale.conf and your hostname file

sudo cp /etc/vconsole.conf.pacsave /etc/vconsole.conf
sudo cp /etc/locale.conf.pacsave /etc/locale.conf
sudo cp /etc/hostname.pacsave /etc/hostname

Ensure GRUB menu built correctly

Check the output carefully and re-run if necessary

sudo grub-mkconfig -o /boot/grub/grub.cfg

You create add a GRUB hook to do some housekeeping on kernel modules when kernel changes

/usr/share/libalpm/hooks/grub.hook

[Trigger]
Type = File
Operation = Install
Operation = Remove
Target = usr/lib/modules/*/vmlinuz
Target = boot/vmlinuz*

[Action]
Description = Updating Grub-Bootmenu
When = PostTransaction
Exec = /usr/bin/grub-mkconfig -o /boot/grub/grub.cfg

Reinstall GRUB

Replace Manjaro's GRUB boot loader with the Arch boot loader

sudo grub-install /dev/$YOUR-BOOT-DISK

Obviously, check that destination device as you normally would.

Check for other Manjaro-specific packages and replace/remove

Be careful as you would probably want to keep your theme packages

Check for non-repo packages

pacman -Qm

Note: this will show AUR packages too! Check for things like kernel variants. Some packages in Manjaro's [community] will have AUR equivalents.

Remove and replace as you see fit.

This bit is important to check. Don't just copy, paste, and run.

sudo pacman -Rdd  $(pacman -Qsq manjaro-) $(pacman -Qsq mhwd)

This bit is important to check. Don't just copy, paste, and run.

List your installed kernels using

mhwd -li

Add the kernel packages to the list below - and if you know you have headers - add those too

Example packages to be removed

linux510
linux510-headers
manjaro-application-utility
manjaro-documentation-en
manjaro-firmware
manjaro-hello
manjaro-icons
manjaro-keyring
manjaro-settings-manager
manjaro-system
manjaro-zsh-config
mhwd
mhwd-amdgpu
mhwd-ati
mhwd-db
mhwd-nvidia-340xx
mhwd-nvidia-390xx
mhwd-nvidia-418xx
mhwd-nvidia-430xx
mhwd-nvidia-435xx
mhwd-nvidia-440xx

Remove old kernel initramfs files

Look under /boot and remove any files generated by Manjaro's kernel packages, then regenerate the GRUB config.

Look for packages with kernel related names like linuxXX-

Check configuration files

For example:

  • Merge pacnew using pacdiff
  • Remove SyncFirst line from /etc/pacman.conf

If you are using your ~/.local/bin folder - you must add the folder to your path.

As an alternative you can recreate the file /etc/profiles.d/home-local-bin.sh

echo 'export PATH="$HOME/.local/bin:$PATH"' | sudo tee -i /etc/profile.d/home-local-bin.sh

Re-check for updates.

Sync your system to match Arch repos - Manjaro packages may be ahead in terms of pkgrel which is why the downgrade argument (uu) is used.

sudo pacman -Syuu

Ensure GRUB is correct.

sudo grub-mkconfig -o /boot/grub/grub.cfg

Reboot

That should be all you need to do. Once booted, tidy the remaining Manjaro kernel and check again for orphans etc.

There may be some other smaller issues cause by lingering configuration differences. Also remember that these might not be common with Arch, so please don't report them as bugs to Arch!

If you find any other weird issues, make sure you step through the Arch install guide and make sure all the basics are in place.


Migrating to ...

As an example - you could migrate to EndeavourOS.

  1. Create an EndeavourOS mirrorlist /etc/pacman.d/endeavouros-mirrorlist
    ## Germany
    Server = https://mirror.alpix.eu/endeavouros/repo/$repo/$arch
  2. Add EndeavourOS to pacman.conf (below [multilib])
    [endeavouros]
    Include = /etc/pacman.d/endeavouros-mirrorlist
  3. Import EndeavourOS key
    sudo pacman-key --keyserver hkp://pool.sks-keyservers.net -r 003DB8B0CB23504F
    sudo pacman-key --lsign 003DB8B0CB23504F
  4. Add a few packages from EndeavourOS repo
    sudo pacman -Syu yay reflector-simple eos-rankmirrors
  5. Update mirrors
    reflector-simple
    eos-rankmirrors