5

I want to change two values using sysctl. One is the sysctl vm.swappiness=10 and the other, sysctl kernel.sysrq=1. However, when I run sysctl -p, it tells me sysctl: cannot open "/etc/sysctl.conf": No such file or directory, but sysctl -a returns this. So, I want to ask where is my system storing sysctl config?

Akshat Vats
  • 439
  • 2
  • 8
  • 21

1 Answers1

8

The configuration has long moved to /etc/sysctl.d/*

You can create individual files, e.g.

cat /etc/sysctl.d/swappiness.conf

vm.swappiness=10

As for the sysctl -a output - you're seeing the current kernel values.

Stephen Kitt
  • 411,918
  • 54
  • 1,065
  • 1,164
Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64