1

I follow the steps in Upgrade Git version on Ubuntu 14.04, but when I enter the first step command: sudo add-apt-repository ppa:git-core/ppa, I receive the following error:

FileNotFoundError: [Errno 2] No such file or directory: '/etc/apt/sources.list.d/git-core-ppa-trusty.list'

you can check the following picture for detail:

error discription

With this error, when I continue to enter the remaining 2 commands, I failed to upgrade my git version. Hope someone know this problem can help me out, thank you.

4
  • Can you check if the directory /etc/apt/sources.list.d exists on your machine? Also please copy and paste command outputs as plain text and with code formatting instead of uploading screenshots. Thank you.
    – Byte Commander
    Commented Sep 24, 2017 at 15:02
  • Thank you for your formating, but with my current reputation, I can just uploading screenshots, sorry for the inconvenient. I manually create the directory of source.list.d, and the above error disappeared, but when I enter the second command: sudo apt-get update, I receive the following error: Failed to fetch http://ppa.launchpad.net/git-core/ppa/ubuntu/dists/trusty/main/binary-amd64/Packages Hash Sum mismatch.
    – Phymin
    Commented Sep 24, 2017 at 15:15
  • @Phymin you don't need to upload anything. Just copy the output and paste it here.
    – muru
    Commented Sep 24, 2017 at 15:23
  • 1
    @muru The editor blocks posting more than 2 or 3 links for new users. If the output is not formatted as code block, possible URLs inside it count as links too. The solution is to highlight the output in the editor and use the code format button {} or press Ctrl+K.
    – Byte Commander
    Commented Sep 24, 2017 at 15:35

1 Answer 1

0

Your initial error (the Python FileNotFoundError) is most likely caused because the directory /etc/apt/sources.list.d inside which add-apt-repository tries to create a sources file does not exist, for whatever obscure reason.

To fix this, simply create this directory manually with e.g. this command:

sudo mkdir /etc/apt/sources.list.d
9
  • Sorry, but this doesn't work for me, the error remains the same as before.
    – Phymin
    Commented Sep 24, 2017 at 15:46
  • Then please update your question with the exact command and full output.
    – Byte Commander
    Commented Sep 24, 2017 at 15:55
  • Some comments on the answer to the linked question suggest you may additionally have to change your update server, eg, from us.ubuntu.com to XX.ubuntu.com where XX is your country code – could you try that please? Also try sudo apt clean after removing the files.
    – dessert
    Commented Sep 24, 2017 at 16:47
  • Huh, you get a hash sum mismatch on all repositories? That is weird. While I try to find something appropriate, you could indeed try switching to a different mirror server as dessert described.
    – Byte Commander
    Commented Sep 24, 2017 at 17:53
  • Could you simply try the other answers to the linked question? Maybe even waiting a few hours could solve it. I don't really know what else to try right now.
    – Byte Commander
    Commented Sep 24, 2017 at 18:11

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .