Notes on SABnzbd PPA on Raspbian

Support for the Debian/Ubuntu package, created by JCFP.
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Notes on SABnzbd PPA on Raspbian

Post by sander »

Raspbian is based on Debian Wheezy. That means you can use the SABnzbd PPA on Raspbian if you follow the instructions on http://forums.sabnzbd.org/viewtopic.php?f=16&t=9844. Because it's wheezy, and like the said instruction tells you, you should put "precise" in the command, just like this:

Code: Select all

echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main" | sudo tee -a /etc/apt/sources.list && sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x98703123E0F52B2BE16D586EF13930B14BB9F05F
HTH

-----------------------------------------------------------

Long / more details:


You can use the SABnzbd PPA on Raspbian, with just one small delta against the instruction on http://wiki.sabnzbd.org/install-ubuntu-repo

The line

Code: Select all

echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu $(lsb_release -c -s) main" | sudo tee -a /etc/apt/sources.list && 
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x98703123E0F52B2BE16D586EF13930B14BB9F05F
did not work for me because of problems with the lsb_release command (see below). Workaround: just put in "precise", so:

Code: Select all

echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main" | sudo tee -a /etc/apt/sources.list && sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:11371 --recv-keys 0x98703123E0F52B2BE16D586EF13930B14BB9F05F
The rest of the instruction does work on Raspbian.

FWIW: Problems with lsb_release:

lsb_release is not installed by default on Raspbian. Install the package "lsb-release" (with a minus, not an underscore) to solve that. However, that won't help much:

Code: Select all

pi@raspberrypi ~ $ echo "deb http://ppa.launchpad.net/jcfp/ppa/ubuntu $(lsb_release -c -s) main" 
deb http://ppa.launchpad.net/jcfp/ppa/ubuntu n/a main
So: "n/a" as output? ???

FYI: Ubuntu says something like:

Code: Select all

$ lsb_release -c -s
saucy
Full lsb_release output on Raspbian:

Code: Select all

pi@raspberrypi ~ $ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 7.2 (n/a)
Release:	7.2
Codename:	n/a
FWIW2: Result in /etc/apt/sources.list

Code: Select all

deb http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi
deb-src http://mirrordirector.raspbian.org/raspbian/ wheezy main contrib non-free rpi

deb http://ppa.launchpad.net/jcfp/ppa/ubuntu precise main

HTH
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by jcfp »

The instructions for the ppa target only ubuntu. With anything else out there that uses dpkg there's only one thing to say: ymmv. The very possibility of using this ppa on debian is an exception to the rule: it would be impossible if sabnzbd's code wasn't completely architecture-independent or the packaging not kept at least somewhat compatible. In fact, if you were to go on some debian forum and proudly inform them of your success in using it, you'd be their favorite newbie of the week ...for target practice.

Sometimes helper programs such as add-apt-repository have been modified to get it right, for example by automatically translating their own release names back to the ubuntu equivalent on which they were based. For others such things may not even be present at all. There's simply no way to accurately predict all impact of modifications made by the many derivative distributions around. In case of raspbian, you're looking at a debian derivative. Therefore, best chances are probably with the instructions for updating sab on debian.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by sander »

Thanks for pointing to http://forums.sabnzbd.org/viewtopic.php?f=16&t=9844. That instruction says: "For wheezy, substitute lucid with precise in the first command:"

Can that be changed to "For wheezy and raspbian, substitute lucid with precise in the first command:"?

If so, I can delete this thread, right?
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by jcfp »

I'd prefer to keep the other thread about debian, first and foremost. After all, raspbian is the name of an OS, not any specific verison of it; a future version of raspbian may well not be based on debian wheezy.

If you consider raspbian important/popular enough, just keep this thread (or a cleaned up version of it) and include a link to the debian instructions.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by sander »

Hmmm ... it doesn't look so good after all:

Code: Select all

pi@raspberrypi ~ $ sudo apt-get install sabnzbdplus
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following extra packages will be installed:
  sabnzbdplus-theme-classic sabnzbdplus-theme-smpl
