1.先修改makepkg

直接贴办法 原文

vim /usr/bin/makepkg

加入asroot

OPT_LONG=('allsource' 'check' 'clean' 'cleanbuild' 'config:' 'force' 'geninteg'
          'help' 'holdver' 'ignorearch' 'install' 'key:' 'log' 'noarchive' 'nobuild'
          'nocolor' 'nocheck' 'nodeps' 'noextract' 'noprepare' 'nosign' 'pkg:' 'repackage'
          'rmdeps' 'sign' 'skipchecksums' 'skipinteg' 'skippgpcheck' 'source' 'syncdeps'
          'verifysource' 'version' 'asroot')

再修改EUID:

if (( ! INFAKEROOT )); then
    if (( EUID == 0 )); then
        error "$(gettext "Running %s as root is not allowed as it can cause permanent,\n\catastrophic damage to your system.")" "makepkg"
        #exit 1 # $E_USER_ABORT
 
    fi
fi

2.修改aurman

先搜索一下错误提示的文件再哪

grep -r "Do not run aurman" /usr

再修改源文件

vim /usr/lib/python3.7/site-packages/aurman/main.py

注释os.getuid下面的再加个pass

ef check_privileges() -> None:
    """
    checks the privileges and exists in case of aurman being executed with sudo
    """
    if os.getuid() == 0:
        pass
        #aurman_error("Do not run aurman with sudo")
        #sys.exit(1)

OK

添加新评论