weakptr.o: command not found

Have You tried accessing the binary with the full path?

Maybe Your $PATH variable doesn't contain the default paths? echo $PATH should give something like:

[root@server ~]# echo $PATH
/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

If it's empty, You may set the PATH variable with this command

export PATH="/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin"

On Debian possible default full paths are:

/usr/lib/x86_64-linux-gnu/gap/bin/weakptr.o - from package: gap-dev

You may install the required package with command apt-get install {package}
Error in other languages:
weakptr.o: bevel nie gevind nie
weakptr.o: comandă negăsită
weakptr.o: comando não encontrado
weakptr.o: commande introuvable
weakptr.o: command not found
weakptr.o: käsku ei ole
weakptr.o: không tìm thấy lệnh
weakptr.o: komanda nerasta
weakptr.o: Kommando nicht gefunden.
weakptr.o: kommandot finns inte
weakptr.o: komut yok
weakptr.o: nie znaleziono polecenia
weakptr.o: níor aimsíodh an t-ordú
weakptr.o: no se encontró la orden
weakptr.o: no s'ha trobat l'ordre
weakptr.o: opdracht niet gevonden
weakptr.o: parancs nem található
weakptr.o: perintah tidak ditemukan
weakptr.o: príkaz nenájdený
weakptr.o: příkaz nenalezen
weakptr.o: команда не найдена
weakptr.o: командата не е открита
weakptr.o: 命令找不到
weakptr.o: コマンドが見つかりません