Where would I find the kernel .config file in Linux ubuntu?

Viewed 30

I'm copying my kernel config file from an existing system to the kernel tree, and I entered this command:

/boot/config$(uname -r)

Yet I got:

bash: /boot/config-5.15.0-46-generic: Permission denied

Does anyone know why its saying permission denied and how to fix? I am using Ubuntu in VirtualBox.

1 Answers

As @Tsyvarev mentioned in comments it is possible that you're trying to execute file, that have no exec permissions:

$ ls -l /boot
...
-rw-r--r-- 1 root root    217414 Aug 20  2021 config-5.4.0-rc1+
...

Try to run: cat /boot/config-$(uname -r) to read the config file for currently running kernel.

Related