Skip to content
dinkypumpkin edited this page Oct 12, 2023 · 99 revisions

Linux/BSD manual installation

(Return to Installation ToC)

Linux/BSD installation of get_iplayer is NOT supported by the developers. The instructions below are only a general guide to installing get_iplayer. Adjust as needed to suit your Linux/BSD system.

Perl

Perl is part of the base system for most Linux/BSD distros. If not, it will almost certainly be available in your system's package repositories.

Required packages

Perl modules required by get_iplayer should be available in the package repositories for your system. However, the naming convention for packaged Perl modules differs between distros. Generally speaking, a module's namespace separator ("::") is replaced by a hyphen, a prefix (and sometimes a suffix) are added, and the name is sometimes changed to lower case. The package names for the LWP, LWP::Protocol::https, Mojolicious, XML::LibXML and CGI modules in some different distros are:

  • DEB-based (e.g., Debian, Ubuntu, Mint): libwww-perl liblwp-protocol-https-perl libmojolicious-perl libxml-libxml-perl libcgi-pm-perl
  • RPM-based (e.g., Fedora, CentOS): perl-libwww-perl perl-LWP-Protocol-https perl-Mojolicious perl-XML-LibXML perl-CGI
  • Ports-based (e.g, OpenBSD, FreeBSD): p5-libwww p5-LWP-Protocol-https p5-Mojolicious p5-XML-LibXML p5-CGI
  • pacman-based (e.g., Arch Linux, Manjaro): perl-libwww perl-lwp-protocol-https perl-mojolicious (from AUR) perl-xml-libxml perl-cgi

Users of Perl 5.20 and earlier do not need to install the CGI module separately.

For example, to install the packages for get_iplayer dependencies in Debian 9+/Ubuntu 18.04+/Mint 19+:

apt install libwww-perl liblwp-protocol-https-perl libmojolicious-perl libxml-libxml-perl libcgi-pm-perl

Replace the command above with the appropriate package names and installation command for your system (e.g., dnf install, yum install, pkg_add, pkg install, pacman -S). If you are not logged in as root, you will need to run your installation commands with sudo.

Note that the package for LWP::Protocol::https may be automatically installed with the package for LWP, but that varies by distro. To be safe you should specify it separately in your install command.

local::lib and missing/obsolete Perl modules

Some required Perl modules may not be installed with the above packages, and others such as Mojolicious may not be packaged for your distro, or may be obsolete. If so, you can create a local module library with cpanminus and local::lib and install Perl modules from CPAN. Package names for cpanminus and local::lib in some different distros are:

  • DEB-based (e.g., Debian, Ubuntu, Mint): cpanminus liblocal-lib-perl
  • RPM-based (e.g., Fedora, CentOS): perl-App-cpanminus perl-local-lib
  • Ports-based (e.g, OpenBSD, FreeBSD): p5-App-cpanminus p5-local-lib
  • pacman-based (e.g., Arch Linux, Manjaro): perl-app-cpanminus perl-local-lib

NOTE: Developer tools (gcc, make, etc.) are required to install some Perl modules. Refer to your distro documentation for help installing those tools. For example, Debian/Ubuntu/Mint provides the "build-essential" package.

For example, to install the required packages in Debian 9+/Ubuntu 18.04+/Mint 19+:

apt install build-essential cpanminus liblocal-lib-perl

Replace the command above with the appropriate package names and installation command for your system (e.g., dnf install, yum install, pkg_add, pkg install, pacman -S). If you are not logged in as root, you will need to preface installation commands with sudo.

If cpanminus and local::lib are not packaged for your system, you can install them under your home directory with:

wget -O- https://cpanmin.us | perl - -l ~/perl5 App::cpanminus local::lib

Developer tools must be installed separately.

Once cpanminus and local::lib are installed, configure your local module library in ~/perl5:

# set configuration for current shell
eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
# set configuration for future sessions
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profile

This example is for the bash shell. You may also prefer to initialise your environment in ~/.bashrc (for non-login shells) and source that file from ~/.bash_profile. The "eval" statement initialises environment variables necessary for local::lib to function. If you are not using bash, use the appropriate initialisation mechanism for your shell.

