Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

This question already has an answer here:

I was about to play around on my virtual machine running Ubuntu 12.04. I installed GIT-CORE using apt-get install git-core from repos. First I thought the apt-get command will install in the folder I am in, but I was wrong. So is there a way to directly tell apt-get where to install ?

Or do I have to move the files later? Let me know your best solution for this.

share|improve this question

marked as duplicate by Eliah Kagan, guntbert, Radu Rădeanu, karel, Eric Carvalho Jan 14 at 1:07

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
The apt-get command will install to the system - in /usr/share etc. There is a question here which you may find helpful. –  Wilf Jan 13 at 13:15
    
great, i didn't find that topic. –  Private Jan 13 at 13:21
add comment

1 Answer 1

up vote 4 down vote accepted

I don't know if I got the problem correctly. So the answer goes in two directions. The first, apt-get, deb packages and source packages. The second, Git.

The first thing to say is that apt-get install do not choose where to install a package, but the package itself has that information. A .deb file is just a set of compressed folders which, in fact, has the proper install targets within. So, in short, no you can't change the apt-get install destination of the packages, because it has to do with the packages, not with apt-get. Last on this, each location within a deb goes to the particular gnu/linux directory in your system, so /usr/share/bin cannot be changed by other, the same for the "man" pages, icons, etc. Once you touch the deb, it is actually a very tricky thing to handle.

Second, of course you can work-around the paths if you know what you are doing. It is not a simple task to do for begginers or intermediate users since you need to handle the deb packaging rules to modify the deb package. To do that, just download the package without installing it with apt-get, uncompress the package and edit the deb manifest and the files/folders you may want to change. Again, this is not encouraged at all and there is no reason to do this unless you are a developer that want to test something in particular with that package.

Third, you can allways compile from the source. That will basically make a "portable" version of the software you want to install and will locate it on your home folder. Of course, it will carry a) lots of dev dependecies to build the source b) eventually solve different problems regarding the compilation. This is also not recommended for begginers, unless there is no other way to install that particular software (which clearly is not the case of Git).

But, probably you might just want to change the git location target folders? To do that you just need to configure your git account and the folders to sync. That process though has nothing to do with apt-get. Check some guides on how to do it here: (http://rogerdudler.github.io/git-guide/index.html) or here (https://www.digitalocean.com/community/articles/how-to-install-git-on-ubuntu-12-04). Of course you can always see the official page or the man page of git (man git in a terminal).

share|improve this answer
add comment

Not the answer you're looking for? Browse other questions tagged or ask your own question.