View previous topic :: View next topic |
Author |
Message |
Amon2501 Tux's lil' helper
Joined: 12 Dec 2018 Posts: 131
|
Posted: Sun Jan 08, 2023 2:22 pm Post subject: Non-root installation of programs |
|
|
Hello. I want to build and install some software which arent in the portage tree (or just too old in there). So i download the sources, did configure, make. How can i install it from user and not root? I want this program to be able to use system libraries and system binaries if needed but to be installed in my home directory or in some particular place that is intended for such purposes (non system-wide installation). Are there any recommended ways to do this in Gentoo? |
|
Back to top |
|
|
Banana Veteran
Joined: 21 May 2004 Posts: 1404 Location: Germany
|
Posted: Sun Jan 08, 2023 3:18 pm Post subject: |
|
|
If it is only for your user, you can simple create a new direcotry in which your "own" software is located, compiled and ready do go. Then simply create a symlink into /usr/local/bin to the exeutable you want to run from your local software and you are ready to go.
If you don't want to make any symlinks into /usr/local/bin (like, you wan't nothing modified in the "system") you could also create a new folder in which all the new symlinks to your executables are, and add this folder to your $PATH for your user. _________________ My personal space
My delta-labs.org snippets do expire
PFL - Portage file list - find which package a file or command belongs to. |
|
Back to top |
|
|
Amon2501 Tux's lil' helper
Joined: 12 Dec 2018 Posts: 131
|
Posted: Sun Jan 08, 2023 3:43 pm Post subject: |
|
|
Thanks. But are there any "standard" ways to do such things? Like /home/user/bin or something that any of "non-portage" packages must recognize and abide. I`ve heard that /usr means Unix System resource therefore it is probably not a good idea to put there. Also what else besides just $PATH environment should i modify to make it work from "userspace"? |
|
Back to top |
|
|
NeddySeagoon Administrator
Joined: 05 Jul 2003 Posts: 54300 Location: 56N 3W
|
Posted: Sun Jan 08, 2023 4:07 pm Post subject: |
|
|
Amon2501,
The standard install location for will written build systems is /usr/local/...
Badly written build system just install to /usr which may upset already installeh things.
Read Well behaved build system allow you to define the install path at build time.
Look out for PREFIX.
Don't trust that anything follows those conventions.
Running as your normal user is expected to fail but the error messages will tell you where the package tried to install to. _________________ Regards,
NeddySeagoon
Computer users fall into two groups:-
those that do backups
those that have never had a hard drive fail. |
|
Back to top |
|
|
Hu Administrator
Joined: 06 Mar 2007 Posts: 21706
|
Posted: Sun Jan 08, 2023 4:16 pm Post subject: |
|
|
Regardless of where the package's files are installed, it will still have access to see system libraries and run system programs. If you want it system-wide, but not under Portage, then /usr/local is traditional, as Neddy says. If you want it per-user only, and not system-wide, then pick a place under your home directory. I am not aware of a standard for that. Another option would be to find or make an ebuild so that it can be installed system-wide by Portage. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6102 Location: Dallas area
|
Posted: Sun Jan 08, 2023 10:19 pm Post subject: |
|
|
I've always had a bin dir under my user, where my shell scripts, as well as a few binaries go.
PATH=/home/<user>/bin:$PATH: works for me puts my dir in the path, put it in .bash_profile/.profile
Never seen a particular place picked for libs though, although the last two times I ran "make -n install" on some packages,
it wanted to put it in ~/.local/lib/<some place> so maybe, it's the start of normalization (for users) _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Amon2501 Tux's lil' helper
Joined: 12 Dec 2018 Posts: 131
|
Posted: Sun Jan 08, 2023 10:32 pm Post subject: |
|
|
Anon-E-moose wrote: | I've always had a bin dir under my user, where my shell scripts, as well as a few binaries go.
PATH=/home/<user>/bin:$PATH: works for me puts my dir in the path, put it in .bash_profile/.profile
Never seen a particular place picked for libs though, although the last two times I ran "make -n install" on some packages,
it wanted to put it in ~/.local/lib/<some place> so maybe, it's the start of normalization (for users) |
It seems that home/user/.local/bin is the start of normalization. I found it at some sites mentioned XDG freedesktop and Ubuntu. OK i`ll do the same, but the second question is where should i put it to make available only user-wide and not global? If i put PATH=:/home/user/.local/bin in .bashrc or .bash_profile, then i`m not able to start these progs from KDE menu, only from the bash itself (even after reboot). And i think if i put it in /etc/env.d/99local, then that`s gonna be a global variable but i dont want it to be of that kind. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6102 Location: Dallas area
|
Posted: Sun Jan 08, 2023 10:38 pm Post subject: |
|
|
I'm not a kde user, but you should be able to add programs to the menu system, if nothing else, make a desktop file, use the whole path in Exec=
.local/share/applications/<desktop file> _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
Amon2501 Tux's lil' helper
Joined: 12 Dec 2018 Posts: 131
|
Posted: Sun Jan 08, 2023 10:56 pm Post subject: |
|
|
Anon-E-moose wrote: | I'm not a kde user, but you should be able to add programs to the menu system, if nothing else, make a desktop file, use the whole path in Exec=
.local/share/applications/<desktop file> |
There are desktop files provided by the installation script. but they only have a name of binary in it not the full path. implying that the binary file was already installed in one of the $PATH dirs. now i need to add that /home/user/.local/bin dir to $PATH but only for that user. |
|
Back to top |
|
|
Anon-E-moose Watchman
Joined: 23 May 2008 Posts: 6102 Location: Dallas area
|
Posted: Sun Jan 08, 2023 11:13 pm Post subject: |
|
|
Desktop files are easy to create.
Code: | $ cat radeon-profile.desktop
[Desktop Entry]
Name=Radeon Profile
GenericName=Control panel
Comment=Monitor Radeon GPU parameters and switch power profiles
Exec=sudo radeon-profile
Icon=radeon-profile
Terminal=false
Type=Application
Categories=System;Monitor;HardwareSettings;
StartupNotify=false |
I could also say "Exec=/home/<user>/.local/bin/<binary>"
.local/share/applications is an XDG* spot for user .desktop files and they should get selected over the global one, for the user. _________________ PRIME x570-pro, 3700x, 6.1 zen kernel
gcc 13, profile 17.0 (custom bare multilib), openrc, wayland |
|
Back to top |
|
|
figueroa Advocate
Joined: 14 Aug 2005 Posts: 2965 Location: Edge of marsh USA
|
Posted: Wed Jan 11, 2023 4:47 am Post subject: |
|
|
Anon-E-moose wrote: | I've always had a bin dir under my user, where my shell scripts, as well as a few binaries go.
PATH=/home/<user>/bin:$PATH: works for me puts my dir in the path, put it in .bash_profile/.profile |
Amazing! Me too.
Quote: | Never seen a particular place picked for libs though, although the last two times I ran "make -n install" on some packages,
it wanted to put it in ~/.local/lib/<some place> so maybe, it's the start of normalization (for users) |
Vivaldi puts some plugin things in ~/.local/lib/vivaldi/ _________________ Andy Figueroa
hp pavilion hpe h8-1260t/2AB5; spinning rust x3
i7-2600 @ 3.40GHz; 16 gb; Radeon HD 7570
amd64/23.0/split-usr/desktop (stable), OpenRC, -systemd -pulseaudio -uefi |
|
Back to top |
|
|
|