1

I'm trying to make a tts program on my Raspberry Pi 3 and I'm using Googles TTS API which requires that I have FLAC installed on the Pi. When I attempt to install FLAC, I'm thrown this error-

pi@raspberrypi:~/pyTTS/images $ sudo apt-get install flac

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  flac
0 upgraded, 1 newly installed, 0 to remove and 131 not upgraded.
Need to get 115 kB of archives.
After this operation, 310 kB of additional disk space will be used.
WARNING: The following packages cannot be authenticated!
  flac
Install these packages without verification? [y/N] y
Err http://mirrordirector.raspbian.org/raspbian/ jessie/main flac armhf 1.3.0-3
  404  Not Found [IP: 93.93.128.193 80]
E: Failed to fetch http://mirrordirector.raspbian.org/raspbian/pool/main/f/flac/flac_1.3.0-3_armhf.deb  404  Not Found [IP: 93.93.128.193 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

I've tried updating and fix-missing, to no avail. I'm interpreting the error message as that the link it's trying to retrieve from is broken. Does anyone know a fix for this? Or an alternative I could use to read FLAC in this context?

2

1 Answer 1

1

As already pointed out, apt support for jessie is no longer available, and your best bet may be to upgrade your OS. However, that's not your only option for getting flac installed on your jessie system.

Three options for installing flac (and most other apps) on your jessie system are:

  1. use the archives
  2. "backport" flac
  3. build and install flac from its upstream sources

N.B. I haven't tried all of this myself - I don't have a system older than buster. And I can't say which might be best or easiest; I think that's dependent on your end objective, and on flac itself. A quick overview of these options follow. You can find more details online in a search, but here's the gist of it:

1. use the archives:

The archives are a useful resource; the trick is navigating them to find what you need. Ideally, we could still find a .deb package for flac that's compatible with jessie; that would make installation easy: dpkg -i flac.deb. If you can't find a compatible flac.deb, one alternative is to build flac from source... but building a package from source requires the proper tool: devscripts - which you may or may not have installed on your system.

I could go on & on with this, but let me instead provide the following list. If you elect to pursue this option, we can ponder the details.

If you peruse these URLs, I think you'll find that the .deb option only goes back to Debian 9, a.k.a. stretch. It might be worth trying to install the stretch version on your jessie system.

After some trial and error to learn the dependencies of flac, I was able to get flac ver 1.3.2 installed on my buster system as follows:

$ wget https://archive.raspbian.org/raspbian/pool/main/libo/libogg/libogg0_1.3.2-1+b2_armhf.deb 
$ wget https://archive.raspbian.org/raspbian/pool/main/f/flac/libflac8_1.3.2-2+deb9u2_armhf.deb 
$ wget https://archive.raspbian.org/raspbian/pool/main/f/flac/flac_1.3.2-2+deb9u2_armhf.deb
$ sudo dpkg -i libogg0_1.3.2-1+b2_armhf.deb
$ sudo dpkg -i libflac8_1.3.2-2+deb9u2_armhf.deb 
$ sudo dpkg -i flac_1.3.2-2+deb9u2_armhf.deb
$ which flac
/usr/bin/flac
$ flac --version
flac 1.3.2

And so this approach was successful on my buster system. Because of the limited dependencies of flac, I feel this may also work on your jessie system. I don't feel there's much risk involved; dpkg is fairly smart about installing packages, and also has an option for removing whatever it does install. But if it accomplishes nothing else, this drill will increase your appreciation of apt! :)

If you need/want to remove the packages using dpkg, follow this sequence:

$ sudo dpkg --purge flac
$ sudo dpkg --purge libflac8
$ sudo dpkg --purge libogg0

2. backporting:

Backporting is a term for installing newer applications on older systems. There are a couple of decent "how-to" documents specific to Debian located here & here. The flac source packages are located here.

However, backporting may require (certainly they make it easier) some specialized tools in devscripts - and as we've seen already, the devscripts package in .deb format isn't available for jessie. That makes backporting seem a much less feasible option - at least, I'm not inclined to try it.

3. build and install from upstream sources:

AFAIK, gcc (GNU C compiler) and git are included with all RPi distros. With these tools, you should be able to download (clone), build and install from the flac GitHub repository. If you were doing this on an apt-supported system (as of today, that's buster or bullseye), I would strongly urge you to install this with Stow, but we can get by without it:

  • clone the flac repo into a folder flac in your home dir:
$ git clone https://github.com/xiph/flac.git 
$ cd flac
  • follow the build & install instructions in the README file in the section Building in a GNU environment: Unfortunately, there seem to be some missing pieces from this puzzle: There is no config file in the repo! Hopefully this will be corrected soon, but in the meantime, it appears Option 1 is all that's available.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.