How to fix "readlink: missing operand"?

5k views Asked by At

I am getting this error after typing sudo apt autoremove in terminal

readlink: missing operand
Try 'readlink --help' for more information.
stat: missing operand
Try 'stat --help' for more information.
E: Problem executing scripts DPkg::Pre-Invoke 'stat -c %Z $(readlink -f $(which opera)) > /tmp/opera.timestamp'
E: Sub-process returned an error code

I don't know how to solve this. Can anyone help me??

Thanks

2

There are 2 answers

1
Allan Wind On BEST ANSWER

readlink requires a file and $(which opera) returns nothing. As @mkayaalp mentioned in the above, you need to either (re)install opera (if you haven't) or update the PATH so which can find the binary.

1
Mohamad Termizi On

Thanks to Mr Termy that suggested to run CLI "$ sudo touch /usr/local/bin/opera; sudo chmod 755 /usr/local/bin/opera" and it works for me - great!

https://forums.linuxmint.com/viewtopic.php?t=399359