I tried sudo yum install flex but I just get: No package flex available. I'm trying to install this for a dependency for yara 1.6 in order to install jsunpack. Thank you for the help.

  • 2
    Why are you using yum? I'm assuming you are using Ubuntu. If not, please indicate so.
    – nanofarad
    Jul 16, 2012 at 15:06
  • Yes, I am, oh god I'm so silly, I was just blindly following a set of instructions. Didn't know I could've just used sudo apt-get install t.t sorry!!
    – Shelby. S
    Jul 16, 2012 at 15:09

4 Answers 4


Assuming you are using Ubuntu, you should usually not attempt to install packages with yum. It is provided for very special circumstances only. Usually you should install software with Ubuntu's package manager, APT (using apt-get, or the alternative, aptitude), or with one of its graphical frontends (like the Ubuntu Software Center or the Synaptic Package Manager).

  • yum is primarily used on Red Hat based systems (including Fedora, Red Hat Enterprise Linux, and derivatives of those). The above commands are what you'd use instead. The lower-level tool on Red Hat based systems, for installing a package from a specific package file, is rpm. dpkg (or its graphical frontend, gdebi) should be used to for this purpose on Ubuntu. dpkg installs .deb packages--if you find you actually need to install an .rpm package, you should use alien to make a .deb package from it and install that.

  • See Installing Software for more information.

In this particular situation, you may be able to install flex by clicking here:

  • Install via the software center

Or you can install it by running these commands:

sudo apt-get update
sudo apt-get install flex

The first command updates information about what packages are available in what versions and from what software sources. It's advisable to run that before installing or upgrading packages from the command line. Whereas yum will always fetch this information before attempting an installation (which is handy, but which also makes it take a lot longer than necessary if you run a number of yum commands in a short time), sudo apt-get install ... does not fetch this information.

If you don't run sudo apt-get update first, and you haven't run it in a while, you may be getting an old version of the package, attempting to fetch a version so old it's no longer available, or getting a version that doesn't work right with the other packages you have installed.


You can try installing Aptitude by typing sudo apt-get install aptitude (if you don't already have it) and then type sudo aptitude search flex.

If it locates the package do sudo aptitude install flex.

This way is a bit drawn out from imwrng's way, but this allows you to browse other available packages for flex.

  • 1
    apt-cache search flex does the same thing, you won't need to install aptitude.
    – Thomas Ward
    Jul 25, 2012 at 14:03

You are(in accordance to my comment which came before iwrng's answer) using commands for the wrong Linux distro. Ubuntu, like Debian uses apt(Advanced Package Tool) to install and manage applications. Please use sudo apt-get update, followed by sudo apt-get install flex, and use sudo apt-get installpackagename for all other installation steps in your guide.


you should have to type as sudo apt-get install flex to install it . or If you want graphical approach using Software Center Install via the software center

  • Oh wow.. I can't believe I didn't even think of trying this... haha thank you!
    – Shelby. S
    Jul 16, 2012 at 15:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .