Using pacman to install tools in user provided path

Dear,

Can I use pacman to install a tool, like inkscape or okular or other, into the directory /opt instead letting pacman install in the default path?
Guess and from what I read it’s possible but I’m not sure what option to use.
Should I use:
pacman -S -r
or
pacman -S -sysroot
or
Some other option

Many thanks in advance

Looking at the .MTREE file, which is in each and every package
and also at packages contents,
I’d say no.

But on this occasion I’d like to ask:
why would you want to?

3 Likes

There are general Archlinux directory guidelines:

Path Content
/etc System-essential configuration files
/usr/bin Binaries
/usr/lib Libraries
/usr/include Header files
/usr/lib/pkg Modules, plugins, etc.
/usr/share/doc/pkg Application documentation
/usr/share/info GNU Info system files
/usr/share/licenses/pkg Application licenses
/usr/share/man Manpages
/usr/share/pkg Application data
/var/lib/pkg Persistent application storage
/etc/pkg Configuration files for pkg
/opt/pkg Large self-contained packages

Don’t try to mess with it, it will most likely end in a broken system.

6 Likes

Hi @Zessofed and welcome to the Manjaro community.

As a new forum user, please take some time to familiarise yourself with Forum requirements; in particular, the many ways to use the forum to your benefit:

The Update Announcements should be checked frequently for important update related information.

These announcements contain a Known Issues and Solutions section and should generally be checked before posting a request for support.

Output of the following command formatted according to forum requirements (see links above) may be useful for those wishing to help:

inxi --admin --verbosity=8 --filter --no-host --width

Be prepared to provide more information and outputs from other commands when asked.

Regards.

No - not possible.

3 Likes

@Nachlese,

Because /opt is defined by the FHS as “reserved for the installation of add-on application software packages.” In this context, “add-on” means software that is not part of the system; for example, any external or third-party software. This convention has its roots in the old UNIX systems built by vendors like AT&T, Sun, and DEC.

I know about the /usr/local versus /opt discussion and want go there again.

I wanted to install some of the tools I use in /opt because of the need to have them appart from other tools. Thus not as if they are installed in /usr/local with the rest of the software bunch.

Regards,

Just create your own packages for “tools” if you want them apart form other repository provided “tools”.

There is no problem in packaging programs with a different path if you do it for your self. Depending on the “tools” you might need to recompile them, with other “tools” it might be enough the use the bin package form the repository and repackage these. pacman will install the package content to the paths that are defined in the package.

3 Likes

But we don’t want to

1 Like

As @xabbu said - create your own packages - rewrite the PKGBUILD
so that it builds for and installs properly into /opt

Then you can use pacman to install them just as you always would.

What you want is not possible when you want to use pacman and peruse the packages from the repos - they are built to install and function in /usr - maybe not all, but certainly most.

Of course you can install stuff into /opt - just not by (ab)using pacman and repo packages.

With pacman (or any package manager like apt, dpkg, rpm, dnf … what have you …)
you have perfect control over what is installed - that is the purpose of these tools.
No need to “physically” separate some software from others IMO.

2 Likes

The FHS is a trailing standard and doesn’t need to be followed to the letter. It simply documents common practice. Though I’m not sure where they got the /opt stuff from, I’ve never seen it used that way.

Why do you need to have them separate?

/opt is generally used for software which expects all their files to be in one place, like on windows. I don’t think I’ve ever seen a linux distro use it for anything else, but I stopped distro hopping ages ago.

Why would they need to be in /opt?

Honestly it makes no sense to me…I’d love to know your reasoning.

The only software I have in /usr/local is software I’ve made myself and haven’t packaged.

That’s exactly how I do it. Whenever I need software that neither Manjaro itself nor the AUR offers, I install it under /opt so that I don’t fill my carefully maintained system with problems.

Later, they are simply deleted.

That’s how I used to install Eclipse. But since Eclipse has been in the AUR, that’s unnecessary, and I’ve changed it for myself.

A maintained program from the AUR is still better than having to maintain all the software in /opt yourself.
:footprints:

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.