How do I install SDL2 to build my project?


I started a SDL2 project on GitHub and decided to install SDL2 on here, to build my project.
I tried apt-get install libsdl2-dev but I just got
`Setting up udev (204-5ubuntu20.19) …

  • udev requires hotplug support, not started …fail!`
    (SDL2 package requires udev)

When I googled, it said it was because the kernel doesn’t support hotplugging, but guess I can’t just swap the kernel, right? (if I can, please tell me how to)

If anybody encountered this problem, please how to avoid this, ether by configuring udev or package itself is okay.

Thanks in advance.


I know nothing about SDL2 but if you need to change the kernel then that won’t be possible :confused:…unless you use an SSH workspace and connect to your own machine. Then it’s definitely possible.


I knew I couldn’t do that. But it seems udev depends on that specific kernel feature. After some more Googling, I found out SDL2 depends on udev because of joystick support. I’m now going to try building it without joystick support and see if it works. Thanks for the reply anyway.


This shell script will get around the upgrade issue:

[ ! "$(grep -A1 '### END INIT INFO' /etc/init.d/udev | grep 'dpkg --configure -a || exit 0')" ] \
&& sudo sed -i 's/### END INIT INFO/### END INIT INFO\
dpkg --configure -a || exit 0/' /etc/init.d/udev

You can run it with this command:

curl | bash