Suggested packages:
  sabnzbdplus-theme-mobile python-notify
The following NEW packages will be installed:
  sabnzbdplus sabnzbdplus-theme-classic sabnzbdplus-theme-smpl
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 0 B/1265 kB of archives.
After this operation, 3990 kB of additional disk space will be used.
Do you want to continue [Y/n]? 
Selecting previously unselected package sabnzbdplus.
(Reading database ... 81669 files and directories currently installed.)
Unpacking sabnzbdplus (from .../sabnzbdplus_0.7.17~beta3-0ubuntu1~jcfp1~precise_all.deb) ...
Selecting previously unselected package sabnzbdplus-theme-classic.
Unpacking sabnzbdplus-theme-classic (from .../sabnzbdplus-theme-classic_0.7.17~beta3-0ubuntu1~jcfp1~precise_all.deb) ...
Selecting previously unselected package sabnzbdplus-theme-smpl.
Unpacking sabnzbdplus-theme-smpl (from .../sabnzbdplus-theme-smpl_0.7.17~beta3-0ubuntu1~jcfp1~precise_all.deb) ...
Processing triggers for man-db ...
Processing triggers for menu ...
Processing triggers for desktop-file-utils ...
Setting up sabnzbdplus (0.7.17~beta3-0ubuntu1~jcfp1~precise) ...
insserv: warning: script 'mathkernel' missing LSB tags and overrides
insserv: There is a loop between service minidlna and mathkernel if stopped
insserv:  loop involving service mathkernel at depth 2
insserv:  loop involving service minidlna at depth 1
insserv: Stopping mathkernel depends on minidlna and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing sabnzbdplus (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of sabnzbdplus-theme-classic:
 sabnzbdplus-theme-classic depends on sabnzbdplus (= 0.7.17~beta3-0ubuntu1~jcfp1~precise); however:
  Package sabnzbdplus is not configured yet.

dpkg: error processing sabnzbdplus-theme-classic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sabnzbdplus-theme-smpl:
 sabnzbdplus-theme-smpl depends on sabnzbdplus (= 0.7.17~beta3-0ubuntu1~jcfp1~precise); however:
  Package sabnzbdplus is not configured yet.

dpkg: error processing sabnzbdplus-theme-smpl (--configure):
 dependency problems - leaving unconfigured
Processing triggers for menu ...
Errors were encountered while processing:
 sabnzbdplus
 sabnzbdplus-theme-classic
 sabnzbdplus-theme-smpl
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@raspberrypi ~ $
Pity. Anything that can be done about this?

FWIW: sabnzbdplus does run, but "sudo apt-get upgrade" keeps complaining after the above (no complaints with sabnzbdplus removed):

Code: Select all

pi@raspberrypi ~ $ sudo apt-get upgrade
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 0 B of additional disk space will be used.
Do you want to continue [Y/n]? 
Setting up sabnzbdplus (0.7.17~beta3-0ubuntu1~jcfp1~precise) ...
insserv: warning: script 'mathkernel' missing LSB tags and overrides
insserv: There is a loop between service minidlna and mathkernel if stopped
insserv:  loop involving service mathkernel at depth 2
insserv:  loop involving service minidlna at depth 1
insserv: Stopping mathkernel depends on minidlna and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing sabnzbdplus (--configure):
 subprocess installed post-installation script returned error exit status 1
dpkg: dependency problems prevent configuration of sabnzbdplus-theme-classic:
 sabnzbdplus-theme-classic depends on sabnzbdplus (= 0.7.17~beta3-0ubuntu1~jcfp1~precise); however:
  Package sabnzbdplus is not configured yet.

dpkg: error processing sabnzbdplus-theme-classic (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of sabnzbdplus-theme-smpl:
 sabnzbdplus-theme-smpl depends on sabnzbdplus (= 0.7.17~beta3-0ubuntu1~jcfp1~precise); however:
  Package sabnzbdplus is not configured yet.

dpkg: error processing sabnzbdplus-theme-smpl (--configure):
 dependency problems - leaving unconfigured
Processing triggers for menu ...
Errors were encountered while processing:
 sabnzbdplus
 sabnzbdplus-theme-classic
 sabnzbdplus-theme-smpl
E: Sub-process /usr/bin/dpkg returned an error code (1)
pi@raspberrypi ~ $ 

Code: Select all

pi@raspberrypi ~ $ sudo dpkg-reconfigure sabnzbdplus
/usr/sbin/dpkg-reconfigure: sabnzbdplus is broken or not fully installed
pi@raspberrypi ~ $
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by jcfp »

sander wrote:Hmmm ... it doesn't look so good after all:

Code: Select all

pi@raspberrypi ~ $ sudo apt-get install sabnzbdplus
[...]
Setting up sabnzbdplus (0.7.17~beta3-0ubuntu1~jcfp1~precise) ...
insserv: warning: script 'mathkernel' missing LSB tags and overrides
insserv: There is a loop between service minidlna and mathkernel if stopped
insserv:  loop involving service mathkernel at depth 2
insserv:  loop involving service minidlna at depth 1
insserv: Stopping mathkernel depends on minidlna and therefore on system facility `$all' which can not be true!
insserv: exiting now without changing boot order!
update-rc.d: error: insserv rejected the script header
dpkg: error processing sabnzbdplus (--configure):
 subprocess installed post-installation script returned error exit status 1
[...]
Pity. Anything that can be done about this?
Fix the problems involving 'mathkernel' and/or 'minidlna' init scripts? You would probably have run into this with any package that installs a service...

The sabnzbdplus script has proper boot dependencies in its INIT INFO section, doesn't interact with either of those, and also doesn't depends on "system facility $all" (=start/stop after/before everything else):

Code: Select all

# Provides:          sabnzbdplus
# Required-Start:    $network $remote_fs
# Required-Stop:     $network $remote_fs
# Should-Start:      $named dbus avahi network-manager wicd
# Should-Stop:       $named dbus avahi network-manager wicd
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
Note that the Should-* indicates weak/optional dependencies. The "$network" facility assures basic networking such as creating the devices and setting up localhost is done, and "$remote_fs" is needed because the entire /usr tree (i.e. /usr/bin/sabnzbdplus) may be on a remote fs.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by sander »

After remvoing sabnzddplus, a apt-get update/upgrade is clean. But I have the idea your post already implies that, and that the init script of another script interferes with sabnzbd?

Code: Select all

pi@raspberrypi ~ $ sagusagu 
Hit http://ppa.launchpad.net precise Release.gpg
Hit http://raspberrypi.collabora.com wheezy Release.gpg                                                                                       
Hit http://archive.raspberrypi.org wheezy Release.gpg                                                                                         
Hit http://ppa.launchpad.net precise Release                                                                                 
Hit http://archive.raspberrypi.org wheezy Release                                                      
Hit http://mirrordirector.raspbian.org wheezy Release.gpg                                              
Hit http://raspberrypi.collabora.com wheezy Release                                                    
Hit http://mirrordirector.raspbian.org wheezy Release                                                  
Hit http://ppa.launchpad.net precise/main armhf Packages             
Hit http://repository.wolfram.com stable Release.gpg                 
Hit http://archive.raspberrypi.org wheezy/main armhf Packages        
Ign http://ppa.launchpad.net precise/main Translation-en             
Hit http://raspberrypi.collabora.com wheezy/rpi armhf Packages        
Hit http://repository.wolfram.com stable Release                      
Ign http://archive.raspberrypi.org wheezy/main Translation-en         
Hit http://mirrordirector.raspbian.org wheezy/main Sources            
Ign http://raspberrypi.collabora.com wheezy/rpi Translation-en
Hit http://mirrordirector.raspbian.org wheezy/contrib Sources
Hit http://mirrordirector.raspbian.org wheezy/non-free Sources
Hit http://mirrordirector.raspbian.org wheezy/rpi Sources
Hit http://mirrordirector.raspbian.org wheezy/main armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/contrib armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/non-free armhf Packages
Hit http://mirrordirector.raspbian.org wheezy/rpi armhf Packages
Hit http://repository.wolfram.com stable/non-free armhf Packages
Ign http://mirrordirector.raspbian.org wheezy/contrib Translation-en
Ign http://mirrordirector.raspbian.org wheezy/main Translation-en
Ign http://mirrordirector.raspbian.org wheezy/non-free Translation-en
Ign http://mirrordirector.raspbian.org wheezy/rpi Translation-en
Ign http://repository.wolfram.com stable/non-free Translation-en
Reading package lists... Done
Reading package lists... Done
Building dependency tree       
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
pi@raspberrypi ~ $

I removed minidlna, but still errors. There is no package 'mathkernel', so I'll have to find which package provides that file. Ah, it contains this line:

Code: Select all

do_start () {
 (cat /usr/share/Mathematica/remotemode.m | /opt/Wolfram/Mathematica/10.0/Executables/wolfram) &
}
So Mathematica. I think it is installed by Raspbian (not by me).

Code: Select all

pi@raspberrypi ~ $ dpkg -S  /etc/init.d/mathkernel
wolfram-engine: /etc/init.d/mathkernel
pi@raspberrypi ~ $ 

pi@raspberrypi ~ $ sudo apt-get remove wolfram-engine 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages will be REMOVED:
  wolfram-engine
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
3 not fully installed or removed.
After this operation, 429 MB disk space will be freed.
Do you want to continue [Y/n]? 
(Reading database ... 82008 files and directories currently installed.)
Removing wolfram-engine ...
Processing triggers for hicolor-icon-theme ...
Processing triggers for desktop-file-utils ...
Processing triggers for shared-mime-info ...
Processing triggers for man-db ...
Setting up sabnzbdplus (0.7.17~rc1-0ubuntu1~jcfp1~precise) ...
[info] SABnzbd+ binary newsgrabber: service not enabled, edit /etc/default/sabnzbdplus.
Setting up sabnzbdplus-theme-classic (0.7.17~rc1-0ubuntu1~jcfp1~precise) ...
Setting up sabnzbdplus-theme-smpl (0.7.17~rc1-0ubuntu1~jcfp1~precise) ...
Processing triggers for menu ...
pi@raspberrypi ~ $ 
Let's see if that goes well ... bingo: update/upgrade is clean, and sabnzbdplus is running. Cool. Thank you.
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by jcfp »

sander wrote:After remvoing sabnzddplus, a apt-get update/upgrade is clean. But I have the idea your post already implies that, and that the init script of another script interferes with sabnzbd?
Yup. Debian wheezy uses a dependency based boot sequence. As a result, every time a package installs a new system service, boot order must be examined in a process that involves all init.d services, not just the new one. This way, even scripts totally unrelated to the package you're installing at the time can cause breakage.

The interwebs claim mathematica gets installed by default on recent raspbian images, so I took a quick look at their init script only to find this mess: :-\ :-[ :'( :(

Code: Select all

#!/bin/sh

PATH=/sbin:/usr/sbin:/bin:/usr/bin

do_start () {
 (cat /usr/share/Mathematica/remotemode.m | /opt/Wolfram/Mathematica/10.0/Executables/wolfram) &
}

do_status () {
 echo "Process ID at: "
 cat /var/run/mathkernel.pid
 echo
 echo "MathLink located at: "
 cat /var/run/mathkernel.link
 echo
}

do_stop () {
 kill -9 `cat /var/run/mathkernel.pid`
 rm /var/run/mathkernel.pid
 rm /var/run/mathkernel.link
}

case "$1" in
  start|"")
	do_start
	;;
  restart|reload|force-reload)
	do_stop
	sleep 4
	do_start
	;;
  stop)
	do_stop
	;;
  status)
	do_status
	exit $?
	;;
  *)
	echo "Usage: mathkernel [start|stop|status]" >&2
	exit 3
	;;
esac

:
...including the complete lack of lsb headers or any other attempt at debian policy compliance, the casual use of 'kill -9' to stop a program and the extra ":" at the end. The wolfram-engine package doesn't even try to hook up the init script (then why is it there in the first place?!); if it did, its own install would probably fail. Instead, as you have seen, its mere presence causes insserv to fail (and thus failure of unrelated packages). Please file a bug report with raspbian and/or wolfram! A clusterfuck like this would be release-critical on debian.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by sander »

And could all this be solved by changing the /etc/init.d/mathkernel script? That would be it?

I can post the problem as described here (but then only wolfram-engine vs minidlna, not sabnzbd). In my experience, filing a bug leads to no reaction (Ubuntu: just each 6 month the automatic mail "can you check if it still happens in the new Ubuntu version" :-( ) or even hostility (Raspbian: "don't tell us how it should work"). So I can just post a FYI ... if I can reproduce it without SABnzbd.

EDIT:

I cannot reproduce it without sabnzbdplus: I removed sabnzbdplus, installed minidlna and wolfram-engine, after which the upgrade/upgrade cycle is still fine. After installing sabnzdplus, the problem as posted appears again. >:(

That makes it difficult for me to post it as a bug in wolfram-engine. I 100% believe you it is, but I will not be able to convince Raspbian people.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by sander »

I googled "insserv: warning: script 'mathkernel' missing LSB tags and overrides" and it points to http://www.raspberrypi.org/forum/viewto ... 6&p=476956

http://www.raspberrypi.org/forum/viewto ... 52#p476952 says to run "dpkg -P minidlna", which removes minidlna. Yes, that's a way to get rid of an error message ... :-(

EDIT:

some more googling leads to http://www.forum-raspberrypi.de/Thread- ... -overrides

So, in /etc/init.d/mathkernel after #!/bin/sh I added

Code: Select all

### BEGIN INIT INFO
# Provides:          mathkernel
# Required-Start:    $local_fs 
# Required-Stop:     $local_fs
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: mathkernel
### END INIT INFO
and the update/upgrade is clean. Or, in plain German: "und dann mault die Installation auch nicht mehr." :D

To be complete, as the poster says: "Ob für mathkernel das Filesystem tatsächlich oben sein muss , weiß ich nicht. Aber es schadet nichts."
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by jcfp »

Fair enough. Just tried to do some closer examination on a debian unstable vm, turns out minidlna is a in a rather disastrous state too: uninstallable, removed from debian testing and full of security holes. Nothing much left to test. Maybe it's minidlna's init script apparently trying to start/stop as late/early as possible by soft-depending on "$all" that triggers this stuff, not the still ridiculous mathkernel script. Either way, I'm fairly certain sab is just getting caught in the crossfire here.

Did you try to install anything with an init script (other than sab) with those two installed? ('apt-file search etc/init.d' for a selection) [never mind, your latest post pretty much answer this one]


Edit: from what I can tell, the mathkernel script never actually does anything other than take up disk space and/or get in the way. So rendering it harmless (all comments, no content) like your german connection did is probably best.
User avatar
sander
Release Testers
Release Testers
Posts: 8811
Joined: January 22nd, 2008, 2:22 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by sander »

I just posted a resume on http://www.raspberrypi.org/phpBB3/viewt ... 66&t=68263

Thank you for your help.

@jcfp: have you got a Raspi? If not, do you want root-access to one? Let me know.
User avatar
jcfp
Release Testers
Release Testers
Posts: 986
Joined: February 7th, 2008, 12:45 pm

Re: Notes on SABnzbd PPA on Raspbian

Post by jcfp »

Don't have one.Thanks for the offer, but my todo list is getting longer by the day already, so I'd prefer not to spend yet more time on bug hunting in packages I don't maintain myself for now.
Post Reply