Pacman (Archlinux) Can'f find a package while it's present on AUR

536 views Asked by At

I'm starting a new project with this new college year (embedded systems), and I've to use a switch from Microchip tools to STM tools. I'm using a STM32 Nucleo, so I need stm32cubeIDE to program it. Here is my issue, when I try to install it on my arch disto : sudo pacman -S stm32cubeide I've an error :

error : target not found : stm32cubeide

but if I check on aur.archlinux.org, I can see the package is actually present.

I don't think my computer is the issue, as other packages (Tried with spotify) can be installed easily. What can I do about it ?
It's not a critical issue, as I can work on Windows. But my Windows PC don't have all "coding comfort" I've on my Arch PC (All my USB, RJ45, a qwerty keyboard...)

Thanks !

1

There are 1 answers

0
Eldinur the Kolibri On

"I don't think my computer is the issue."

No it doesn't have an issue. You can fetch normal packages with sudo pacman -S package_name. The problem you encounter is a different one. These packages are in the AUR (Arch user repository). They can't be downloaded with pacman because they are contributions by arch linux users. (Note: They might contain malicious code).

The Arch User Repository is community-driven. It contains PKGBUILDs that allow you to compile a package from source with makepkg and afterwards install it via pacman.

These are the general steps to properly install it (from the AUR manual page):

  1. Acquire the build files, including the PKGBUILD and possibly other required files, like systemd units and patches (often not the actual code).

  2. Verify that the PKGBUILD and accompanying files are not malicious or untrustworthy.

  3. Run makepkg in the directory where the files are saved. This will download the code, compile it, and package it.

  4. Run pacman -U package_file to install the package onto your system.

What you really want is to have an AUR helper that automatically downloads these packages for you. Yay and aura are common ones. In most cases you can also just directly install the packages from source on github and build it yourself with the build instructions, but generally a AUR helper is a good choice if you want to use AUR packages more often. If you want to get started with this, read this document or refer to this youtube video as a great starting point.

In short, here are instructions to set up yay:

  1. First you have to fetch the yay repository, which can be done like this:

    git clone https://aur.archlinux.org/yay.git

  2. After that just cd into the folder and look closely at the PKGBUILD-file and look if it has been corrupted. If there are some suspicious intructions like rm -rf / or something similar you can run in trouble when you run that command. So practise caution!

  3. Then run the standard make-package command: makepkg -si or makepkg --syncdeps.

Now yay is successfully installed. You can use it similar to pacman. Just check the man-page for detailed info.

To install the package you require, do this:

yay -S stm32cubeide

Note: You don't have to put sudo before you execute a yay-command. It explicitly tells you if it needs sudo access privileges.