Mono vs RunMono.sh

I have a freshly built 4.25.3 from source which can opens just fine in editor.

Problem is I couldn’t use mono from apt to build C++ project files as it returned with this error:

ERROR: Unhandled exception: System.Reflection.ReflectionTypeLoadException: Exception of type 'System.Reflection.ReflectionTypeLoadException' was thrown.
       Could not load type of field 'UnrealBuildTool.UnrealPluginLanguage:XDoc' (0) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       Could not load type of field 'UnrealBuildTool.IOSExports+<>c:<>9__5_0' (1) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       Could not load type of field 'UnrealBuildTool.ProjectFileGenerator+<>c:<>9__91_0' (10) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       Could not load type of field 'UnrealBuildTool.VCProjectFileGenerator+<>c__DisplayClass26_0:NS' (0) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       Could not load type of field 'UnrealBuildTool.UnrealPluginLanguage+UPLContext:ElementVariables' (3) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       Could not load type of field 'UnrealBuildTool.VCMacProjectFileGenerator+<>c__DisplayClass2_0:NS' (0) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
         at (wrapper managed-to-native) System.Reflection.Assembly.GetTypes(System.Reflection.Assembly,bool)
         at System.Reflection.Assembly.GetTypes () [0x00000] in <12b418a7818c4ca0893feeaaf67f1e7f>:0 
         at UnrealBuildTool.UEBuildPlatform.RegisterPlatforms (System.Boolean bIncludeNonInstalledPlatforms, System.Boolean bHostPlatformOnly) [0x0002c] in <f56da7fc921c488ea4e883f006fb21d6>:0 
         at UnrealBuildTool.UnrealBuildTool.Main (System.String[] ArgumentsArray) [0x00251] in <f56da7fc921c488ea4e883f006fb21d6>:0 
       System.TypeLoadException: Could not load type of field 'UnrealBuildTool.UnrealPluginLanguage:XDoc' (0) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       System.TypeLoadException: Could not load type of field 'UnrealBuildTool.IOSExports+<>c:<>9__5_0' (1) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       System.TypeLoadException: Could not load type of field 'UnrealBuildTool.ProjectFileGenerator+<>c:<>9__91_0' (10) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       System.TypeLoadException: Could not load type of field 'UnrealBuildTool.VCProjectFileGenerator+<>c__DisplayClass26_0:NS' (0) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       System.TypeLoadException: Could not load type of field 'UnrealBuildTool.UnrealPluginLanguage+UPLContext:ElementVariables' (3) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.
       System.TypeLoadException: Could not load type of field 'UnrealBuildTool.VCMacProjectFileGenerator+<>c__DisplayClass2_0:NS' (0) due to: Could not load file or assembly 'System.Xml.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies.

whereas it build just fine if using bash RunMono.sh from Engine/Build/BatchFiles/Linux. What could be causing this problem?

edit: I’ve tried running setup.sh, generateprojectfiles, clean up UE4Editor and make again but no luck. Also updated mono to 6.10.0.104 with no dice.