You are not logged in.

#1 2009-03-15 03:40:29

Gen2ly
Member
From: Sevierville, TN
Registered: 2009-03-06
Posts: 1,529
Website

Why is running makepkg as root a bad idea?

Hello everybody.  I'm learning lately how to do Arch and I downloaded a PKGBUILD and files and ran "makepkg -s" and am getting:

=> ERROR: Running makepkg as root is a BAD idea and can cause
    permanent, catastrophic damage to your system. If you
    wish to run as root, please use the --asroot option.

All the compiling I've done  before coming to Arch I've done as root so that I can install it.  I'm guessing that the problem here is that makepkg uses a fakeroot??  Also I've been using yaourt to build a couple packages and wouldn't it have been building with makepkg as root?  Is the system bonked now?  Just how can this be catastrophic to my system?

Last edited by Gen2ly (2009-03-15 03:42:34)


Setting Up a Scripting Environment | Proud donor to wikipedia - link

Offline

#2 2009-03-15 03:48:13

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Why is running makepkg as root a bad idea?

If you run as root, makepkg can put files anywhere on your system rather than just in $pkgdir where that package is made from.  This is stopped by using fakeroot, which is disabled when run as root.

Offline

#3 2009-03-15 03:57:04

Xyne
Administrator/PM
Registered: 2008-08-03
Posts: 6,963
Website

Re: Why is running makepkg as root a bad idea?

@Allan
Is it also to guard against malevolent install scripts or are those caught by the fakeroot environment too?


My Arch Linux StuffForum EtiquetteCommunity Ethos - Arch is not for everyone

Offline

#4 2009-03-15 04:04:05

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,365
Website

Re: Why is running makepkg as root a bad idea?

If by install scripts, you mean the ones provided in a package source, then yes, it should catch those.

If you mean pacman install scripts, then no, because they are not run until package install.

Offline

#5 2009-03-15 04:26:12

ataraxia
Member
From: Pittsburgh
Registered: 2007-05-06
Posts: 1,553

Re: Why is running makepkg as root a bad idea?

For an example of a package that would be moderately bad to build as root, look at exim. The upstream install attempts to create /etc/aliases directly on the build machine instead of putting it in the package. (The PKGBUILD itself installs it where it belongs.) Running the build in fakeroot blocks the bogus /etc/aliases for being created.

Offline

Board footer

Powered by FluxBB