How to downgrade an AUR to previous version via terminal?

:: Synchronizing package databases…
endeavouros is up to date
core is up to date
extra is up to date
multilib is up to date
:: Searching AUR for updates…
:: Searching databases for updates…
→ Packages not in AUR: qgpgme-qt5
→ libelectron: local (1.0.23-1) is newer than AUR (1.0.22-1)
there is nothing to do

The libelectron update broke an AUR app I use. How can I downgrade without uninstalling and reinstalling the older version? What’s the correct way to do this?

Thanks in advance

You can simply install the older version. As long as the package name is the same, it will replace the newer version.

1 aur/libelectron 1.0.22-1 (+8 0.50) (Installed: 1.0.23-1)
    A collection of npm dependencies for electron packages.
==> Packages to install (eg: 1 2 3, 1-3 or ^4)
==> 1
AUR Dependency (1): libelectron-1.0.22-1
:: PKGBUILD up to date, skipping download: libelectron
  1 libelectron                      (Installed) (Build Files Exist)
==> Packages to cleanBuild?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> a
:: Deleting (1/1): /home/user/.cache/yay/libelectron
HEAD is now at 50e7220 LibElectron 1.0.23-1
Removing libelectron-1.0.23-1-x86_64.pkg.tar.zst
Removing libelectron-1.0.23-1.tar.bz2
  1 libelectron                      (Installed) (Build Files Exist)
==> Diffs to show?
==> [N]one [A]ll [Ab]ort [I]nstalled [No]tInstalled or (1 2 3, 1-3, ^4)
==> n
==> Making package: libelectron 1.0.23-1 (Tue 14 May 2024 06:18:21 PM)
==> Retrieving sources...
  -> Downloading libelectron-1.0.23-1.tar.bz2...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
==> ERROR: Failure while downloading https://gitlab.com/linuxbombay/libelectron/libelectron/-/archive/1.0.23-1/libelectron-1.0.23-1.tar.bz2
    Aborting...
 -> error downloading sources: /home/user/.cache/yay/libelectron 
         context: exit status 1 
         

:: (1/1) Parsing SRCINFO: libelectron
==> Making package: libelectron 1.0.23-1 (Tue 14 May 2024 06:18:23 PM)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Downloading libelectron-1.0.23-1.tar.bz2...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
curl: (22) The requested URL returned error: 404
==> ERROR: Failure while downloading https://gitlab.com/linuxbombay/libelectron/libelectron/-/archive/1.0.23-1/libelectron-1.0.23-1.tar.bz2
    Aborting...
 -> error making: libelectron-exit status 1
 -> Failed to install the following packages. Manual intervention is required:
libelectron - exit status 1

I tried that and get these manual intervention errors.

It is failing to download. That has nothing to do with the fact that it is already installed.

Look in /home/user/.cache/yay/libelectron and see if you have the old version of the package already built. If you do, you can install it with sudo pacman -U /path/to/package/file

Gotcha.

I checked the folder and there is a PKGBUILD file, but when I open it with text editor, it shows the newer version that we don’t want. The ‘src’ folder is empty.

When the downloads fail, does that usually mean the file was removed from the hosting site? For example, in this scenario, the GitLab link shown in the terminal output? I ask because I’ve run into this failure to download issue with AUR packages in the past.

In this case, you are trying to download a file that doesn’t exist. You are also trying to install the version you already have installed. Didn’t you want to download the older version? You need a PKGBUILD for the older version.

libelectron: local (1.0.23-1) is newer than AUR (1.0.22-1)

Yes, I want to downgrade from the currently installed version 23 to version 22 but for some reason even though the yay terminal says the AUR has the older version, the terminal makes it appear as if it’s trying to still re-download the new version?

It looks like the version was reverted.

Try deleting /home/user/.cache/yay/libelectron and trying again.

1 Like

It’s too bad we’re strangers on the internet, otherwise I would buy you a drink.

Thanks mate!

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.