You are not logged in.

#1 2020-10-06 08:08:30

laszlohehehe
Member
Registered: 2020-05-07
Posts: 14

[SOLVED] How to clean up after a test PKGBUILD installation?

Hello everyone

I am still fairly new to creating PKGBUILDs and I have most of the basics down, but one thing that I have been wondering is about the PKGBUILD writing workflow and I haven't noticed this mentioned anywhere.

When I write a PKGBUILD, I test it out locally by seeing if I can build it using `makepkg -s`.

This of course leads to the package being installed on my system. I have been manually removing the stuff the PKGBUILD installs on my system up until now but I feel certain that there must be a safer and cleaner way of doing it?

Sorry for the newbie question but I reckon there must be some wisdom here I missed smile

best

Last edited by laszlohehehe (2020-10-06 09:02:16)

Offline

#2 2020-10-06 08:11:45

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,867

Re: [SOLVED] How to clean up after a test PKGBUILD installation?

makepkg -s doesn't lead to the package getting installed. It leads to the dependencies that are in the repos to be installed and there should be little to no reason to change or remove these arbitrarily.

You can pass the -r flag in addition that will automatically clean up the dependencies when you are not actually installing the package and will thus lead to a Dependency based installation when you actually do end up installing the package which will get removed by a pacman -Rsn of the main package.

man makepkg wrote:

-r, --rmdeps
           Upon successful build, remove any dependencies installed by makepkg during dependency auto-resolution and
           installation when using -s.

Last edited by V1del (2020-10-06 08:17:58)

Offline

#3 2020-10-06 08:24:30

laszlohehehe
Member
Registered: 2020-05-07
Posts: 14

Re: [SOLVED] How to clean up after a test PKGBUILD installation?

V1del wrote:

makepkg -s doesn't lead to the package getting installed. It leads to the dependencies that are in the repos to be installed and there should be little to no reason to change or remove these arbitrarily.

You can pass the -r flag in addition that will automatically clean up the dependencies when you are not actually installing the package and will thus lead to a Dependency based installation when you actually do end up installing the package which will get removed by a pacman -Rsn of the main package.

man makepkg wrote:

-r, --rmdeps
           Upon successful build, remove any dependencies installed by makepkg during dependency auto-resolution and
           installation when using -s.

sorry, I meant to say:

makepkg -si

This of course builds and installs the package using PACMAN.

... And I just realised that you can actually just use pacman to remove it again. lol

Offline

#4 2020-10-06 08:53:13

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 10,867

Re: [SOLVED] How to clean up after a test PKGBUILD installation?

...

Well yes. Please mark as [SOLVED] by editing the title in your first post:

Offline

#5 2020-10-06 09:12:34

laszlohehehe
Member
Registered: 2020-05-07
Posts: 14

Re: [SOLVED] How to clean up after a test PKGBUILD installation?

V1del wrote:

makepkg -s doesn't lead to the package getting installed. It leads to the dependencies that are in the repos to be installed and there should be little to no reason to change or remove these arbitrarily.

You can pass the -r flag in addition that will automatically clean up the dependencies when you are not actually installing the package and will thus lead to a Dependency based installation when you actually do end up installing the package which will get removed by a pacman -Rsn of the main package.

man makepkg wrote:

-r, --rmdeps
           Upon successful build, remove any dependencies installed by makepkg during dependency auto-resolution and
           installation when using -s.

That's a nice tip. Thank you

Offline

#6 2020-10-06 15:37:15

GaKu999
Member
From: US/Eastern
Registered: 2020-06-21
Posts: 382

Re: [SOLVED] How to clean up after a test PKGBUILD installation?

laszlohehehe wrote:
V1del wrote:

makepkg -s doesn't lead to the package getting installed. It leads to the dependencies that are in the repos to be installed and there should be little to no reason to change or remove these arbitrarily.

You can pass the -r flag in addition that will automatically clean up the dependencies when you are not actually installing the package and will thus lead to a Dependency based installation when you actually do end up installing the package which will get removed by a pacman -Rsn of the main package.

man makepkg wrote:

-r, --rmdeps
           Upon successful build, remove any dependencies installed by makepkg during dependency auto-resolution and
           installation when using -s.

That's a nice tip. Thank you

If you feel capable of the setup, you can try preparing a clean chroot for building the packages, so that they will not affect your running environment at all.
Wiki: https://wiki.archlinux.org/index.php/De … ean_chroot

If you prepare it as a tmpfs you can even make it faster if you really need speed for, let's say, a 2GiB building workflow.
Or just if you don't want to trigger wear in your SSD.


My reposSome snippets

Heisenberg might have been here.

Offline

Board footer

Powered by FluxBB