How to install traceroute in Linux?

Info: In linux equivalent of traceroute is pre-installed:

tracepath  

Solution of your error message:

   sudo apt-get install --fix-missing  
   sudo apt-get update && sudo apt-get install traceroute 

There are several Ubuntu packages that provide traceroute for all currently supported versions of Ubuntu. What they all appear to have in common is you must enable the Universe repository to install them.

Your lock errors mean that something else has locked apt. Usually the software center is still open and closing it will resolve the issue.


$ uname -a
Linux ip-10-221-18-242 4.15.0-1057-aws #59-Ubuntu SMP Wed Dec 4 10:02:00 UTC 
2019 x86_64 x86_64 x86_64 GNU/Linux

$ sudo add-apt-repository universe
$ sudo apt-get update
$ sudo apt-get install inetutils-traceroute

$ traceroute --version
traceroute (GNU inetutils) 1.9.4