Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am experiencing a behavior in the installation of a .deb package that I don't really understand.

I have a set of "things" in my computer that I deploy to remote computers using a .deb package. I work in my local machine logged as the user "borrajax". There's also a "borrajax" user in the remote machine where I install my .deb. When I need to deploy my "things", I create a .deb package in my machine (with sudo dpkg --build), copy it to the remote machine and install it with sudo dpkg -i myPackage.deb . When I do that, the "expanded" (or installed) files become owned by the local user borrajax, which is good.

Now, I have a coworker that also tries to do the same thing but he is logged in as a different local username (he doesn't have a borrajax user in his machine, but... foobar - I guess his parents didn't like him much-). He follows exactly the same process I do with my local user borrajax but with his local foobar user: Create the .deb in his machine, copy it to the remote machine and install it with dpkg -i. Well... In that case, the installed files become owned by root, which prevents the installation to continue (which is not a bug, but a feature).

All these machines are Ubuntu (11.10 mine, 12.04 the remote one and my coworker's one) so what I would like is the package become installed with whatever user has the uuid 1000. I would expect the name not to be so relevant (It may be just a coincidence there's a borrajax user in my machine and in the remote one).

So in this case, the username seems very relevant. Why is that? As I mentioned earlier, my local user borrajax, my coworker's foobar and the borrajax in the remote machine are all the uid=1000. Why does the user's name (seem to be) so important? My local borrajax user may not have anything to see at all with the borrajax in the remote machine. If the package was created by the user with uid 1000, why "sometimes" (if I've created it) it is installed with whatever user has the uid 1000 in the remote machine and "sometimes" it's installed with root (if my coworker has created it)?

I can always change the owner of the installed files using chown 1000 in the postint script, or use some other kind of workaround but I would like to understand first why is this happening, and how is it that the username in two different machines seems so important?

Thank you in advance

share|improve this question
Show us the output of ls -l path/to/file in the package build tree, where path/to/file is one of the files that has the wrong ownership. Also show us the output of dpkg-deb --fsys-tarfile foo.deb | tar tvf - on each machine. – Gilles Aug 16 '12 at 17:54
Your question seems to be based on a flawed assumption and / or a local override for an important system default. sudo dpkg -i should always run as root and the installed files should be owned by root (except for suid scripts perhaps, and files belonging to a dedicated system account such as www-data). – tripleee Jan 31 '13 at 10:08

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.