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.
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).
yumis 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
dpkg(or its graphical frontend,
gdebi) should be used to for this purpose on Ubuntu.
.debpackages--if you find you actually need to install an
.rpmpackage, you should use
aliento make a
.debpackage 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:
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.
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 install
packagename for all other installation steps in your guide.