Problem
When excute ./firefox in a shell in Ubuntu22, it gives an error message: cannot create user data directory: /home/company_name/user_name/snap/firefox/1635: Permission denied.
Reason
According to the web search results, this is a common issue when the home directory is not in the standard /home location, or is a symlink to another mount point.
We use domain with user_name
, so our path home is not /home
, instead /home/company_name/
.
Fix
editing /etc/apparmor.d/tunables/home.d/ubuntu
with that line:
@{HOMEDIRS}+=/home/company_name/
After save, just restart some services:
systemctl restart apparmor.service snapd.apparmor.service snapd.service snapd.socket
Related
This method may also be apply to other softwares installed by snap.