28

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 https://www.codeground.net/howto/traceroute-is-not-installed-by-default-on-ubuntu-replaced-by-mtr/, 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.

  • 2
    What error does it come up with? – Arronical Mar 09 '17 at 10:27
  • @Arronical It says Unable to fetch some archives,maybe run apt-get update or try with -- fix missing? I don't know what that means because I am new to Linux, so don't judge my stupidity. – CodingTeen2017 Mar 09 '17 at 10:31
  • 2
    Don't worry, it'd be useful to [edit] the question to include the error, as comments can get cleaned up down the line. Unfortunately I'm no expert on apt stuff, but your question will likely get more help with that included. Try sudo apt-get update before trying to install. If you get errors, add them to your question too :) – Arronical Mar 09 '17 at 10:41
  • You sure you wrote sudo before apt-get install --fix-missing? – M. Becerra Mar 09 '17 at 11:00
  • @M.Becerra I tried anand's answer again, and it worked, but when I typed sudo apt-get install traceroute, it came up with the same error. – CodingTeen2017 Mar 09 '17 at 11:43

3 Answers3

52

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 
anand
  • 666
5

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.

Elder Geek
  • 36,023
  • 25
  • 98
  • 183
  • You do realize I'm doing this on Linux, right? – CodingTeen2017 Mar 14 '17 at 10:25
  • 1
    @CodingTeen2017 I would hope so. The name of this site is AskUbuntu.com Ubuntu is a variant of Linux. My answer is on topic for the site. If you are using some other variant of Linux perhaps your question is off-topic for this site. Please [edit] the output of lsb_release -a into your post – Elder Geek Mar 14 '17 at 13:29
3
$ 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
ori0n
  • 135
  • Why did you include the uname command? Also, you did not answer the users question about why they are receiving the error when trying to install traceroute. – Gordster Mar 25 '20 at 08:41
  • 2
    I have added uname because working solution can vary across versions. Sometimes working solution is better than investigations of issues and can give more insight to someone solving his stuff. – ori0n Mar 26 '20 at 09:42