How to install traceroute in Linux?

I am currently taking a Controlled Assessment, and this is one of the tasks.

Make sure that you have the program traceroute installed. (Install it if necessary.)

I went on , and it told me to use sudo apt-get install traceroute,so I tried that, but it comes up with an errror message when I try it.

If you have any solutions I would be very grateful! :-)

Edit: I just used anand's answer, but it says:

E: Could not open lock file /var/lib/dpkg/lock - open (13: Permission denied) E: Unable to lock the administration directory (/var/lib/dpkg/), are you root?

I am unaware of what this means, so can someone please help.

Edit 2:I tried anand's updated answer, but the error message that comes up is:

Some index files failed to download. They have been ignored, or old ones used instead.

Edit 3: anand told me to add the logs, so here they are.

5

3 Answers

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 
6

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.

2
$ 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
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like