Ignore package in a repo and prefer the aur package

I have the Archlinuxcn set up, it is handy for some larger packages (browsers etc) and emacs-git, or I thought it was.

Their emacs-git does not have the native compilation flag set, so I would rather compile it.

How can I ignore a package and prefer the aur version?

Ahhh, found the problem - today the Archlinuxcn package rel number is higher than the aur package:

Aur                           archlinuxcn
emacs-git 30.0.50.166798-1 -> 30.0.50.166798-2

This has never happened before, causes my script to fail :frowning:

Won’t adding it to IgnorePkg line in /etc/pacman.conf do?

Most AUR helpers honor that line as well so that may cause it to be ignored completely.

Nope:

IgnorePkg = sqlitestudio sqlitestudio-plugins tree-sitter-bash-git
IgnorePkg = archlinuxcn/emacs-git
#IgnorePkg = emacs-git
  • Uncomment bottom line - nothing installs.
  • It ignores repo/pkg

It isn’t easy to do this actually. It is one of the challenges with using big 3rd party repos.

You could maybe try creating an alias to update with and adding aur/emacs-git --needed to the update. You would need to test though.

1 Like

That was what I was doing, but today the repo package is a higher number:

DAY=$(date +"%u")
echo ">>>>>>>>>"$DAY
if [[ "$DAY" == "7" ]]; then 
    echo "Equal"
    sudo sed -i 's/^IgnorePkg = emacs-git/#IgnorePkg = emacs-git/' /etc/pacman.conf
    echo "emacs-git" > $HOME/.up.txt
    yay -S aur/emacs-git --noconfirm
else
    echo "Not Equal"
    sudo sed -i 's/^#IgnorePkg = emacs-git/IgnorePkg = emacs-git/' /etc/pacman.conf
fi

IMHO, using a script for this specific problem is overdoing.
If the problem is temporary, use the Normal Method to upgrade packages:

  1. Update the system with pacman, using --ignore <package>
  2. Update AUR packages using an AUR helper.

If the problem is kind-of permanent, create a separate pacman.conf file, and insert appropriate directives for each of the upgrade types (repos, AUR). Then upgrade using the Normal Method and supplying different config. Example:

sudo pacman -Syu
trizen -Sua --config /etc/pacmanAUR.conf