Difference between pacman and yay for package management in Manjaro

Hi, I’m new to Manjaro and I’ve been learning how to manage packages.

I understand that pacman is the official package manager, but I’ve also seen many people using AUR helpers like yay.

Could someone explain the practical differences between using pacman directly and using a helper like yay?

In which situations is it better to stick with pacman, and when does it make sense to use yay?

I’d also like to understand any potential risks or best practices when using AUR helpers.

Thanks in advance!

Yes - many AUR helpers has capabilities of doing general system maintenance - but it is best to avoid such use.

Using an AUR helper for general system maintenance may introduce hard to solve issues.

Remember that AUR and custom build scripts are unsupported on Manjaro.

Best practise is to use the correct tool for the task

  • use pacman for system updates - thus avoiding problems with custom packages

Always do a full system update - before rebuilding custom packages.

  • use yay for custom build scripts - this is the primary use case for yay

More reading [Need-To-Know] About Manjaro and AUR

6 Likes

There’s pacman and pamac, I prefer the former.


Here’s a little more reading.

3 Likes

Arch User Repository - ArchWiki
The Arch User Repository (AUR) is a community-driven repository for Arch Linux users. It contains package descriptions (PKGBUILDs) that allow you to compile a package from source with makepkg and then install it via pacman.

Warning
AUR packages are user-produced content. These PKGBUILDs are completely unofficial and have not been thoroughly vetted. Any use of the provided files is at your own risk.

Arch User Repository - Manjaro Wiki

Use the AUR at your own risk!
No support will be provided by the Manjaro team for any issues that may arise relating to software installations from the AUR. When Manjaro is updated, AUR packages might stop working. This is not a Manjaro issue

AUR, as a community maintained repository, present potential risks and problems.

Possible risks using AUR packages:

  • Multiple versions of the same packages.
  • Out of date packages.
  • Broken or only partially working packages.
  • Improperly configured packages which download unnecessary dependencies, or do not download necessary dependencies, or both.
  • Malicious packages (although extremely rare).

As such, although much of the software packages provided by the AUR should work, do not expect the installation process to always be quite as straight-forward as when you are using the official Manjaro repositories.

On occasion, it may be necessary to manually identify and install dependencies yourself (such as, after an aborted installation attempt).

Again, there is no guarantee that any installed software will work properly, if at all.

1 Like

To sum it up:
Check your mirrors

pacman-mirrors

If the first one is not OK, refresh

sudo pacman-mirrors -f

Update the system from the repos

sudo pacman -Syu

Then update the aur

yay -Sua

For a one click routine, use the cheatsheet (actually one “hitting enter” routine, clicking on the button produces bugs sometimes)

1 Like

As with the others who responded, I always recommend using pacman first and only then dealing with any “foreign” packages e.g. AUR, Flatpak, Appimage. :wink:

A good reason is that some packages may have been dropped from the repos and you might end up installing an unwanted or now-unneeded AUR package. I’ve seen people have issues with that in the past, although I believe that has recently been “fixed” in Pamac.

2 Likes

My personal experience is that if you want to install/use packages from AUR, it is highly recommended to switch to the unstable branch of Manjaro.
sudo pacman-mirrors --api --set-branch unstable
sudo pacman-mirrors --fasttrack 5 && sudo pacman -Syu

2 Likes

@linux-aarhus
Thank you for responding my question

@dmt
Than you, you response my help to understand much of linux

@BG405
Than you for to opinion is very important

@growler
Than you for to opinion

@Teo
Thank you very much for sharing the documentation. It is very interesting to me.

Mod edit: Consecutive posts merged. :wink:

Hi,

no need to thank everyone in a different message. You can just mention them with the @ character in the same message to thank them. Like this:

Thanks @programmingManjar for your understanding.

Edit: You can even say “Thank you all”, without mentioning anyone. No one is going to be offended by that :slight_smile:

5 Likes

Your advice was a great help to me

1 Like

Your responses are appreciated. :+1:

Note however that I’ve merged your posts to keep things tidy (saves Forum bandwidth too, I hope) and added the @ mentions.. :wink: