Arch - libxml2.so.2 is missing

Heads up for arch users. Since the latest update libxml2 got bumped so libxml2.so.2 is missing.
I made this small PKGBUILD to fix:

pkgname=libxml2-so.2-compat
pkgver=2.13.8
pkgrel=1
pkgdesc="Legacy libxml2.so.2.13.8 symlinked as libxml2.so.2 for Unity compatibility"
arch=('x86_64')
url=
license=('MIT')
provides=('libxml2.so.2')
conflicts=()
options=(!strip)
source=("https://archive.archlinux.org/packages/l/libxml2/libxml2-${pkgver}-1-x86_64.pkg.tar.zst")
noextract=("libxml2-${pkgver}-1-x86_64.pkg.tar.zst")
sha256sums=('SKIP')
 
package() {
  mkdir -p "$pkgdir/usr/lib"
  bsdtar -xf "${srcdir}/libxml2-${pkgver}-1-x86_64.pkg.tar.zst" -C "${srcdir}" $"usr/lib/libxml2.so.${pkgver}"
  install -m 755 "${srcdir}/usr/lib/libxml2.so.${pkgver}" "$pkgdir/usr/lib/libxml2.so.${pkgver}"
  ln -sf $"libxml2.so.${pkgver}" "$pkgdir/usr/lib/libxml2.so.2"
}

make a new folder, call it “libxml2-compat” or whatever.
create the PKGBUILD file in there with the contents from the link
run: makepkg -si

confirm with:
cd /usr/lib
ls | grep libxml2

2 new files should appear:

  • libxml2.so.2.13.8
  • libxml2.so.2 → libxml2.so.2.13.8 (the symlink)

Thank you so much!!, I was trying to solve the issue but I’m not expert using linux but here I’m using Arch XD

just a small typo makepkg instead of makepgk

Thank you so much, you just saved me a lot of troubleshooting <3

Thank you. I have an issue with “makepk -si”. It says I have not the permission to write in BUILDDIR and PKGDEST

Hm, did you create the PKGBUILD in a home directory?
Otherwise, sudo will fix it.

I deleted libxml2 because my system didn’t update and I broke everything. So I booted on a flash drive with an iso of archlinux, I mounted my partition and created the PKGBUILD in my user profile folder and this is the error I get when I use makepkg -si. I also tried to use pacman --root /mnt from the iso and successfully reinstalled libxml2 but now the issue is with libicuuc.so.75

makepkg don’t work with sudo

Ok I did it ! On the flash drive with the iso of arch linux

mount /dev/partition /mnt
cd /mnt/var/cache/pacman/pkg
pacman --root /mnt --dbpath /mnt/var/lib/pacman --cachedir /mnt/usr/cache/pacman/pkg -U libxml2-2.13.6-3-x86_64.pkg.tar.zst

where /dev/partition is the partition with arch linux. It worked because I had this package in the cache. You can download the package on https://archive.archlinux.org/packages/l/libxml2/libxml2-2.13.6-3-x86_64.pkg.tar.zst.

I need this pkgbuild on the AUR to fix the plex-desktop package which also requires this file. Is it OK if I publish it?

UPDATE: apparently somebody did something similar on the AUR today. You can install the libxml2-compat package published today on the AUR. Adds a symlink only.

thank you so much!

libxml2-legacy on the official repo fixes this.

Thanks a lot man, you’re a god send! I was contemplating on having to re install windows because my editor wouldn’t start, but this fixed the issue

Fantastic, just what I needed to install NordVPN on Arch!

Thank you for the fix !

Thank you for this post.

Today a new UnityHub release already included the libxml2-legacy as dependency, but that breaks Manjaro, as at the moment libxml2-legacy doesnt show up just yet.

So in case anyone else need it, just get it from Arch Linux - libxml2-legacy 2.13.8-1 (x86_64) and install it through Pamac.

I go through this pain often with Discord updates, not sure is the expected flow, but it works.

Great, unityhub in pacman has been updated.
For anyone who has installed my package.
Run: sudo pacman -Rs libxml2-so.2-compat to uninstall.
Then update unityhub.

After libxml2-legacy was installed, Cisco Anyconnect backed to normal.

sudo ln -s /usr/lib/x86_64-linux-gnu/libxml2.so.16 /usr/lib/x86_64-linux-gnu/libxml2.so.2

viber has started working again after this, thanks

absolute legend
it helped

This did not work for me on Kubuntu 25.10