Insert this code into your build file before the install commands to fix the error where packages like chrome and brave try to install into /opt/ Credit to @fpfcmsr for this solution.
rm /opt # this was a symlink file not a directory
mkdir /opt # recreate the opt directory to enable packages to install in it
If you are attempting to install chrome, apparently, you need this script from @rrenomeron as well to get the correct keys during updates: ublue-tr/config/scripts/enable-chrome-yum-repo.sh at 5503da8d5c7db4cf349ea15ca023c3220d4f94e3 · rrenomeron/ublue-tr · GitHub