Unable to locate package libffi and libffi5-dev on Ubuntu 12.04.4 through apt-get

$ sudo apt-get install libffi libffi5-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libffi
E: Unable to locate package libffi5-dev

another try:

$ sudo apt-get install libffi5 libffi-dev
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libffi5

and

$ cat /etc/issue  
Ubuntu 12.04.4 LTS \n \l

What am I supposed to do now?


The packages are be called libffi6 and libffi-dev.

Package names can be searched on http://packages.ubuntu.com/


For searching packages use apt-cache search.
Example in your case following can help you:

$ apt-cache search libffi
libffi-dev - Foreign Function Interface library (development files)
libffi6 - Foreign Function Interface library runtime
libffi6-dbg - Foreign Function Interface library runtime (debug symbols)
ffindex-dbg - simple index/database for huge amounts of small files (debug)
libbfio-dbg - Library to provide basic input/output abstraction (debug)
libffindex0 - library for simple index/database for huge amounts of small files
libffindex0-dev - library for simple index/database for huge amounts of small files (development)
libjffi-java - Java Foreign Function Interface
libjffi-jni - Java Foreign Function Interface (JNI library)

You can also try installing the upstream Debian libffi5 package, if another package specifically requires libffi5.

See: https://packages.debian.org/wheezy/libffi5 or the appropriate upstream Debian version for your Ubuntu release.

Download the appropriate Debian package (.deb) for your architecture, and install using dpkg; e.g. dpkg -i libffi5_3.0.10-3+deb7u2_amd64.deb. Then either fix the original install (apt-get -f install), or reinstall the desired package (apt-get install ...).


Your Ubuntu package repository may be too old to update.

Keep in mind select the suitable architecture and change your package repository url by adding a line to your /etc/apt/sources.list like this:

deb https://launchpad.net/ubuntu/+mirror/mirror.enzu.com-archive focal main

There are alternative other mirror links like https://launchpad.net/ubuntu/+mirror/mirror.enzu.com-archive.

Select the suitable mirror based on your region and internet speed.

or you can download the package directly and install it.