cannot make .repo directory: Permission denied

11,093 views
Skip to first unread message

dev

unread,
Aug 22, 2011, 3:50:32 PM8/22/11
to Android Building
Hi
I m new to android development.
I need to build setup for android in ubuntu.

Currently i have installed ubuntu 10.10
Referring to :
http://source.android.com/source/downloading.html

trying to create an repo. But after the command below -
$ repo init -u git://android.git.kernel.org/platform/manifest.git

ERROR is coming as "fatal: cannot make .repo directory: Permission
denied"

Please help me with the solution.


Conley Owens

unread,
Aug 22, 2011, 5:44:43 PM8/22/11
to android-...@googlegroups.com
Are you sure you are somewhere within your home directory and that you
didn't accidently chmod the directory you are in?

Did you that repo command with sudo once before? If so, you would
need to sudo rm it.

~cco3

> --
> You received this message because you are subscribed to the "Android Building" mailing list.
> To post to this group, send email to android-...@googlegroups.com
> To unsubscribe from this group, send email to
> android-buildi...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-building?hl=en
>

Fernando Miguélez

unread,
Aug 22, 2011, 6:21:45 PM8/22/11
to android-...@googlegroups.com

Instead of deleting everything it is better to change back the ownership of the files with:

sudo chown -R myuser.myuser *

dev kumar

unread,
Aug 22, 2011, 11:22:12 PM8/22/11
to android-...@googlegroups.com
Thanks for the quick reply.

I have completely follwoed the guidelines given at:
After the command
$ curl https://android.git.kernel.org/repo > ~/bin/repo
I had only change chmod of repo with
$ chmod a+x ~/bin/repo
And after that:
$ mkdir WORKING_DIRECTORY
$ cd WORKING_DIRECTORY
Now I got the error as "cannot make .repo directory: Permission denied. "

Then I tried with " sudo repo init -u git://android.git.kernel.org/platform/manifest.git"

Then the same error gave.
Please let me know where i went wrong.


----------------------------------------------------------------------------------------------

Magnus Bäck

unread,
Aug 23, 2011, 12:23:45 PM8/23/11
to android-...@googlegroups.com
On Tuesday, August 23, 2011 at 05:22 CEST,
dev kumar <its4...@gmail.com> wrote:

> I have completely follwoed the guidelines given at:
> http://source.android.com/source/downloading.html
>
> After the command
>
> $ curl https://android.git.kernel.org/repo > ~/bin/repo
>
> I had only change chmod of repo with
>
> $ chmod a+x ~/bin/repo
>
> And after that:
>
> $ mkdir WORKING_DIRECTORY
> $ cd WORKING_DIRECTORY
>
> $ repo init -u git://android.git.kernel.org/platform/manifest.git
>
> Now I got the error as "cannot make .repo directory: Permission denied. "
>

> Then I tried with " *sudo* repo init -u git://
> android.git.kernel.org/platform/manifest.git"

No, don't use sudo to overcome permission problems in your home
directory. It might solve your problem short-term but it'll come
back and haunt you sooner or later.

> Then the same error gave.
> Please let me know where i went wrong.

Everything looks okay. We can't debug why the directory creation
fails on your machine. You might want to us the --trace option
to get more debugging output for your "repo init" command (i.e.
"repo init --trace git://...") or use strace to see exactly which
directory that Repo fails to create.

--
Magnus B�ck Opinions are my own and do not necessarily
SW Configuration Manager represent the ones of my employer, etc.
Sony Ericsson

Bryan Hinton

unread,
Aug 23, 2011, 4:31:52 PM8/23/11
to Android Building
I would suggest checking your umask.

Cheers,

Bryan

On Aug 23, 11:23 am, Magnus Bäck <magnus.b...@sonyericsson.com> wrote:
> On Tuesday, August 23, 2011 at 05:22 CEST,
>      dev kumar <its44...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
> > I have completely follwoed the guidelines given at:
> >http://source.android.com/source/downloading.html
>
> > After the command
>
> > $ curlhttps://android.git.kernel.org/repo> ~/bin/repo
>
> > I had only change chmod of repo with
>
> > $ chmod a+x ~/bin/repo
>
> > And after that:
>
> > $ mkdir WORKING_DIRECTORY
> > $ cd WORKING_DIRECTORY
>
> > $ repo init -u git://android.git.kernel.org/platform/manifest.git
>
> > Now I got the error as "cannot make .repo directory: Permission denied. "
>
> > Then I tried with " *sudo* repo init -u git://
> > android.git.kernel.org/platform/manifest.git"
>
> No, don't use sudo to overcome permission problems in your home
> directory. It might solve your problem short-term but it'll come
> back and haunt you sooner or later.
>
> > Then the same error gave.
> > Please let me know where i went wrong.
>
> Everything looks okay. We can't debug why the directory creation
> fails on your machine. You might want to us the --trace option
> to get more debugging output for your "repo init" command (i.e.
> "repo init --trace git://...") or use strace to see exactly which
> directory that Repo fails to create.
>
> --
> Magnus B�ck                   Opinions are my own and do not necessarily

Mlo Bootloader

unread,
Aug 5, 2015, 1:43:44 PM8/5/15
to Android Building
Try to install git
sudp apt-get install git

then try again to run 

Ljube Babunski

unread,
Jun 23, 2020, 7:14:29 PM6/23/20
to Android Building
It is a bit older post, almost 10 years, but someone might find useful to check on his mail address when connect to git. You have to have configured desktop mail address through Outlook, Thunderbird or similar.

Sunder Rawat

unread,
Jun 29, 2020, 12:41:01 AM6/29/20
to Android Building
you can run command 
  1. sudo su
  2. chown -v username foldername/ 
eg :- sudo su
then enter your password
chown -v sunder aosp/

Reply all
Reply to author
Forward
0 new messages