How do I get iperf on a Ubuntu 13.10 Live disc?

12,006

Solution 1

You don't need to create a root password, you can use sudo. Here's how to compile and install a program from source.

Installing the build-essential package in Ubuntu’s package repositories automatically installs the basic software you’ll need to compile from source, like the GCC compiler and other utilities.

sudo apt-get install build-essential

Now open your browser (Firefox) and go to http://sourceforge.net/projects/iperf/ and download the latest .tar.gz file. This is currently iperf-2.0.5.tar.gz. It will be downloaded to /home/ubuntu/Downloads by default. Navigate to this location in Terminal.

ubuntu@ubuntu:~$
ubuntu@ubuntu:~$ cd Downloads
ubuntu@ubuntu:~/Downloads$

Extract the contents of the .tar.gz file with the tar -xzvf command. Use the ls command to list files and directories. This will help you type the name of the file correctly.

ubuntu@ubuntu:~/Downloads$ ls
iperf-2.0.5.tar.gz
ubuntu@ubuntu:~/Downloads$ tar -xzvf iperf-2.0.5.tar.gz

Use the ls command once more to check if there is a new directory. It should have the same name as the source archive file.

ubuntu@ubuntu:~/Downloads$ ls
iperf-2.0.5  iperf-2.0.5.tar.gz

As you can see there are now two entries. One is a file and the other is the new directory you've extracted the source files to. You now need to drop down to that directory using the cd command.

ubuntu@ubuntu:~/Downloads$
ubuntu@ubuntu:~/Downloads$ cd iperf-2.0.5/
ubuntu@ubuntu:~/Downloads/iperf-2.0.5$

You now need to resolve any dependencies before you continue with compiling the program. You do that by running the configure file.

ubuntu@ubuntu:~/Downloads/iperf-2.0.5$
ubuntu@ubuntu:~/Downloads/iperf-2.0.5$ ./configure

This might take some time, depending on the system and how big the program is. In this case, it is a very small program, and this should complete very fast. It is not always necessary to do this, depending on the program. You can always check to see if you need to run this command by reading the "README" or "INSTALL" file. You will find this file in the location where you extracted the .tar.gz file.

Once this command completes, look for any "error" lines. If you don't see any error lines that means you're good to proceed with the next step. If you see any errors about missing scripts and packages, you will need to install those first before you continue. You can try apt-get install name where "name" is the name of the package to install. Note that not all packages have the same name as the one you see in the error message! So you might need to Google the error to find out what packages are missing.

After you have installed any missing packages, you will need to run the same command again. If everything checks out, you should not get any error lines and you are ready to proceed with the next step.

Now it's time to compile! You do that with the make command.

ubuntu@ubuntu:~/Downloads/iperf-2.0.5$
ubuntu@ubuntu:~/Downloads/iperf-2.0.5$ make

When this command completes, the program is compiled. Now it's time to install it! You will need to use sudo to install. (If you are using root (e.g. root@ubuntu) you need to leave out the sudo part.)

ubuntu@ubuntu:~/Downloads/iperf-2.0.5$
ubuntu@ubuntu:~/Downloads/iperf-2.0.5$ sudo make install

It will probably be stored under /usr/local/bin on your system. This is part of your system's path, which means you can just type “iperf” into a Terminal window and press Enter to run it.

Solution 2

Here's a more simple way to do this. Start by adding the Universe repository. You can do that by opening Software & Updates (formerly known as Software Sources).

  1. Press Super key and type in "software".
  2. Click on "Software & Updates".
  3. Enable "Community-maintained free and open-source software (universe)".
  4. Click Close.

a

Now you need to update repository and install iperf through the Terminal.

  1. Press Ctrl+Alt+T to open a new Terminal window (or use the Dash to search for it).
  2. sudo apt-get update
  3. sudo apt-get install iperf
  4. Done!
Share:
12,006

Related videos on Youtube

Samir
Author by

Samir

Tell me and I forget. Teach me and I remember. Engage me and I learn.

Updated on September 18, 2022

Comments

  • Samir
    Samir almost 2 years

    I have Ubuntu 13.10 running from a live DVD disc. Unfortunately it does not include the iperf tool, so it will need to be added separately. I already tried the command below.

    apt-get install iperf
    

    It returns an error. I think it has something to do with sources.

    root@ubuntu:/# apt-get install iperf
    Reading package lists... Done
    Building dependency tree       
    Reading state information... Done
    E: Unable to locate package iperf
    root@ubuntu:/#
    

    By using pico /etc/apt/sources.list this is what I get.

    deb cdrom:[Ubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)]/ saucy main restricted
    deb http://archive.ubuntu.com/ubuntu/ saucy main restricted
    deb http://security.ubuntu.com/ubuntu/ saucy-security main restricted
    deb http://archive.ubuntu.com/ubuntu/ saucy-updates main restricted
    

    I see there's a "cdrom" entry in there. Is it looking for iperf on the DVD and when it fails to find it returns that error? What about those URLs listed below it, is it ever looking for iperf in those locations?

    Do I have to do something about the sources file to fix this? Or is this caused by something else?

    I found some instructions on how to manually compile and install iperf. But that failed at the step where I'm supposed to run make install clean and iperf is still not installed.

    The whole purpose of using the Ubuntu live disc is to run iperf. So I need this thing up and running. Please advise, what do I need to do?

    Update 1 - Adding the "Universe" repository

    As suggested, I tried adding the Universe repository. But that didn't work.

    I know the solution I listed as my own answer works. But I wanted an easier way to do this so I rebooted and issued the following commands.

    ubuntu@ubuntu:~$ pico /etc/apt/sources.list
    ubuntu@ubuntu:~$ sudo pico /etc/apt/sources.list
    ubuntu@ubuntu:~$ pico /etc/apt/sources.list
    ubuntu@ubuntu:~$ sudo apt-get update
    E: Type 'http://archive.ubuntu.com/ubuntu/raring/universe' is not known on line 5 in source list /etc/apt/sources.list
    E: The list of sources could not be read.
    ubuntu@ubuntu:~$ 
    

    I used the pico editor and added the following line at the end of the file.

    http://archive.ubuntu.com/ubuntu/raring/universe amd64 Packages
    

    I couldn't write it out at first, because of permissions. So I had to use sudo and this is what it looks like now.

    deb cdrom:[Ubuntu 13.10 _Saucy Salamander_ - Release amd64 (20131016.1)]/ saucy$
    deb http://archive.ubuntu.com/ubuntu/ saucy main restricted
    deb http://security.ubuntu.com/ubuntu/ saucy-security main restricted
    deb http://archive.ubuntu.com/ubuntu/ saucy-updates main restricted
    http://archive.ubuntu.com/ubuntu/raring/universe amd64 Packages
    

    Do I need the extra space in front of "raring"? And do I need to begin the line "deb"? It was not specified in the instruction.