You are not logged in.

#1 2021-08-27 08:08:55

linerman
Member
Registered: 2021-02-16
Posts: 90

[Solved] Pacman upgrade vs reinstalling group

Hi,

I would like to know how to manage my group packages.
For example: I did "pacman -S deepin-extra"  6 month ago.
At that time that group contained about 20 packages.
Later, I just have my updates with a command "pacman -Syu".
But just for curiosity once I did "pacman -S deepin-extra" and noticed that packages in that groups have changed.
Now it contains about 22 packages. But pacman did not warned me about them, so to have them I needed to sort missing packages and install them manually via "pacman -S "new package"

So, the question is how to manage such group packages?
How will I know that in some groups of packages appear new files to install ?
Will I have to manually check all my installed groups ?

Last edited by linerman (2021-08-29 07:35:36)

Offline

#2 2021-08-27 08:13:42

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,310

Re: [Solved] Pacman upgrade vs reinstalling group

That's the "caveat" of groups as opposed to meta packages that you don't automatically pull in new deps. But you do not need to manually sort them, I just occasionally do a

sudo pacman -S plasma --needed

the needed flag will automatically skip packages you already have the latest version of.

Last edited by V1del (2021-08-27 08:14:28)

Offline

#3 2021-08-27 08:59:21

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] Pacman upgrade vs reinstalling group

To simply get a list of missing packages, you can use

pacman -Sgq deepin-extra | pacman -T -

The exit status also indicates whether you're missing anything. Could be used for notifications via a pacman hook/conky/...

Offline

#4 2021-08-27 10:04:08

linerman
Member
Registered: 2021-02-16
Posts: 90

Re: [Solved] Pacman upgrade vs reinstalling group

Thanks a lot. Both commands are very useful, so I will remember them.

Raynman wrote:

Could be used for notifications via a pacman hook/conky/...

Did not know about it.
I am newbie so would you be so kind and explain with an example practical usage of it?

Offline

#5 2021-08-27 13:33:35

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [Solved] Pacman upgrade vs reinstalling group

You can create /etc/pacman.d/hooks/deepin-extra.hook with the following contents:

[Trigger]
Operation = Upgrade
Type = Package
Target = *

[Action]
Description = Checking missing deepin-extra packages:
When = PostTransaction
Exec = /bin/sh -c 'pacman -Sgq deepin-extra | pacman -T - || true'

This would be executed at the end of every pacman transaction where any package is upgraded. It simply prints the missing packages (if any), like this:

:: Running post-transaction hooks...
(1/3) Reloading system manager configuration...
(2/3) Arming ConditionNeedsUpdate...
(3/3) Checking missing deepin-extra packages:
new-pkg-name1
new-pkg-name2

The `|| true` is there to prevent an error message when `pacman -T` indicates missing packages. You could also indent the list of packages a bit (or put an arrow in front or something)

Exec = /bin/sh -c 'pacman -Sgq deepin-extra | pacman -T - | sed "s/^/        /"'

Offline

#6 2021-08-29 07:35:20

linerman
Member
Registered: 2021-02-16
Posts: 90

Re: [Solved] Pacman upgrade vs reinstalling group

Thanx! It works.

Offline

Board footer

Powered by FluxBB