The expression よりしかたがない means "there is no choice but to…" or "there is nothing to do but…". It conveys a sense of resigned acceptance – the speaker acknowledges that a situation is unavoidable and that only one course of action remains.
This grammar point combines より (a particle meaning "other than" in this context) with しかたがない ("it can't be helped"), literally meaning "there is no way other than…".
It attaches to the dictionary form of a verb:
Verb[dictionary] + よりしかたがない
This expression carries a tone of resignation or reluctant acceptance. The speaker typically wishes there were another option but recognizes there isn't one. It is slightly more literary or formal than the similar expression 〜~しかない.