You are not logged in.

#1 2022-11-20 15:52:33

a2n
Member
Registered: 2022-11-09
Posts: 8

 [SOLVED] check update without sudo

I am making a widget for KDE plasma that counts the result of "pacman -Sup" and I realized that if I don't do "sudo pacman -Syu" before, the total is not necessarily updated.

Is my observation correct?

If yes, is it possible to update the db without using sudo or asking the user for his password?
Knowing that I just want to be able to retrieve the result of the command "pacman -Sup", I don't want to install anything instead of the user.

Thank you.

Last edited by a2n (2022-11-20 16:01:07)

Offline

#2 2022-11-20 15:55:08

mpan
Member
Registered: 2012-08-01
Posts: 1,608
Website

Re:  [SOLVED] check update without sudo

Offline

#3 2022-11-20 15:57:18

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

Re:  [SOLVED] check update without sudo

Just use the command checkupdates from the pacman-contrib package.


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

#4 2022-11-20 15:59:43

a2n
Member
Registered: 2022-11-09
Posts: 8

Re:  [SOLVED] check update without sudo

Ok I found this answer on the wiki, and, for no reason I thought it was installed with pacman.
Since the command did not work, I did not look any further.  I'm tired I guess haha.

Thanks !

Offline

#5 2022-11-20 16:06:02

karabaja4
Member
From: Croatia
Registered: 2008-09-14
Posts: 1,048
Website

Re:  [SOLVED] check update without sudo

If you only want to count updates, you can use checkupdates command from pacman-contrib package. Set the CHECKUPDATES_DB environment variable to specify the database path if you wish.

Check my script updates.sh and _cu() function for examples.

Otherwise, check the source of the /usr/bin/checkupdates script for examples on how to run pacman as non-root.

Last edited by karabaja4 (2022-11-20 16:09:32)

Offline

Board footer

Powered by FluxBB