Need help with an AUR Package

I’m testing an aur package I’m creating and it keeps giving me an error.

cp: cannot create directory '/home/s4ndm4n/RocketUi/pkg/rocketui/etc/skel/.config/': No such file or directory

Below is the PKGBUILD code.

# Maintainer : S4NDM4N <sadaruwan12 at gmail dot com>

pkgdesc="An alternative user interface based on Xfce desktop environment."

package() {

    # Going in to the folder with files.
    #cd "${pkgname}"

    # Installing readme.
    install -Dm644 "${pkgname}/" -t "${pkgdir}${usrSharePath}/doc/${pkgname}"

    # Installing license.
    install -Dm644 "${pkgname}/LICENSE" -t "${pkgdir}${usrSharePath}/licenses/$pkgname/"

    # Starting the installation.
    for i in autostart cortile plank rofi ulauncher xfce4; do
       cp -r "${pkgname}/.config/${i}" "${pkgdir}${skelPath}/.config/"

    cp plankthemesettings/docks.ini "${pkgdir}${skelPath}/.config"
    cp ${usrSharePathSource}/applications/* "${pkgdir}${usrSharePath}/applications"
    cp ${usrSharePathSource}/icons/* "${pkgdir}${usrSharePath}/icons"
    cp -r "${usrBinPathSource}/themes/*" "${pkgdir}${usrSharePath}/themes"
    cp -r ${usrSharePathSource}/plank/themes/rocketplank "${pkgdir}${usrSharePath}/plank/themes"
    install -Dm755 "etc/xdg/xdg-rocket/.bashrc" -t "${pkgdir}/etc/xdg/xdg-rocket"
    install -Dm755 "etc/xdg/xdg-rocket/.xinitrc" -t "${pkgdir}/etc/xdg/xdg-rocket"
    install -Dm755 "etc/xdg/xdg-rocket/xinitrc" -t "${pkgdir}/etc/xdg/xdg-rocket"
    install -Dm644 "etc/lightdm/lightdm.conf.d/60-rocket.conf" -t "${pkgdir}/etc/lightdm/lightdm.conf.d"
    install -Dm644 "${usrSharePathSource}/xessions/Rocket.xsession" -t "${pkgdir}${usrSharePath}/xsessions"

    # Setting the current system to use rocket Ui.
    if ! [[ -d "${homedir}/.config" ]]; then
        mkdir -p "${homedir}/.config"

    for i in autostart cortile plank rofi ulauncher xfce4; do
        cp -r "${skelPath}/.config/${i}" "${homedir}/.config"
        chown -cR "${USER}:${USER}" "${homedir}/.config/${i}"

    if ! [[ -f "${homedir}/.config/docks.ini" ]]; then
        cp -r "${skelPath}/.config/docks.ini" "${homedir}/.config"

    chown -cR "${USER}:${USER}" "${homedir}/.config/docks.ini"

    cp "/etc/xdg/xdg-rocket/.bashrc" "${homedir}/.bashrc"
    papirus-folders -C violet --theme Papirus-Dark

The sources for the for loops is in the path ${pkgname}/.config/. I does create the and copies the two file at the start. LICENSE and README but when it hits the for loop it gives me an error.

Can someone please help me?

just a guess, but before the first for loop you should create the "${pkgdir}${skelPath}/.config/" directory if it’s not there, probably something is missing in the path, so you should try a mkdir before the loop

1 Like

Where is variable homedir defined?

That seems like a terrible PKGBUILD, bordering malicious.

Installing a package from the AUR should not touch your home directory. And it should definitely not overwrite your .bashrc! :open_mouth:


Why don’t you tell me or teach me how to put the files I need to be in the user’s .config folder without being as you say malicious.

Also, if you take a look I’m not installing any software.

I thought ${homedir} is a system variable for the script to get the user’s local .config file.

You shouldn’t be doing that. You shouldn’t be touching the user’s home directory and anything within it.

If you want to install some configs, that’s what /etc is for.


As already pointed out, this PKGBUILD is doing some things it shouldn’t. This isn’t suitable for posting to the AUR.

A package should never write into a user’s home directory. More importantly, building a package should never modify the system. Only installing the package should do that. Also, you can’t assume that the user building the package is the same as the user installing it.

More things:

  • This should be named rocketui-git based on what you are doing here.
  • You should be using a pkgver function for this

User config that is needed for a DE is typically delivered to /etc/skel and then it is automatically added to new users when they are created. Either that or you a deploy a script that modifies the files in the user’s home dir and provide instructions for the user to run it manually.


That won’t always be available. You can’t count on that in a script. $HOME is more widely available but you shouldn’t use it in a PKGBUILD.


If you really need something in the user directory, it should be handled by the program/script when it is launched the first time.

Thank you. I should break out the part where I’m handling the copying files to the user’s .config folder and put it in a .sh script.

And leave the rest as it is. I’ve made a lot of changes since I posted this post. This is my first PKGBUILD so, I am bound to make mistakes. Thank you for pointing them out.

I’ll post my updated script after some more testing.

As @dalto mentioned I will rename this to rocketui-git. Also, one more question what do you mean by,

I do have the pkgver and pkgrel defined at the top. Do you mean I should use '${pkgver} instead of '${pkgname}?

No, he means you should create a new function. If you use source from git, copy here:

pkgver() {
  cd "$srcdir/${pkgname%-git}"
  printf "r%s.%s" "$(git rev-list --count HEAD)" "$(git rev-parse --short HEAD)"

This function is just an example. You can change it whatever you want.

  • This function automatically changes the version to your PKGBUILD when running makepkg. You don’t need to set the version manually.

  • You don’t need to update this version in PKGBUILD when the git source gets a new commit, because any executable AUR helper will automatically recognize the new commit from this source. It will prompt you to update.

1 Like

Thank you @Zesko. I’ll look into this. The main documents didn’t say anything about something like this. Or I might have missed it.


1 Like

I didn’t read that one thank you.