If you use apt-get install to install with a package name, it may not be registered in the repository by default and cannot be installed.
In this article, I'll use an example of installing iozone3.
Debian GNU/Linux 8
First, try to install from the list of default packages and make sure you get a "package not found" error
> apt-get install iozone3 Reading package lists... Done... Building dependency tree Reading state information... Done... E: Unable to locate package iozone3
If you put the package name in the search window, it will tell you which package it is in.
For Debian, click here
For Ubuntu, click here.
Debian's izone3 is in a non-free repository
Here's how to add a non-free repository to your list of repositories
First, check the list of the current repositories
> cat /etc/apt/sources.list deb http://httpredir.debian.org/debian jessie main deb http://httpredir.debian.org/debian jessie-updates main deb http://security.debian.org jessie/updates main
Make sure there is no non-free
Install the apt-add-repository package for adding a repository
# Use apt-file to find out where apt-add-repository is on the command line > apt-get install apt-file > apt-file update > apt-file search apt-add-repository # apt-add-repository is included in software-properties-common, so you can install the whole thing > apt-get install -y software-properties-common
I'll add the non-free repository with the izone3 package I just examined to the list of repositories
> apt-add-repository non-free
Checking the repository list, you can see the non-free has been added to the last line
> cat /etc/apt/sources.list deb http://httpredir.debian.org/debian jessie main deb http://httpredir.debian.org/debian jessie-updates main deb http://security.debian.org jessie/updates main deb http://http.us.debian.org/debian/ jessie non-free
I confirmed that I can install it normally using apt-get.
> apt-get update > apt-get install -y iozone3
Confirm that the installation has been completed by displaying the version
> iozone -v 'Iozone' Filesystem Benchmark Program Version $Revision: 3.429 $ Compiled for 64 bit mode. Original Author: William Norcott (email@example.com) 4 Dunlap Drive Nashua, NH 03060 Enhancements: don capps (firstname.lastname@example.org) 7417 Crenshaw. Plano, TX 75025 Copyright 1991, 1992, 1994, 1998, 1999, 2002 William D. Norcott License to freely use and distribute this software is hereby granted By the author, subject to the condition that this copyright notice The author retains the exclusive right to publish The derivative works are based on this work, including, but not limited to, revised versions of this work Other contributors: Don Capps (Network Appliance) email@example.com