You are not logged in.

#1 2021-09-07 11:54:09

Foxhole
Member
Registered: 2015-08-14
Posts: 37

[SOLVED] Get a list of packages not available on upstream mirrors

Hello,
Years ago I did a mistake, I tried switching to blackarch to avoid compiling many tools from zero , then I got back to default arch because it was too unstable.
The problem is that I installed packages from that repo which are not available on archlinux repos, so I feel pretty confident that some tools have not been updated ever since.
So, here comes the question:
How could I get a list of the installed packages which are not available on upstream mirrors?

Last edited by Foxhole (2021-09-07 12:07:23)

Offline

#2 2021-09-07 11:55:43

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Get a list of packages not available on upstream mirrors

pacman -Qm

This will list all packages not currently in your configured mirrors, including anything you have installed from the AUR.


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2021-09-07 12:06:21

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Get a list of packages not available on upstream mirrors

I suppose there is no way to distinguish them from AUR packages, cause they are both foreign. Marking this as solved, thank you!

To fix my system, I adapted the "reinstall everything" script with this

for pkg in $(pacman -Qm | cut -d' ' -f1); do
    your_aur_helper -S $pkg
done

By paying attention to unavailable packages on AUR

Last edited by Foxhole (2021-09-07 12:12:52)

Offline

#4 2021-09-07 12:10:50

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Get a list of packages not available on upstream mirrors

You can just diff it against the list of all packages in the AUR.
https://aur.archlinux.org/packages.gz

Foxhole wrote:
pacman -Qm | cut -d' ' -f1

Can be replaced with...

pacman -Qmq

Last edited by Slithery (2021-09-07 12:13:27)


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#5 2021-09-07 12:12:26

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Get a list of packages not available on upstream mirrors

This is even better! Thank you!

Offline

#6 2021-09-07 12:49:16

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Get a list of packages not available on upstream mirrors

Slithery wrote:

Can be replaced with...

pacman -Qmq

I had ended up with

diff  --changed-group-format='%<' --unchanged-group-format='' <(sort <(pacman -Qmq)) <(sort aur_pkgs.txt)    

where aur_pkgs.txt is the extracted content of https://aur.archlinux.org/packages.gz.
I got quite surprised there where not the packages I would have expected, due to the fact that the blackarch repo kept the same AUR packages name. I ended up with

for pkg in $(pacman -Qmq); do
    your_aur_helper -S --noconfirm $pkg
done

Thank you again for your help

Last edited by Foxhole (2021-09-07 12:51:18)

Offline

#7 2021-09-07 12:55:01

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,499
Website

Re: [SOLVED] Get a list of packages not available on upstream mirrors

If you are using an AUR helper that would install a package that way, I'm pretty sure it would also update them without needing to explicitly list them with another flag (e.g., seveal "full featured" aur helpers would use flags like -Syua).


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#8 2021-09-07 13:06:52

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Get a list of packages not available on upstream mirrors

Trilby wrote:

several "full featured" aur helpers would use flags like -Syua

Thank you, I just realized that the proper solution was to use

for pkg in $(pacman -Qgq blackarch); do
    trizen -Syua --noconfirm $pkg
done

Due to the fact that those packages had a group (blackarch) and now they have an equivalent on the AUR repo. Sorry abut the fuss and thank you all for the help.

Offline

#9 2021-09-07 14:26:52

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,499
Website

Re: [SOLVED] Get a list of packages not available on upstream mirrors

Ah, no, you missed the point, `trizen -Syua` would have been sufficient.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2021-09-07 14:57:02

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Get a list of packages not available on upstream mirrors

Trilby wrote:

Ah, no, you missed the point, `trizen -Syua` would have been sufficient.

I had always did that to update AUR packages, and those blackarch packages didn't got updated for years (because they were not recognized as aur packages maybe? I don't know honestly).
After doing the command I wrote before, the packages I had installed when using blackarch repos had been replaced with the aur ones and those packages dropped the blackarch group attribute, now they are recognized by trizen as proper AUR packages.

Last edited by Foxhole (2021-09-07 14:58:07)

Offline

#11 2021-09-07 14:58:35

thiagowfx
Member
Registered: 2013-07-09
Posts: 586

Re: [SOLVED] Get a list of packages not available on upstream mirrors

One more thing, currently you're running those commands one-by-one, that's rather slow...

<helper> -Syua --noconfirm foo
<helper> -Syua --noconfirm bar
<helper> -Syua --noconfirm baz

Besides Trilby's point that you don't even need to list those AURs packages separately, you also don't need a for loop. Just do:

<helper> -Syua --noconfirm foo bar baz

...which for your example would be

<helper> -Syua --noconfirm $(pacman -Qgq blackarch | paste -sd '')

The only scenario I can think of where a for loop would be reasonable is if you were running `makepkg` one-by-one.

Offline

#12 2021-09-07 15:02:18

Foxhole
Member
Registered: 2015-08-14
Posts: 37

Re: [SOLVED] Get a list of packages not available on upstream mirrors

thiagowfx wrote:

...which for your example would be

<helper> -Syua --noconfirm $(pacman -Qgq blackarch | paste -sd '')

The only scenario I can think of where a for loop would be reasonable is if you were running `makepkg` one-by-one.

That's a good point, I hadn't thought about it. At least I got lucky that there were a few packages only.

Offline

#13 2021-09-07 17:50:07

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,499
Website

Re: [SOLVED] Get a list of packages not available on upstream mirrors

Foxhole wrote:

I had always did that to update AUR packages, and those blackarch packages didn't got updated for years (because they were not recognized as aur packages maybe? I don't know honestly).

They weren't updated by trizen as long as your had the blackackarch repo listed in your pacman.conf.  But as soon as that was removed, a trizen update would have (tried to) update them too.  Once installed on your system, there is no such thing as an "aur package".  What Trizen and other aur helpers do is get the output from pacman -Qm (some directly, some via the equivalent function in libalpm) and then try to update each of these non-repo packages from the AUR.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

Board footer

Powered by FluxBB