Linux opt directory permissions

Linux: What is Opt Directory and How to Open Opt Directory

Linux: What is opt directory used for? Know how to open opt file in Ubuntu terminal and how to change permission of opt folder in Ubuntu. The /opt is for “the installation of add-on application software packages”. /opt is reserved for the installation of such software packages.

/opt Directory

Note that the directories /opt/bin, /opt/doc, /opt/include, /opt/info, /opt/lib, and /opt/man are reserved for local system administrator use. Also note that the package files that are variable must be installed in /var/opt. Whereas the host-specific configuration files must be installed in /etc/opt.

In general terms, the /opt directory is reserved for all the software and add-on packages that are not part of the default installation. For example, all third party applications should be installed in this directory. Any package to be installed here must locate its static files in a separate /opt/’package’ or /opt/’provider’ directory tree. Under no circumstances are other package files to exist outside the /opt, /var/opt, and /etc/opt hierarchies except for those package files that must reside in specific locations within the filesystem tree in order to function properly.

Generally, all data required to support a package on a system must be present within /opt/’package’, including files intended to be copied into /etc/opt/’package’ and /var/opt/’package’ as well as reserved directories in /opt. The minor restrictions on distributions using /opt are necessary because conflicts are possible between distribution installed and locally installed software, especially in the case of fixed pathnames found in some binary software.

Permissions for /opt Directory

The default permissions for /opt are drwxr-xr-x with ownership root:root. Users can manually set this ownership and permissions:

sudo chown root:root /opt
sudo chmod 0755 /opt

Open /opt in Ubuntu

Ubuntu users can easily open /opt in Ubuntu. To open it via Terminal, use CD and navigate to the opt folder and simply use ls command to see the contents of the directory. Users can also access the /opt directory graphically. Open files tab and select the opt folder.

Источник

