![]() |
#1 |
Junior Member
![]() 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()" Code:
sudo: python: command not found Cannot write to ‘-’ (Success). Code:
python Code:
python3 |
![]() |
![]() |
![]() |
#2 | ||
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,101
Karma: 8796704
Join Date: Jun 2010
Device: Kobo Clara HD,Hisence Sero 7 Pro RIP, Nook STR, jetbook lite
|
Quote:
Quote:
bernie |
||
![]() |
![]() |
Advert | |
|
![]() |
#3 | |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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:
|
|
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#5 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. ![]() ... Minor errata: Code:
$PYTHON -c "stuff; script_launch()" "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" <<'HEREDOC' Code:
$PYTHON -c "stuff; script_launch()" "$@" <<'HEREDOC' Last edited by eschwartz; 04-29-2018 at 04:52 AM. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#7 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
![]() |
![]() |
![]() |
![]() |
#8 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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 |
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,165
Karma: 1410083
Join Date: Nov 2010
Location: Germany
Device: Sony PRS-650
|
nice
![]() |
![]() |
![]() |
![]() |
#10 |
Ex-Helpdesk Junkie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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! |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |