I use atool (https://www.nongnu.org/atool/) for unpacking random archives - it abstracts away all formats including zip/rar/7z, compression and also guarantees that nothing is ever extracted into $CWD.
Looks like it might be in standard Ubuntu repositories:
https://theunarchiver.com/command-line https://github.com/MacPaw/XADMaster
in difference to unp and atool, unar does not depend on other tools to unpack the actual archive