Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Calibre

Notices

Reply
 
Thread Tools Search this Thread
Old 04-27-2018, 02:24 PM   #1
fishcasa
Junior Member
fishcasa began at the beginning.
 
Posts: 4
Karma: 10
Join Date: Mar 2015
Device: Samsung Note 10.1
Install script fails on Ubuntu 18.04

FYI,
After a clean install of Ubuntu 18.04, the install script
Code:
~$ sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
failed with
Code:
sudo: python: command not found
Cannot write to ‘-’ (Success).
after changing
Code:
python
to
Code:
python3
in the install command, it worked.
fishcasa is offline   Reply With Quote
Old 04-27-2018, 02:51 PM   #2
gbm
Wizard
gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.gbm ought to be getting tired of karma fortunes by now.
 
Posts: 2,101
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
Quote:
Originally Posted by fishcasa View Post
FYI,
After a clean install of Ubuntu 18.04, the install script
Code:
~$ sudo -v && wget -nv -O- https://download.calibre-ebook.com/linux-installer.py | sudo python -c "import sys; main=lambda:sys.stderr.write('Download failed\n'); exec(sys.stdin.read()); main()"
failed with
Code:
sudo: python: command not found
Cannot write to ‘-’ (Success).
after changing
Code:
python
to
Code:
python3
in the install command, it worked.
ReleaseNotes for Ubuntu 18.04

Quote:
Python 2 is no longer installed by default. Python 3 has been updated to 3.6. This is the last LTS release to include Python 2 in main.
So according to this the next Ubuntu LTS will not have Python 2 in the repository.


bernie
gbm is offline   Reply With Quote
Advert
Old 04-27-2018, 10:28 PM   #3
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,159
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The installer works fine with either python2 or python3. If Ubuntu is really releasing with no /usr/bin/python that is a bug in Ubuntu. They should have a python symlinked to python3 by default if they want to make python3 the default python. Otherwise there is no way to run scripts (like the installer) that are compatible with both python2 and python3.

Quoting https://www.python.org/dev/peps/pep-0394/
Quote:
One exception to this is scripts that are deliberately written to be source compatible with both Python 2.x and 3.x. Such scripts may continue to use python on their shebang line without affecting their portability.
Of course given how generally broken packages in Ubuntu are, chances are they wont fix this, so I will have to figure out some workaround specially for them. The number of Ubuntu specific workarounds in calibre is not funny.
kovidgoyal is offline   Reply With Quote
Old 04-28-2018, 12:56 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,159
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I've updated the install command to use a wrapper script that embeds the installer and launches it with the appropriate python after searching the system. Sigh.

Note that the old install command also continues to work, the same as before.
kovidgoyal is offline   Reply With Quote
Old 04-29-2018, 04:47 AM   #5
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Wow, this is just... precious. (Noticed when I saw https://github.com/kovidgoyal/calibr...ad5f0d79f8bba2 show up, really made my day BTW. )

I hate to burst your bubble again, by the way... but Debian, and therefore Ubuntu, provides at least one officially supported /bin/sh implementation whose sole reason for existing is to provide the strictly POSIX-only functionality required for the most minimal shell ever. And... Debian being Debian, their policies specify POSIX SUSv3 (2004) as the target conformity thingy... which means this debian-specific shell does not support `command -v` as per HERE.

(Let's leave aside the issue of their running to SUSv3 spec, while at the same time claiming the local keyword is so important as to merit special exceptions... then also claiming they desperately need echo -n even though printf is already mandated by POSIX.)

(Why do I know this? I once made the stupid mistake of trying to improve Debian code: https://bugs.debian.org/cgi-bin/bugr...cgi?bug=889676)

Yes, they're freaking insane. But this script is meant to workaround Debian/Ubuntu bugs... so all things considered I would seriously recommend instructing people to run this script using GNU bash just in case. Or simply trying to find the location of a python3 binary to workaround not having a python one will fail for the poor souls who installed posh as their Policy-compliant Ordinary SHell.

You could, of course, try to rely on the "which" binary which is not guaranteed to exist anywhere (Debian has it as essential, Arch has it in base but people keep removing it anyway). Or just hardcode the possibilities in /usr/bin/
But I think it makes more sense to just assume a decent shell like bash, which really should be on any Linux system without exception.

Well, so much for universal scripting languages on Linux. Turns out you always need GNU bash in the end.

...

Minor errata:
Code:
$PYTHON -c "stuff; script_launch()" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" <<'HEREDOC'
Could be replaced by:
Code:
$PYTHON -c "stuff; script_launch()" "$@" <<'HEREDOC'
Simpler, more readable, works even in POSIX (both the decade-old Debian standard and the 5-year-old standard they vaguely intend to upgrade to, probably by the year 2030), arguably offers more future-proofing. Silently dropping additional args should be done in one place, inside the wrapped python script.

Last edited by eschwartz; 04-29-2018 at 04:52 AM.
eschwartz is offline   Reply With Quote
Advert
Old 04-29-2018, 05:36 AM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,159
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
I dislike the terrible habit people have of hardcoding bash everywhere. Let's see if there are actually any poor souls out there that use posh as /bin/sh and also want to install calibre. If so I can probably just re-implement command -v using IFS in the script.
kovidgoyal is offline   Reply With Quote
Old 04-29-2018, 12:13 PM   #7
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)
Fair enough. At least you'll know exactly what the issue is now, if it ever does come up.
eschwartz is offline   Reply With Quote
Old 04-29-2018, 11:00 PM   #8
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 44,159
Karma: 22670164
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Just for giggles, here it is with no command -v

https://github.com/kovidgoyal/calibr...b04f11c4781ac8
kovidgoyal is offline   Reply With Quote
Old 04-30-2018, 04:18 AM   #9
Divingduck
Wizard
Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.Divingduck ought to be getting tired of karma fortunes by now.
 
Posts: 1,165
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
nice
Divingduck is offline   Reply With Quote
Old 05-01-2018, 12:11 AM   #10
eschwartz
Ex-Helpdesk Junkie
eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.eschwartz ought to be getting tired of karma fortunes by now.
 
eschwartz's Avatar
 
Posts: 19,421
Karma: 85397180
Join Date: Nov 2012
Location: The Beaten Path, USA, Roundworld, This Side of Infinity
Device: Kindle Touch fw5.3.7 (Wifi only)


I'm not convinced of the *necessity* of avoiding GNU bash, but that is certainly one way to do it. Now what are the odds that Ubuntu people will take notice of people resorting to these workarounds... none, of course!
eschwartz is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Source Install Fails on Ubuntu 11.04 chris1412 Library Management 2 09-14-2011 09:15 AM
Uber Calibre script - ubuntu sam_uk Library Management 9 02-25-2011 09:02 AM
Ubuntu Calibre 6.46 Install fails theducks Calibre 24 04-02-2010 09:27 AM
Economist script fails with index error 0.6.17 MTBSJC Calibre 7 10-18-2009 04:10 PM
calibre install fails on Ubuntu hardy Xpi6 Calibre 16 11-16-2008 01:29 PM


All times are GMT -4. The time now is 09:09 AM.


MobileRead.com is a privately owned, operated and funded community.