1

I mean how to install programs from repos into the user directory without sudo?

There are two ways (and even more) of installing software: from repos and from the software developer's website (tarball). First method requires one to have the superuser password. One must use sudo to perform a command like this apt-get install app_name. The second method is to download a tarball from the website, extract it, place the extracted files into the specified directory (or build it first), set up shortcuts. As you can see, the second method needs a user to have certain skills, but the first one needs only a knowledge of the superuser password.

The question is — how to combine these advantages: not to know the password (install software to home directory), not to be skilled (install in one click) and to use software only from repos.

Why it looks not so complicated for me: as an example let's look at SweetHome3D. This app is available both in repos and on the developer's website. When I download the tarball I just extract it, rename the folder to make it invisible and set up the shortcut (make it and then place it into ~/.local/share/applications). Or I can just do $ sudo apt-get install sweethome3d

Now let's try something different (not necessary like this):
Perform $ apt-get download sweethome3d. This command downloads .dep file.
Extract the contents. There are no difficulties of doing this.
… (here are some automatic actions to make the app prepared to launch)
PROFIT!

Any ideas?

2 Answers2

1

The deb file that is downloaded and installed when you run apt-get install is basically a build of the source code with most options already set. This includes the location where it would be installed, probably /usr/some_folder.

This means you cannot change this location by using a deb file. The only way to do this is to get the source code, modify it and then install it.

Registered User
  • 9,631
  • 14
  • 53
  • 85
  • So, is it a fundamental restrictions that make my idea completely impossible? =( I just tried to extract sweethome3d and start it directly and it didn't work. Does that mean that files in .deb packages are compiled to be in the strictly destined place after the installation and in any other place they wouldn't work? And the reason why a program in a tarball works wherever it is installed is it is compiled specially for this purpose? And as a result there no way for a newbie to install software without getting superuser password or help of someone more skilled? :-( – Zephyr Zephyroff Jan 24 '15 at 11:29
  • @zephyrzephyroff Yes. The deb file contains some specific file that tell the os where to keep specific files, like icon image or executable file. Developers would generally use the same file destination that everyone uses, like /usr/share/applications/ for executables. One could always create a deb that would install in, say home folder. But that would be unnecessary work on the part of developer, when it is fairly easy to compile from source code. – Registered User Jan 26 '15 at 14:47
  • This answer is not exactly true. And easy way to see this is to copy cp /bin/date $HOME/ && $HOME/date. You'll see that the date command runs fine. One reason why sweethome3d may not have worked when you tried to run it from the extracted directory is because it was needing libraries and those libraries were not in the places it was looking for. If you set LD_LIBRARY_PATH appropriately, it may work. – crass Oct 13 '21 at 21:26
0

After installing Flatpak you can just:

flatpak --user install flathub com.sweethome3d.Sweethome3d
Pablo Bianchi
  • 15,657