How do we install application of Arch Linux
/opt directory rather than the default location? (maybe
/usr/bin or etc.)
So the "cleanest" way to do this is what @Rayleigh suggested: to edit the
PKGBUILD of the package in question and edit it to install its files to
/opt rather than somewhere else.
This process is different for every package, so without knowing which specific packages you're looking at I cannot give you more concrete advice than to look at the PKGBUILD documentation and that the code you're looking to edit is probably in the
After you've succesfully edited the PKGBUILD file in question you can then create a package from it using
makepkg(doc) and you can then go on to install these packages like you normally would in
If you rather would not go through these steps, you could also edit the package files themselves, as they are merely tarballs containing the files to be installed, and some extra metadata files. To do this you can update the archive to rename any toplevel directories to
opt instead. You will also need to update the .MTREE file using
You can then install the edited package as you would normally using
Note that both methods will be required for every update though, so it's a lot of work for something that goes against the Arch Linux packaging guidelines.
If you tell us which packages you are referring to, and why you want to achieve this, I can give more specific and possibly more useful advice.
Answered by MadeOfMagicAndWires on January 5, 2022
I do not endorse this behavior. This method is for Academic Purposes only. Always install packages through pacman if possible.
A package in Arch Linux consist of a few files (not always) and a
PKGBUILD file. Modifying the
PKGBUILD accordingly can enable the possibility of a different installation path.
To find the
PKGBUILD go to the Arch Linux website, find your package and on the top left corner under Package Actions Click "Source Files".
Answered by Rayleigh on January 5, 2022
1 Asked on January 6, 2022 by shrimpwagon
8 Asked on January 6, 2022
1 Asked on January 6, 2022
3 Asked on January 6, 2022
6 Asked on January 6, 2022 by just-khaithang
3 Asked on January 5, 2022
1 Asked on January 5, 2022 by elcortegano
2 Asked on January 5, 2022 by user216488
2 Asked on January 5, 2022 by subtubes
5 Asked on January 5, 2022 by zeno-raiser
2 Asked on January 5, 2022 by cantik-memekmu
1 Asked on January 5, 2022 by frodo-mcdodo
1 Asked on January 5, 2022 by szoke-lorand
Get help from others!