How do I install an app using pkg.tar.gz

Hi,

I want to download an app, but the only linux file is a a pkg.tar.gz .

Can I use yay or pacman to turn the file into an app?

It depends, if this is only source code the developer should give instructions how to build it.

I would first check if this app is available in AUR, that would make things a lot easier

Hi and welcome to the forum. What is the program?

Hi @anime_oni

cd to file

sudo pacman -U ./yourpackage.pkg.tar.gz

One caution: .pkg.tar.gz is an unusual format for Arch-based systems.

  • Double-check the source is trustworthy.

Also be aware: since this isn’t from a repository,
pacman won’t automatically update it.
You’d have to manually download and reinstall each new version yourself.

sudo pacman -U ./yourpackage.pkg.tar.gz

This only works for Arch packkages, not for source code afaik

Think Arch uses .zst and not .gz so the -U option will not work in this case. But maybe there is a package in the AUR,for this (mysterious) app ? Or a github page with instructions for compiling it yourself.

Please share the name of the application. That would help a lot. This looks like a application source code.

Also look at the instructions given by the app developer. They will have detailed instructions.

Verify if this application installs stuff in /opt or in /usr. Since this is compiled from source it ought to put it in /opt and not in /usr

I’d like to caution too @anime_oni, if you try to install the mystery application in a way that circumvents the Arch package management system, it risks littering your system with un-tracked files that are difficult to remove later, and/or may conflict with other Arch packages.

You may have no intention of doing that, but I just wanted to note it, just in case.

To avoid this, your simplest option would be to use an AppImage or Flatpak option, if the developer provides that, and there’s no existing Arch / AUR package for it.

You could use an AI to generate a PKGBUILD file (provide name, version, source package url, dependencies and the build instructions). Place it in the source directory and install it with “makepkg -si”. You would have to do it again or change the PKGBUILD to your needs, if updated versions are available.

But that’s a very sloppy way and I wouldn’t recommend it if there are other ways like AppImage or flatpak.

If you do, you do it on your own risk.