[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to keep track of files installed from sources?



Csanyi Pal wrote:
> How can I know where come installed files after I did run:
> ./configure && make && sudo -E make install
> commands?

In addition to the fine comments made by others let me add that Debian
has a very nice default for local installations.

The default for configure is to install into /usr/local.  The default
on Debian is that /usr/local is sgid writable by group staff.

  $ ls -ld /usr/local
  drwxrwsr-x 14 root staff 4096 May 13  2011 /usr/local

Therefore if you put yourself in the staff group then you can write to
the files there as a non-root user.  That is a much safer way to
install software than using sudo.

  # adduser csanyipal staff
  ...log out...
  ...log back in again to have new group take effect...

  $ id | grep --color staff
  ...,50(staff),...

Then the recipe would be (without the sudo):

  ./configure && make && make install

This is significant because a buggy (or malicious) install script
might try to overwrite something in /bin, /etc, or whatever.  But if
you are not root then it cannot do so.  It will only have permission
to access the /usr/local tree as group 'staff' and can't do much harm
that way.  This is a very nice half way position between installing as
a single user in $HOME and installing as the root superuser affecting
the core operating system.  I highly recommend this over using sudo in
this case.

> this is important if I decide later to uninstall files installed from
> sources.

As previously suggested if it is installed with an automake generated
Makefile then it will have an uninstall target as well.  The
combination of install and uninstall may be enough for you.

Since Debian doesn't ship files in /usr/local/ you could remove *all*
files there and know that you are only removing your own files and
nothing from Debian.  With the group staff configuration you should do
this as yourself and not as root.  If you are only installing one
single thing there then all files will be associated with that one
single thing.

The complication is when you start to have multiple projects installed
there and want to selectively remove one of them without removing
everything.  But again you could remove everything and then install
again just what you want to keep from other projects.

  $ find /usr/local -type f -print | less  # <--- review
  $ echo find /usr/local -type f -delete   # <--- remove all files
  $ (cd project1 && make install)          # <--- put this one back
  $ (cd project2 && make install)          # <--- put this one back

I haven't used it but others tell me that GNU Stow is useful for
tracking locally installed projects in /usr/local.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: