You probably have an out of date snapshot. Upgrade to the latest snapshot or, if possible, a stable release build (which already includes LuCI).
EDIT: Just to be totally clear, you upgrade to the latest snapshot or a stable release build by downloading the image from downloads.openwrt.org and then using the sysupgrade command to flash the new image into the router. It is usually wise to not preserve settings using sysupgrade -n <image_filename> and then re-create your settings (you can always take a backup before you run the flash upgrade). You should never use opkg upgrade in general (there are lots of threads on this -- it may result in major problems or even little ones that are really hard to diagnose/resolve), and in this case, that command would not be helpful since it doesn't actually upgrade the core OpenWrt version and your snapshot is out of date so it probably wouldn't work in the first place.
RPi4 doesn't have yet a stable version.
Upgrade to the current snapshot and immediately install Luci and the rest of the packages that you need. Snapshots are rebuilt daily, so from day to day there can be incompatibilities.
Thank you all for your answers. When I tried installing the dependencies, it was right after a reinstall. Maybe I had bad timing, because I tried the same today and now there is no dependency errors, and everything is up and running.