chromium build error gn gen out/Default in Ubuntu

When I’m setting up the build I’m getting the error in Ubuntu, I’m pasting my error shown in terminal here (Note: /home/quic/ is my home directory)

when i type gn gen out/Default it get the following error

`quic@quic:\~/chromium/src$ gn gen out/my_build
ERROR at //build/config/linux/pkg_config.gni:104:17: Script returned non-zero exit code.
pkgresult = exec_script(pkg_config_script, args, "value")
^----------
Current dir: /home/quic/chromium/src/out/my_build/
Command: python3 /home/quic/chromium/src/build/config/linux/pkg-config.py -s /home/quic/chromium/src/build/linux/debian_bullseye_amd64-sysroot -a x64 xkbcommon
Returned 1.
stderr:

Traceback (most recent call last):
File "/home/quic/chromium/src/build/config/linux/pkg-config.py", line 248, in \<module\>
sys.exit(main())
File "/home/quic/chromium/src/build/config/linux/pkg-config.py", line 143, in main
prefix = GetPkgConfigPrefixToStrip(options, args)
File "/home/quic/chromium/src/build/config/linux/pkg-config.py", line 81, in GetPkgConfigPrefixToStrip
prefix = subprocess.check_output(\[options.pkg_config,
File "/usr/lib/python3.10/subprocess.py", line 420, in check_output
return run(\*popenargs, stdout=PIPE, timeout=timeout, check=True,
File "/usr/lib/python3.10/subprocess.py", line 501, in run
with Popen(\*popenargs, \*\*kwargs) as process:
File "/usr/lib/python3.10/subprocess.py", line 966, in __init__
self.\_execute_child(args, executable, preexec_fn, close_fds,
File "/usr/lib/python3.10/subprocess.py", line 1842, in \_execute_child
raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: \[Errno 2\] No such file or directory: 'pkg-config'

See //ui/events/ozone/layout/BUILD.gn:11:3: whence it was called.
pkg_config("xkbcommon") {
^------------------------
See //ui/events/BUILD.gn:73:15: which caused the file to be included.
deps += \[ "//ui/events/ozone/layout" \]
^-------------------------`

Read more here: Source link