You are not logged in.

#1 2013-05-11 10:19:59

greenOwl
Member
Registered: 2013-05-08
Posts: 23

[SOLVED] Installing packages/software as root or user?

Hello,

I'm very new to (arch)linux and I can't find a wiki entry or something to aswer my question:
What packages should be installed as root and what packages should be install as user (Work Laptop, only me as user)?
Examples: x-server, xterm, firefox, eclipse.
What is the criterion?

Thanks in advance!

Last edited by greenOwl (2013-05-11 13:14:27)

Offline

#2 2013-05-11 10:25:13

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [SOLVED] Installing packages/software as root or user?

Create a user and run 'sudo <your_username> pacman -Syu foo', where 'foo' is the package you want to install.
It doesn't matter what kind of software. You can install many packages at once.

Last edited by karol (2013-05-11 10:26:10)

Offline

#3 2013-05-11 10:31:52

greenOwl
Member
Registered: 2013-05-08
Posts: 23

Re: [SOLVED] Installing packages/software as root or user?

Why is this better than installing as root?
Is it recommended to add -Syu instead of -S (as I did until now)?

Offline

#4 2013-05-11 10:34:33

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [SOLVED] Installing packages/software as root or user?

Offline

#5 2013-05-11 10:41:22

brebs
Member
Registered: 2007-04-03
Posts: 3,408

Re: [SOLVED] Installing packages/software as root or user?

greenOwl wrote:

Why is this better than installing as root?

The installation *is* done as root - it has to be, only root can do that.

However, the compilation step doesn't need to be done as root, and therefore, for good security, shouldn't be done as root.

Having said that, doing it all as root is very convenient in source-based distros such as Sourcemage and Lunar, because additional steps such as running gtk-update-icon-cache are done automatically by the app's build scripts.

Offline

#6 2013-05-11 10:52:51

greenOwl
Member
Registered: 2013-05-08
Posts: 23

Re: [SOLVED] Installing packages/software as root or user?

Hm I'm having a problem with sudo on this one:

[EDIT]
Got it sudo pacman -Syu working. Can't install packages though because sudo pacman -Syu packagename is not allowed. How can I allow to install packages without explicitly allowing a package?

Last edited by greenOwl (2013-05-11 11:02:25)

Offline

#7 2013-05-11 11:03:51

karol
Archivist
Registered: 2009-05-06
Posts: 25,423

Re: [SOLVED] Installing packages/software as root or user?

Offline

#8 2013-05-11 12:53:33

greenOwl
Member
Registered: 2013-05-08
Posts: 23

Re: [SOLVED] Installing packages/software as root or user?

So I read the article you link, tried google etc, but I cant figure out how to configure sudo to specificly allow
pacman -Syu anypackage
without setting the accessrights to ALL.

Offline

#9 2013-05-11 13:03:49

Spider.007
Member
Registered: 2004-06-20
Posts: 1,135
Website

Re: [SOLVED] Installing packages/software as root or user?

From `man sudoers`

Wildcards
     sudo allows shell-style wildcards (aka meta or glob characters) to be
     used in host names, path names and command line arguments in the sudoers
     file.  Wildcard matching is done via the POSIX glob(3) and fnmatch(3)
     routines.  Note that these are not regular expressions.

     *         Matches any set of zero or more characters.

     ?         Matches any single character.

     [...]     Matches any character in the specified range.

     [!...]    Matches any character not in the specified range.

     \x        For any character ‘x’, evaluates to ‘x’.  This is used to
               escape special characters such as: ‘*’, ‘?’, ‘[’, and ‘]’.

     POSIX character classes may also be used if your system's glob(3) and
     fnmatch(3) functions support them.  However, because the ‘:’ character
     has special meaning in sudoers, it must be escaped.  For example:

         /bin/ls [[alpha]]*

     Would match any file name beginning with a letter.

So you should just be able to allow pacman -Syu * and you're done?

Offline

#10 2013-05-11 13:08:40

HalosGhost
Member
From: Twin Cities, MN
Registered: 2012-06-22
Posts: 1,486
Website

Re: [SOLVED] Installing packages/software as root or user?

Okay, the correct way of doing this would be through a clean shell script similar to the one here for instance. Then, allow for that shell script to be run without a password.

But, I'm not going to lie, this is a terrible idea. Like, seriously. Just type in your password, it takes like 10 more seconds and you don't get a giant security hole.

All the best,

-HG


"All errors are ᴘᴇʙᴋᴀᴄ errors—It's just a matter of narrowing down which keyboard and chair." -Trilby
\ldots

Offline

#11 2013-05-11 13:10:14

greenOwl
Member
Registered: 2013-05-08
Posts: 23

Re: [SOLVED] Installing packages/software as root or user?

That is what I was looking for Spider.007! I read the man but I think I confused the shell wildcards with the EBNF wildcards.
Thanks

Last edited by greenOwl (2013-05-11 13:11:01)

Offline

Board footer

Powered by FluxBB