1

I am new to the linux environment, I faced an issue while performing git clone, So I tried the solution mentioned in this link https://answers.launchpad.net/ubuntu/+source/pycurl/+question/221185

But I am getting the following error while trying the 4th step mentioned in the link,

~/git-openssl$ apt-get source git    
Reading package lists... Done  
E: Unable to find a source package for git

How to resolve this issue and continue with my steps, Could somebody help me?

7
  • You miss the sudo in the command you use: sudo apt-get source git I am not sure if this is the cause of the problem, though. Jan 8, 2018 at 12:13
  • 1
    No that is not the issue, sudo apt-get source git [sudo] password for test: Reading package lists... Done E: Unable to find a source package for git
    – Harry
    Jan 8, 2018 at 12:15
  • 2
    Check your apt sources in /etc/apt/sources.list. Do you have a line that looks like deb-src http://archive.ubuntu.com/ubuntu/ trusty main?
    – user535733
    Jan 8, 2018 at 12:29
  • 2
    @MarcVanhoomissen: apt-get source doesn't require super-user privileges and if it did the error message would be different. Jan 9, 2018 at 9:46
  • 2
    Could you please edit your question to include the output of apt-cache policy git as well as the content of /etc/apt/sources.list? Thanks. Jan 9, 2018 at 9:46

1 Answer 1

0

Solution walk through

Solution: I had to edit the sourves.list and un-comment any lines that started with deb-src

sudo nano /etc/apt/sources.list

Change:

deb http://archive.ubuntu.com/ubuntu artful main restricted
# deb-src http://archive.ubuntu.com/ubuntu artful main restricted

To:

deb http://archive.ubuntu.com/ubuntu artful main restricted
deb-src http://archive.ubuntu.com/ubuntu artful main restricted

Continue to un-comment any other lines that start with deb-src

Save the document and then do sudo apt-get update

now apt-get source <package name> should work

If above fails try git clone https://repo.or.cz/r/git/debian.git/

You must log in to answer this question.

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