LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 07-12-2014, 06:09 PM   #1
khronosschoty
Member
 
Registered: Jul 2008
Distribution: Slackware
Posts: 648
Blog Entries: 2

Rep: Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514Reputation: 514
cannot use pkgtool unless root


Hey can I add the ability to use pkgtool with sudo?
 
Old 07-12-2014, 06:13 PM   #2
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by empcrono View Post
Hey can I add the ability to use pkgtool with sudo?
It will work for sudo user, nothing to "add" except that you will need to use the full path, or append /sbin/ to the user's path.

Code:
sudo /sbin/pkgtool

Or

export PATH=$PATH:/sbin
sudo pkgtool

Last edited by astrogeek; 07-12-2014 at 06:29 PM.
 
Old 07-12-2014, 07:19 PM   #3
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,266
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
IMHO, I wouldn't use sudo; esp. not the generic config that ships with Slackware. You might have issues with some packages not installing correctly. pkgtool etc, as well as the packages themselves (esp. if they have a doinst.sh script) assume a fully root environment. Use "su -" to log into a root evironment.
 
Old 07-12-2014, 08:06 PM   #4
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Try "sudo -i pkgtool" to allow sudo to initialize root's login environment before executing pkgtool.

Eric
 
Old 07-12-2014, 08:43 PM   #5
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Alien Bob View Post
Try "sudo -i pkgtool" to allow sudo to initialize root's login environment before executing pkgtool.

Eric
Yes, that will cause pkgtool to run with the full root environment, but I think you must still use the full path to pkgtool or it will not be found if /sbin is not in the user's PATH.

I am in Slackware 12.1 at the moment, and this works as I have noted in the past:

Code:
sudo -i pkgtools
-bash: pkgtools: No such file or directory

sudo -i /sbin/pkgtools
(works)
That has never made sense to me.

UPDATE: - On the other hand, I agree with others that for package management in particular, you should just su - to root, which is my own habit... (did you ever wish that you had not made a quick reply to a particular thread?... )

Last edited by astrogeek; 07-12-2014 at 09:04 PM.
 
Old 07-12-2014, 08:55 PM   #6
ReaperX7
LQ Guru
 
Registered: Jul 2011
Location: California
Distribution: Slackware64-15.0 Multilib
Posts: 6,558
Blog Entries: 15

Rep: Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097Reputation: 2097
I would recommend just using an "su terminal" session. Sudo is not a good replacement for running root admin applications like pkgtool.
 
1 members found this post helpful.
Old 07-12-2014, 09:04 PM   #7
kingbeowulf
Senior Member
 
Registered: Oct 2003
Location: WA
Distribution: Slackware
Posts: 1,266
Blog Entries: 11

Rep: Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744Reputation: 744
A pox on "sudo"....
 
Old 07-12-2014, 09:39 PM   #8
Alien Bob
Slackware Contributor
 
Registered: Sep 2005
Location: Eindhoven, The Netherlands
Distribution: Slackware
Posts: 8,559

Rep: Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106Reputation: 8106
Quote:
Originally Posted by astrogeek View Post
I am in Slackware 12.1 at the moment, and this works as I have noted in the past
Yeah well Slackware moved on, and so did sudo. Please try it again on something like Slackware 14.1, you will notice the difference.

Eric
 
1 members found this post helpful.
Old 07-13-2014, 01:51 AM   #9
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194Reputation: 4194
Quote:
Originally Posted by Alien Bob View Post
Yeah well Slackware moved on, and so did sudo. Please try it again on something like Slackware 14.1, you will notice the difference.

Eric
You are right, of course.

I keep my long-term use 12.1 instance intact since moving everything to 14.1. It is a live archive of projects that do not need to be, or cannot be updated. I happened to be working in there when I posted and remembered that particular quirk... should have kept quiet until rebooting.

Thanks
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
pkgtool - where is it dannemil Slackware 6 11-30-2007 07:51 AM
pkgtool does nothing?! alienDog Slackware 8 10-31-2004 05:11 PM
Pkgtool Corallis Slackware 6 09-01-2004 11:49 PM
using pkgtool ivans Slackware 2 05-28-2003 09:37 PM
pkgtool ktindle Slackware 4 12-15-2002 04:14 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 07:27 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration