Ubuntu – How to install programs into user directory without sudo

aptsoftware installationsoftware-centersudo

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?

Best Answer

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.