dumb root install question

The place to post if you need help or advice

Moderators: ChrisThornett, LXF moderators

dumb root install question

Postby guy » Sun May 26, 2013 1:01 pm

My regular user account is "not in the sudoers file" so on the rare occasions I need a command shell with root privilege I am accustomed to opening a root terminal.

An app (Calibre) website says it needs installing from the command line and gives me a script beginning "sudo".

If I omit the sudo and run in a root terminal, will my ordinary user account be able to use Calibre, or would some chmod or similar permissions magic be needed to set that up?

I should add, using debian.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby roseway » Sun May 26, 2013 6:08 pm

Why don't you just install it from the Debian repos?

Code: Select all
aptitude (or apt-get) install calibre


But the answer to your actual question is that Debian doesn't use sudo in the Ubuntu way by default, and any administrative task can be accomplished just as well (better I would say) without the use of sudo. Running an installation script as root is no different from running it with sudo.
Eric
roseway
LXF regular
 
Posts: 450
Joined: Thu Jan 18, 2007 2:27 pm

Postby guy » Sun May 26, 2013 9:36 pm

Cheers, I'll use my root shell - have to be tomorrow, now.

The version in the Debian repo is an old one and the Calibre web site advises using the current one.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby guy » Mon May 27, 2013 8:58 pm

Root shell worked great. Happy ePUB creator now at play. :)
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby roseway » Tue May 28, 2013 6:41 am

I should have said this before, but I'll say it now anyway: installing programs this way poses a bit of a risk of some conflict occurring in the future, because the package management system doesn't know anything about the installed software.

The proper (and safe) way to do this would be to wrap the install script up in a Debian package so that the package management system does know about it. The easy way to do this is to use checkinstall:

Code: Select all
# checkinstall install.sh


It asks you a couple of simple questions and then makes a .deb package and installs it. All you need to do is make sure that the version number is correctly noted (that's one of the questions you get asked).
Eric
roseway
LXF regular
 
Posts: 450
Joined: Thu Jan 18, 2007 2:27 pm

Postby guy » Tue May 28, 2013 10:00 am

That would have been a good idea, yes. I don't suppose any of the GUI tools can to that?
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby roseway » Tue May 28, 2013 11:34 am

No, I don't think that there's a GUI front end for checkinstall, but it's really very easy to use from the command line.
Eric
roseway
LXF regular
 
Posts: 450
Joined: Thu Jan 18, 2007 2:27 pm

Postby guy » Tue May 28, 2013 5:39 pm

Um, so, I'd create an install script file called say calibreinstall.sh and containing say:

python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')"

Then I'd open a root shell and do:

# checkinstall calibreinstall.sh

Right?

Could I even just run it all together, as in:

# checkinstall python -c "import sys; py3 = sys.version_info[0] > 2; u = __import__('urllib.request' if py3 else 'urllib', fromlist=1); exec(u.urlopen('http://status.calibre-ebook.com/linux_installer').read()); main(install_dir='/opt')"

or would that do horrible things?
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby roseway » Tue May 28, 2013 5:57 pm

I've had a look at the Calibre website, and I see what you mean. There isn't an install script as such, but just a command to run. I've tried running it with checkinstall but it failed with several errors. I have no doubt it can be solved, but for the moment I don't have a solution.
Eric
roseway
LXF regular
 
Posts: 450
Joined: Thu Jan 18, 2007 2:27 pm

Postby guy » Tue May 28, 2013 6:52 pm

Hey, you mean I did the right thing? That doesn't happen very often, grin. Many thanks for your help.
Cheers,
Guy
The eternal help vampire
User avatar
guy
LXF regular
 
Posts: 1078
Joined: Thu Apr 07, 2005 12:07 pm
Location: Worcestershire

Postby roseway » Tue May 28, 2013 9:44 pm

I'm not sure that I did much, but you're welcome anyway. :)
Eric
roseway
LXF regular
 
Posts: 450
Joined: Thu Jan 18, 2007 2:27 pm


Return to Help!

Who is online

Users browsing this forum: pedros and 6 guests