/opt folder missing in Ubuntu 14.04
Solution 1
Directory /opt
is optional. It is not being used for anything in the standard Ubuntu distro so somebody decided not to create one.
Not a big deal. Just create it with sudo mkdir /opt
Edit
As suggested by waltinator
a better command would be mkdir --mode=755 /opt
Solution 2
I suggest mkdir --mode=755 /opt
. Read/Write/Search for Owner (root:root
), Read/Search for Group and Other. Allows root
to create files/directories, allows anybody else to search and descend the directory tree under /opt
(depending on lower nodes permissions)
Related videos on Youtube
g0lem
Updated on September 18, 2022Comments
-
g0lem over 1 year
I'm trying to install Eclipse "by the book" in /opt, but when trying to access /opt, it seems that /opt directory doesn't exist in Ubuntu 14.04:
$ cd /opt/ bash: cd: /opt/: No such file or directory $ ls -a / . bin cdrom etc initrd.img lib lost+found mnt root sbin sys usr vmlinuz .. boot dev home initrd.img.old lib64 media proc run srv tmp var vmlinuz.old
Why is the /opt folder missing? How to re-create one if applicable & what are the permissions to apply?
-
Eliah Kagan about 9 years+1 While
sudo mkdir --mode=755 /opt
has the advantages of being very self-documenting and working the same way on another OS or on an Ubuntu system with unusual settings, I think the simplersudo mkdir /opt
should be considered equally fine. The defaultumask
for root (as revealed bysudo -s umask
) is 0022, so a directory created by runningmkdir
as root should have permissions 0755. See the answers at What is “umask” and how does it work? for details.