Makepkg yaourt cp error [Resolved]

Hi, I want to install ‘yaourt’ tool on my Manjaro Desktop, do below:

> git clone
> cd yaourt/
> makepkg -si
# Scripts
/usr/bin/env install -m755 /home/mengz/tmp/yaourt/pkg/yaourt/usr/bin/yaourt
cp: invalid option -- 'm'
Try 'cp --help' for more information.
cp: invalid option -- 'm'
cp: invalid option -- 'm'
Try 'cp --help' for more information.
make: *** [Makefile:46: install] Error 1
==> ERROR: A failure occurred in package().

Always get the cp error, what’s this problem?

Aditional information, I installed ‘yay’ successfully, but when I install ‘lsyncd’ package from AUR via ‘yay’, also get the cp error:

> yay -S lsyncd
[100%] Built target lsyncd
Install the project...
-- Install configuration: ""
-- Installing: /home/mengz/.cache/yay/lsyncd/pkg/lsyncd/usr/bin/lsyncd
-- Installing: /home/mengz/.cache/yay/lsyncd/pkg/lsyncd/usr/man/lsyncd.1
cp: invalid option -- 'D'
Try 'cp --help' for more information.
cp: invalid option -- 'D'
cp: invalid option -- 'D'
Try 'cp --help' for more information.
==> ERROR: A failure occurred in package().
error making: lsyncd

does anything else work with yay? try installing something else

Do you have any alias’s on your system?

Like for example install = cp or something. Can be seen in your ~/.bashrc.

The reason I ask, is that the PKGBUILD’s use the install command, and your system complains about cp not having those options, but install does.


mine is this :-

> alias
cp='cp -i'
df='df -h'
free='free -m'
gitu='git add . && git commit && git push'

Look inside the PKGBUILD - it is common to use cp to copy the files from $src_dir to $pkg_dir

The PKGBUILD in question is using cp with an invalid option/argument - to fix it you must locate the command and fix it - the error already indicates what to look for - the m option

Instead of using a helper do it manually - clone the AUR content - cd into the folder and edit the PKGBUILD - then run makepkg to test the build - if it works you will get a package you can install with pacman -U

The same goes for this one - albeit another error message

Actually it uses “install” to put the files.

As @Strit already mentioned he must have some alias mapping “install” to “cp”…

@mengzyou Check your aliases with alias



You are right - it appears I was confused by the cp message which lead me to think the cp command was used in the PKGBUILD

In my .bashrc,

alias cp="cp -i"                          # confirm before overwriting something
alias df='df -h'                          # human-readable sizes
alias free='free -m'                      # show sizes in MB
alias np='nano -w PKGBUILD'
alias more=less

No alias for ‘install’.


❯ install --version
install (GNU coreutils) 8.32
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <>.
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

Written by David MacKenzie.

It’s strange, I lost my home dir, and recreate it, now the yay works, no cp errors now.

Oh could you explain this last post a bit more?

Sorry, I do not know how to explain this, as the disk partition of home directory was broken, so I recreated the user home directory, then I try the yay -S lsyncd, no cp error any more.

Just explain this part