Cisco Packet Tracer on Fedora
These notes document a working way to install Cisco Packet Tracer on Fedora using the .deb package provided by Cisco NetAcad / Skills for All.
This method is based on unpacking the Ubuntu installer and copying the Packet Tracer files into /opt/pt.
Trust caveat
This workflow is reasonable for a personal lab if the installer comes directly from Cisco, but it is not a zero-trust install path.
The script below does all of the following:
- installs Fedora packages with
sudo dnf - extracts the Cisco
.deb - copies files into
/opt - runs the vendor
postinstscript as root - runs Packet Tracer activation as the target user
Only use it with a .deb you downloaded from Cisco:
https://www.netacad.com/portal/resources/packet-tracerhttps://skillsforall.com/resources/lab-downloads
Prerequisites
Download the current Packet Tracer Linux .deb from Cisco first. The script searches for installers matching names such as:
CiscoPacketTracer_<version>_Ubuntu_64bit.debInstall steps
Save the script as setup.sh, make it executable, and run it:
chmod +x setup.sh
./setup.shIf your installer is not under your home directory, point the script at a specific folder:
./setup.sh --directory /path/to/downloadsTo remove Packet Tracer later:
./setup.sh --uninstallScript
#!/bin/bash
set -euo pipefail
Red="\033[0;31m"
Bold="\033[1m"
Color_Off="\033[0m"
Cyan="\033[0;36m"
Green="\033[0;32m"
user_name="${SUDO_USER:-$(id -un)}"
user_home="$(getent passwd "$user_name" | cut -d: -f6)"
if [[ -z "$user_home" ]]; then
echo "Could not determine home directory for user: $user_name"
exit 1
fi
installer_search_path="${user_home:-$HOME}"
work_dir=""
USAGE_MESSAGE="Usage: $0 [OPTIONS]... [DIRECTORY]...
Install Cisco Packet Tracer latest version on Fedora Linux using
.deb provided by Cisco. To download the installer, access this link:
<https://www.netacad.com/portal/resources/packet-tracer>
-d, --directory Directory where is the installer
-h, --help Show this help message and exit
--uninstall Uninstall Cisco Packet Tracer
"
cleanup() {
if [[ -n "$work_dir" && -d "$work_dir" ]]; then
rm -rf "$work_dir"
fi
}
trap cleanup EXIT
run_optional_command() {
local cmd="$1"
shift
if command -v "$cmd" >/dev/null 2>&1; then
sudo "$cmd" "$@"
fi
}
remove_desktop_entries() {
local desktop_files=()
shopt -s nullglob
desktop_files=(/usr/share/applications/cisco-pt*.desktop)
shopt -u nullglob
if command -v xdg-desktop-menu >/dev/null 2>&1 && ((${#desktop_files[@]} > 0)); then
sudo xdg-desktop-menu uninstall "${desktop_files[@]}"
fi
}
resolve_installer() {
if [[ ! -f "$selected_installer" ]]; then
echo -e "${Red}${Bold}Installer not found: $selected_installer${Color_Off}"
exit 1
fi
}
install () {
resolve_installer
echo "Extracting files"
echo "Installing dependencies"
sudo dnf -y install binutils fuse fuse-libs qt5-qttools
mkdir -p "$user_home/.local/share/applications"
work_dir="$(mktemp -d "${TMPDIR:-/tmp}/packettracer.XXXXXX")"
ar -x "$selected_installer" --output="$work_dir"
tar -xvf "$work_dir/control.tar.xz" --directory="$work_dir"
tar -xvf "$work_dir/data.tar.xz" --directory="$work_dir"
sudo cp -r "$work_dir/opt" /
sudo mkdir -p /usr/local/bin
sudo ln -sf /opt/pt/packettracer.AppImage /usr/local/bin/packettracer
sudo -u "$user_name" /usr/local/bin/packettracer --pt-activate
sudo "$work_dir/postinst"
remove_desktop_entries
run_optional_command update-mime-database /usr/share/mime
run_optional_command gtk-update-icon-cache -t --force /usr/share/icons
exit
}
uninstall () {
if [ -e /opt/pt ]; then
echo "Uninstalling Cisco Packet Tracer."
if [[ -x /usr/local/bin/packettracer ]]; then
sudo -u "$user_name" /usr/local/bin/packettracer --pt-deactivate || true
fi
sudo rm -rf /opt/pt /usr/local/share/applications/CiscoPacketTracer*.desktop "$user_home/.local/share/applications"/CiscoPacketTracer*.desktop "$user_home/.local/share/mime/packages"/cisco-pk*.xml
remove_desktop_entries
run_optional_command update-mime-database /usr/share/mime
run_optional_command gtk-update-icon-cache -t --force /usr/share/icons
sudo rm -f /usr/local/bin/packettracer
fi
echo "Cisco Packet Tracer was uninstalled."
sleep 3
}
locate_installers () {
localized_installers=()
selected_installer=''
echo -e "${Green}${Bold}Searching for installers in user home...${Color_Off}\n"
mapfile -d '' localized_installers < <(
find "$installer_search_path" -type f \
\( -name "Cisco*Packet*.deb" -o -name "Packet*Tracer*.deb" -o -name "CiscoPacketTracer_900_Ubuntu_64bit.deb" \) \
-print0
)
clear
if ((${#localized_installers[@]} == 0)); then
echo -e "\n${Red}${Bold}Packet Tracer installer not found in ${installer_search_path}."
echo -e "Expected filename pattern: ${Bold}CiscoPacketTracer_<version>_Ubuntu_64bit.deb"
echo -e "For example: ${Bold}CiscoPacketTracer_900_Ubuntu_64bit.deb${Color_Off}\n"
echo -e "You can download the installer from ${Cyan}https://www.netacad.com/portal/resources/packet-tracer${Color_Off} \
or ${Cyan}https://skillsforall.com/resources/lab-downloads${Color_Off} (login required)."
exit 1
elif [ "${#localized_installers[@]}" -eq 1 ]; then
selected_installer="${localized_installers[0]}"
else
echo -e "${Red}${Bold}Press CTRL + C to cancel installation.${Color_Off}\n"
echo -e "${Cyan}${Bold}${#localized_installers[@]} installers of Cisco Packet Tracer were found:${Color_Off}\n"
PS3="Select a installer to use: "
select installer in "${localized_installers[@]}"
do
if [[ -n "${installer:-}" ]]; then
selected_installer="$installer"
break
fi
echo "Invalid selection."
done
if [[ -z "$selected_installer" ]]; then
echo "No installer selected."
exit 1
fi
fi
echo -e "\n${Bold}Selected installer: ${Red}${Bold}$selected_installer ${Color_Off}\n"
sleep 3
echo "Removing old version of Packet Tracer from /opt/pt"
uninstall
install
}
case "${1:-}" in
-h | --help)
echo "$USAGE_MESSAGE"
exit 0
;;
-d | --directory)
if [[ -z "${2:-}" ]]; then
echo "$USAGE_MESSAGE"
exit 1
fi
installer_search_path="$2"
echo -e "A directory was especified for search the installer: ${Bold}$installer_search_path${Color_Off}"
sleep 3
locate_installers
;;
--uninstall)
uninstall
;;
esac
if [ "${1:-}" = "" ]
then locate_installers
fiNotes
- The script expects a Cisco-provided Linux
.deb, not an RPM. - The install path ends up under
/opt/pt. - A symlink is created at
/usr/local/bin/packettracer. - If Cisco changes the package layout in a future release, this may need adjustment.