How to edit/change PKGBUILD files in GUI Pamac

Hi there,

I have a noob question, maybe s.o. can help me. I tried to install freefilesync-bin and got error messages. So I went to the Archlinux page of the maintainer of that package and received the following code as feedback:

diff --git a/PKGBUILD b/PKGBUILD
index 6ddf79e..193e123 100644
@@ -28,7 +28,7 @@ source=(
-    "90630cc8c77d39af8e7746ce664738f9590ea7586454c90a66ad09248c41eb4f"
+    "91cc1218fe6fef85cd4fc52c8649ab533dcc371f462a136db695220e5d6d6ee7"
@@ -38,7 +38,9 @@ package() {
     install -d "$pkgdir/opt/$_pkgname"

     # extract installer archive from installer binary
-    tail -c +38028 "$srcdir/FreeFileSync_${pkgver}" > "$srcdir/FreeFileSync_${pkgver}_Install.tar"
+    offset=$(grep -abo -m 1 -F "<FFS_TAR_START>" "$srcdir/FreeFileSync_${pkgver}" | cut -d : -f 1)
+    offset=$((offset + 16))
+    tail -c +${offset} "$srcdir/FreeFileSync_${pkgver}" > "$srcdir/FreeFileSync_${pkgver}_Install.tar"

     # extract inner archive, freefilesync-mime.xml and .desktop files from installer archive
     tar -xf "$srcdir/FreeFileSync_${pkgver}_Install.tar" -C "$srcdir" --wildcards \

From what I understood is that I need to modyfy the PKGBUILD files in Pamac. Unfortunately I’m struggeling to understand the userinterface of Pamac to do so. I get three tabs presented: PKGBUILD / .install / dlagent
Do I need to create a seperate file? How? Or just copy the code in one of the tabs and hope the magic of Pamac is sorting out what I’m doing? I have seen when I do so there are additional tabs created. The userinterface is just not intuitive enough to make it right…

Hi @Nudnik_de,

While I’ve never done it (never had the need to) I think you’d need to download the .PKGBUILD file to your desktop, and edit it there. Or something. I’m not sure.

I then think you’d have to install it manually. But check this:

Also see:

Fundamentally, PKGBUILD files are to be used with makepkg
(as opposed to the various AUR helpers, of which pamac is one)

You can use that .diff file against the original PKGBUILD
to have all the changes applied
and then use that new PKGBUILD to build/install the software

I don’t think you can do this part (applying the patch) of the task with pamac.

Download the PKGBUILD and apply the patch to it
then you have an updated PKGBUILD file which you can use.

Then change into the directory where the updated PKGBUILD is and issue:
pamac build

It will pick up that PKGBUILD and use it.

Or use makepkg in the same way.

How to apply the patch?
man patch

patch PKGBUILD your_patch_file

you end up with an altered PKGBUILD which you then can use

1 Like

Thanks for pointing me into this direction. Never done it before but I will find out…

A patch file can be applied using the patch command.

Another method is to do it manually

look at your PKGBUILD

locate lines which in the patch has a - - remove it
add the lines which has a +

but do it at the same location in the file

Should this work in Pamac GUI as well?

You cannot patch from the GUI - but you can edit the PKGBUILD in the GUI

  • click on the package in the GUI
  • click the build files tab

removing and adding lines work the same - suffice you follow the layout.

a - indicates remove the line
a + indicates add the line at the precise location - defined by

Great! Thanks, it worked. Allthough only in the second install run. The first run it seems that it was not applying the changes I did…

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.