Introduction
When working with complex software on Linux, especially tools cloned from repositories like GitHub, you'll often encounter "missing dependency" errors. These errors occur when the software requires other programs or libraries to be installed, but they are not present on your system.
In this lab, you will learn a fundamental troubleshooting skill: how to identify and install missing dependencies for a script. We will use Fluxion, a popular security auditing tool, as our example. You will run its installer, observe which packages are missing, manually install them using the apt-get package manager, and finally, launch the application successfully.
Run the 'fluxion.sh -i' Installer Script
In this step, you will begin by running the Fluxion installer script. Most well-designed scripts include an installer or a dependency checker to help users set up the required environment. The Fluxion script uses the -i flag to run in "installer" mode, which specifically checks for required packages.
First, navigate into the fluxion directory that has been pre-cloned for you in the ~/project directory.
cd ~/project/fluxion
Now, execute the installer script. Since it's a shell script in the current directory, you'll need to preface it with ./.
./fluxion.sh -i
You will see output that checks for various tools. Pay close attention to the lines that indicate a package is missing.
Expected output (may vary slightly):
* Installer
[*] Checking for dependencies...
[!] Some packages are not installed.
[!] The following packages are required:
-> lighttpd..................................[ Not installed ]
-> hostapd...................................[ Not installed ]
-> mdk4......................................[ Not installed ]
-> aircrack-ng...............................[ OK ]
-> xterm.....................................[ OK ]
...
[!] The following packages are recommended:
-> pyrit.....................................[ Not installed ]
-> bully.....................................[ Not installed ]
[?] Do you want to install the required packages? (Y/n)
For this lab, do not proceed with the automatic installation. Press n and then Enter to exit the script's installer prompt. We will install the packages manually in the next steps.
Observe the Installer Output for Missing Packages
In this step, your task is to carefully read the output from the previous command. This is the most critical part of troubleshooting: understanding the information the program gives you.
As you saw in the output from ./fluxion.sh -i, the script provides a clear, color-coded list of its dependencies and their status.
[!] Some packages are not installed.
[!] The following packages are required:
-> lighttpd..................................[ Not installed ]
-> hostapd...................................[ Not installed ]
-> mdk4......................................[ Not installed ]
The lines marked with [ Not installed ] are the ones we need to fix. The script explicitly tells us that lighttpd, hostapd, and mdk4 are required but are not found on the system. For this lab, we will focus on installing mdk4 as an example of the process.
There are no commands to run in this step. The goal is simply to practice reading and interpreting diagnostic messages.
Manually Install a Missing Package using 'apt-get install'
Now that you have identified a missing package, mdk4, you will use the standard Debian/Ubuntu package manager, apt-get, to install it. This is a common command-line tool for managing software.
To install a package, you use the sudo apt-get install <package-name> command. You need sudo because installing software modifies the system and requires administrative privileges. We will also add the -y flag, which automatically answers "yes" to any confirmation prompts, making the installation non-interactive.
Run the following command in your terminal to install mdk4:
sudo apt-get install -y mdk4
The system will now fetch and install the mdk4 package and any of its own dependencies.
Expected output (truncated):
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following NEW packages will be installed:
mdk4
0 upgraded, 1 newly installed, 0 to remove and XX not upgraded.
Need to get 63.4 kB of archives.
After this operation, 205 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu jammy/universe amd64 mdk4 amd64 4.2-1 [63.4 kB]
Fetched 63.4 kB in 1s (118 kB/s)
Selecting previously unselected package mdk4.
(Reading database ... 123456 files and directories currently installed.)
Preparing to unpack .../mdk4_4.2-1_amd64.deb ...
Unpacking mdk4 (4.2-1) ...
Setting up mdk4 (4.2-1) ...
Processing triggers for man-db (2.10.2-1) ...
You have now successfully resolved one of the missing dependencies.
Rerun the Installer to Verify All Dependencies are Met
In this step, you will rerun the installer script to confirm that your fix was successful. It's always a good practice to verify your changes. Although we only installed mdk4, the Fluxion installer will now automatically detect and install the other missing required packages (lighttpd and hostapd) because we are running it again.
Make sure you are still in the ~/project/fluxion directory. Run the installer command again:
./fluxion.sh -i
This time, the script will check the dependencies again. It will find that mdk4 is now installed. It will still prompt you to install the remaining missing packages. This time, press Y and then Enter to allow the script to automatically install the rest.
Expected output:
* Installer
[*] Checking for dependencies...
[!] Some packages are not installed.
[!] The following packages are required:
-> lighttpd..................................[ Not installed ]
-> hostapd...................................[ Not installed ]
-> mdk4......................................[ OK ]
...
[?] Do you want to install the required packages? (Y/n) Y
[*] Installing required packages...
... (apt-get installation output) ...
[*] All dependencies are installed.
After the installation completes, the script will confirm that all dependencies are met. This confirms your troubleshooting process was successful.
Launch the Main Fluxion Script Successfully
With all dependencies correctly installed, you are now ready to launch the main Fluxion application. When you run the script without any flags, it starts the main program instead of the installer.
Execute the script without the -i flag:
./fluxion.sh
If all dependencies were resolved correctly, you will no longer see any error messages. Instead, you will be greeted by the main Fluxion language selection menu.
Expected output:
...
╔══════════════════════════════════════════════════════════════════════════════╗
║ Choose your language. / Elige tu idioma. ║
╠══════════════════════════════════════════════════════════════════════════════╣
║ 1. English (en) 5. Português (pt) 9. Türkçe (tr) ║
║ 2. Español (es) 6. Français (fr) 10. Ελληνικά (gr) ║
║ 3. Italiano (it) 7. Deutsch (de) 11. Polski (pl) ║
║ 4. Русский (ru) 8. Magyar (hu) 12. Nederlands(nl) ║
╚══════════════════════════════════════════════════════════════════════════════╝
> Select an option:
Seeing this menu confirms that you have successfully troubleshooted and resolved all missing dependency issues. You can now exit the script by pressing Ctrl+C.
Summary
In this lab, you have practiced a critical and common skill for any Linux user: troubleshooting missing software dependencies.
You successfully:
- Executed a script's installer to check for required packages.
- Interpreted the output to identify which dependencies were missing.
- Used the
sudo apt-get installcommand to manually install a missing package. - Reran the installer to verify the fix and install remaining dependencies.
- Launched the main application successfully after resolving all issues.
This process of "read the error, identify the problem, apply a fix, and verify" is a fundamental workflow for solving a wide range of technical problems on Linux and beyond.
