/opt folder missing in Ubuntu 14.04

14,664

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)

Share:
14,664

Related videos on Youtube

g0lem
Author by

g0lem

Updated on September 18, 2022

Comments

  • g0lem
    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
    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 simpler sudo mkdir /opt should be considered equally fine. The default umask for root (as revealed by sudo -s umask) is 0022, so a directory created by running mkdir as root should have permissions 0755. See the answers at What is “umask” and how does it work? for details.