Linux /opt/* folder and permissions [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.

  • This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
  • This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Читайте также:  Linux check which ports are listening to

I’m using the folder /opt/ to install common software that would otherwise not be available as part of the package installer of the system and that should be available to many (developer) users in Linux (using Ubuntu at the moment):

/opt/dev/eigen/3.1.3 /opt/dev/boost/1.54 /opt/git/myproject1.git /opt/git/myproject2.git 

Putting the common software there would be the common practice right? how about permissions? I tend to chmod -R 777 /opt/dev but this is a very bad practice I guess. Suggestions on best practices in this area? probably something along the lines of adding a developers group and giving them all permissions or?

Note git is a special case but still all developers need access to it because pushing changes implies creating directory and files under that path with the developer credentials.

Источник

Thread: Changing permissions for /opt directory

nonetheless is offlineSpilled the Beans

Changing permissions for /opt directory

Is changing the permissions for /opt directory dangerous for the system ?

Lately I was trying to install softwares and found out that /opt diriectory was the best place to install them.
Tried to do so, but I don’t have write permissions for /opt .
This is the current permissions for opt :

ls -al /opt drwxr-xr-x 2 root root 4096 Jul 20 2016 .

I found some blogs telling to change the ownership of /opt, some telling to change the permissions for /opt, While some telling that changing permissions can mess up with the system.

Personally I don’t want to change the ownership at all, I will be happy if changing permissions do the work.
But will it make my system unstable or something worse ?

Dennis N is offlineOrdinary User

Re: Changing permissions for /opt directory

Often you put a application folder in /opt if it’s not being installed by the package manager. Changing the owner (that’s usually all that’s necessary to have full access if for a single user) is done on the next level down — the application folder itself. I always just change the owner (and group) to my user, not the permissions.

If your user name is tom and the folder is appfolder,

sudo chown -R tom:tom /opt/appfolder

nonetheless is offlineSpilled the Beans

Читайте также:  Создать загрузочную флешку windows 10 линукс

Re: Changing permissions for /opt directory

You are not changing the ownership of entire /opt directory, but the owner of application folder, right ?

But, to make that application folder in the /opt directory, you need to either change the ownership of the entire /opt directory or change the permissions of the entire /opt directory ,isn’t it ?

If not then how do you install applications in /opt directory in the first place ?

QIII is offlineDark-Roasted but Half-Baked

Re: Changing permissions for /opt directory

A thing discovered and kept to oneself must be discovered time and again by others. A thing discovered and shared with others need be discovered only the once.
This universe is crazy. I’m going back to my own.

mc4man is offlineUbuntu Member

Re: Changing permissions for /opt directory

QuoteOriginally Posted by nonetheless View Post

Is changing the permissions for /opt directory dangerous for the system ?

Lately I was trying to install softwares and found out that /opt diriectory was the best place to install them.

What does that mean? Prepackaged software will install to wherever it’s built/packaged to install, on some ocassions it will be to /opt

If installing yourself manually then just use sudo.
(- note that by default /opt is not in your $PATH so any software installed to /opt will not run unless full path’d in a command or linked via a file in your $PATH

nonetheless is offlineSpilled the Beans

Re: Changing permissions for /opt directory

What does that mean? Prepackaged software will install to wherever it’s built/packaged to install, on some ocassions it will be to /opt

No, it is not packaged software, I was trying to install jdownloader. That should be installed in /opt, no ?

Will that include me (user account) in the root group ?
Will that allow me(user) to install files in /opt ?

mc4man is offlineUbuntu Member

Re: Changing permissions for /opt directory

QuoteOriginally Posted by nonetheless View Post

No, it is not packaged software, I was trying to install jdownloader. That should be installed in /opt, no ?

What will it be then ? Is it :

Will that include me (user account) in the root group ?
Will that allow me(user) to install files in /opt ?

Not sure why you’d want to do that. Just run the installer script as root. (to note: you can’t do that if in a wayland session, only xorg
Ex., sudo Downloads/JD2Setup_x64.sh

When run as root it would by default pick /usr/local/jd2 as install target, that would be fine. (unless installer was previously run, then it defaults to last choice.
It would also install a .desktop file to /usr/share/applications. It would be constructed to open jdownloader from wherever you installed to so that’s best way to open

Читайте также:  How to zip folder on linux

Edit: also note that it can use the systray so that would only work in an OS that supports the systray, Ubuntu currently doesn’t

Источник

Read / Write permissions in /opt directory

I installed Android Studio in my /opt directory without a hitch and have been using it. Recently, though, Android Studio informed me of an update. It won’t perform the update, however, because it says it doesn’t have Read / Write permissions in the opt directory where it’s installed. Can anyone recommend the best remedy for this situation? I would prefer not to move my installation to another directory. I also don’t know that I want to change permissions on the directory, though I might be tempted to do so for the update, then revert it back. Error message:

Studio does not have write access to /opt/android-studio. Please run it by a privileged user to update 

How are you trying to update ? How did you install ? PPA ? Can you run android studio as root ? ie sudo /opt/android-studio and then update ?

I guess you copied it to the /opt/ directory. I won’t recommend keeping it there, so you don’t have to bother with the permission issues. It is best to use umake to set up your Android development environment.

@markkirby I copied it there and used the installation script studio.sh I would run by sudo, but studio.sh starts the installation again. Surprised that I don’t see a file to run to just start the program. Maybe I should gedit the installation script to see where the executable is ..

i recommend awarding one of the answers the status of correct answer. otherwise, it may be misleading for users who come by this post in the future — if a correct answer has not been awarded 1 year after, it means that neither answer is correct. When, in fact, both efficiently address the problem at hand. i UPVOTED your question, BTW : )

I ran into permission trouble routinely by leaving /opt at default root permissions, and I will not leave everything in my home directory; That has its own pitfalls. There just isn’t enough double checking done by install scripts to guide you through potential pitfalls, and sudo just will not save the day. For the love of Mike, this is still happening in 2020. I gave up opened up permissions on /opt and called it a day. Does it worry me? You bet. But for a non-server system; notsomuch.

Источник

Оцените статью
Adblock
detector