From: https://stackoverflow.com/questions/2980297/how-can-i-use-cpan-as-a-non-root-user

Once your local library is configured and developer tools are installed, you can install modules with cpanm Module::Name [Module::Name ...]. Before using your local library, make sure any missing modules are not available via the system package manager. Your local library should contain just the additional Perl modules you need. You can install all get_iplayer dependencies in your local library, but often only a hybrid installation is necessary.

To install all get_iplayer dependencies in local library:

cpanm LWP LWP::Protocol::https XML::LibXML Mojolicious CGI

NOTE: Do not preface the cpanm command with sudo since it is installing modules in your local library, which is inside your home directory.

Example of hybrid installation: CentOS 7

If you are not logged in as root, you will need to preface your installation commands with sudo.

Install Perl along with cpanminus and local::lib:

yum install perl-core perl-App-cpanminus perl-local-lib

Install developer tools (for building Perl Modules in your local library):

yum groupinstall 'Development Tools'

Install available Perl modules with package manager as described above:

yum install perl-libwww-perl perl-LWP-Protocol-https perl-XML-LibXML perl-CGI

Configure local module library inside your home directory as described above:

eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`
echo 'eval `perl -I ~/perl5/lib/perl5 -Mlocal::lib`' >> ~/.bash_profile

Install/upgrade missing/obsolete Perl Modules in your local library with cpanminus:

cpanm Mozilla::CA IO::Socket::SSL List::Util Mojolicious

NOTE: Do not preface the cpanm command with sudo since it is installing modules in your local library, which is inside your home directory.

External programs

The external programs used by get_iplayer should be available in the package repositories for your system. The package name will usually be the same as the program itself, though not always. For example, to install the external programs for get_iplayer in Debian 9+/Ubuntu 18.04+/Mint 19+:

apt install atomicparsley ffmpeg

Replace the command above with the appropriate package names and installation command for your system (e.g., , dnf install, yum install, pkg_add, pkg install, pacman -S). If you are not logged in as root, you will need to preface your installation commands with sudo.

A few distros may not have packaged versions of ffmpeg or AtomicParsley in their repositories. You may be able to acquire external programs from unofficial repositories, or see the instructions below. Check your distro's repositories before installing.

NOTE: Some distros may support multiple versions of ffmpeg using an "alternatives" system. Install and configure the most recent version available if possible. If the most recent version is not configured as "ffmpeg", use the --ffmpeg option to configure get_iplayer to use the most recent version directly, e.g., --ffmpeg=ffmpeg4.

NOTE: Users of Ubuntu/Mint versions before 18.04/19 should NOT install ffmpeg or AtomicParsley from default repositories. Use the instructions below instead.

get_iplayer uses ffmpeg to convert raw downloads to MP4/M4A files. Old Linux distros or long-term support releases do not provide a modern version of ffmpeg (3.0+) that can support all of the raw formats used. In particular, users of Debian/Raspbian 8 (jessie) and below, Ubuntu 16.04 and below, and Mint 18.x and below must install a modern version of ffmpeg (3.0+), which is not available from default repositories. Check the version with ffmpeg -version, or check the version with your package manager. You can install a static build of the latest ffmpeg from https://johnvansickle.com/ffmpeg. Use the commands below as a guide to install and configure a suitable version of ffmpeg for get_iplayer. Change "amd64” to "i686” for 32-bit systems. For Raspberry Pi, change "amd64" to “armhf” or "armel” as appropriate. If you're not sure which, try "armhf” first. An "arm64" version is also available. Requires kernel version 3.2.0 or above.

wget https://johnvansickle.com/ffmpeg/releases/ffmpeg-release-amd64-static.tar.xz
tar -xf ffmpeg-release-amd64-static.tar.xz
sudo install -m 755 ffmpeg-*-static/ffmpeg /usr/local/bin
get_iplayer --prefs-add --ffmpeg=/usr/local/bin/ffmpeg

By installing a separate static build of ffmpeg, you can support get_iplayer without interfering with your system's ffmpeg or libav packages and their dependents. If you use one of the ffmpeg static builds, please consider making a donation towards their maintenance. Their maintainer is not affiliated with get_iplayer.

get_iplayer uses AtomicParsley to add metadata tags to downloaded media files, but some distros only provide an outdated version, or none at all. If your version of AtomicParsley is <0.9.4, it is recommended that you install a modern version if possible. Check the version with AtomicParsley --version, or check the version with your package manager. Use the commands below as a guide to install and configure a suitable version of AtomicParsley for get_iplayer. Builds are for Intel/AMD only. Change "x86_64" to "i386" for 32-bit systems. No Raspberry Pi or other ARM version is available. Requires kernel version 3.2.0 or above.

wget https://github.com/get-iplayer/atomicparsley/releases/download/0.9.7-get_iplayer.4/AtomicParsley-0.9.7-get_iplayer.4-linux-x86_64-static.zip
unzip AtomicParsley-0.9.7-get_iplayer.4-linux-x86_64-static.zip AtomicParsley
sudo install -m 755 AtomicParsley /usr/local/bin
get_iplayer --prefs-add --atomicparsley=/usr/local/bin/AtomicParsley

NOTE: Does not work on WSL 1 (Windows Subsystem for Linux v1), but does work on WSL 2.

Command-line interface (CLI)

  1. Download the latest get_iplayer CLI release to working directory

     wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer
    
  2. Install get_iplayer CLI script

     install -m 755 ./get_iplayer /usr/local/bin
    

    If /usr/local/bin is not in $PATH, use another location appropriate for your system, e.g., /usr/bin.

    NOTE: If you are not logged is as root, you will need to preface your install command with sudo.

  3. Run CLI at a command prompt

     get_iplayer [...]
    

    Upon launch, get_iplayer will update its programme index cache if necessary. If yours is a new installation, the update will take longer than usual since get_iplayer will be building a full 30-day cache.

Web PVR Manager (WPM)

  1. Download the latest get_iplayer WPM release to working directory

     wget https://raw.githubusercontent.com/get-iplayer/get_iplayer/master/get_iplayer.cgi
    
  2. Install get_iplayer.cgi WPM script

     install -m 755 ./get_iplayer.cgi /usr/local/bin
    

    If /usr/local/bin is not in $PATH, use another location appropriate for your system, e.g., /usr/bin.

    NOTE: If you are not logged is as root, you will need to preface your install command with sudo.

  3. Launch the WPM server at a command prompt

     get_iplayer.cgi --listen 127.0.0.1 --port 1935
    
  4. Once the WPM server is running, connect to it by opening http://127.0.0.1:1935 in your web browser.

  5. After the WPM has opened in your browser, select the programme types (e.g., BBC TV, BBC Radio) you wish to index, then click the Refresh Cache button. A new tab or window will open that shows the cache being refreshed. If yours is a new installation, the update will take longer than usual since get_iplayer will be building a full 30-day cache.

  6. Stop the WPM by typing Ctrl-C.

Upgrading

Check for new releases at the following URL:

https://github.com/get-iplayer/get_iplayer/releases

You can also check for new releases from the command line:

get_iplayer --release-check

Add to preferences for automatic weekly check:

get_iplayer --prefs-add --release-check

A notification message will be printed in your get_iplayer output once per week.

Updates can also be tracked with a feed from the GitHub repository:

https://github.com/get-iplayer/get_iplayer/releases.atom

There is no need to uninstall the previous version of get_iplayer before installing a new version. You can simply download and install get_iplayer over the previous version. However, if you prefer to uninstall and re-install, that should work as well. The system package manager will handle upgrades to any packaged dependencies.

Uninstalling

There is no recommended procedure for uninstalling a manual installation. Generally, you should simply reverse the procedure you employed for installation. If you installed any Perl modules using local::lib (as described above), they can be uninstalled with cpanm -U Module::Name ....

Tutorials

Once get_iplayer is installed, check out some tutorials to help you get started.

Clone this wiki locally