You are not logged in.
Ok, here's what I would like to do. I want to compare the versions of the packages installed on my system against the versions in the repos, just like "pacman -Syu". But, I would like pacman to simply list the packages instead of asking to install. I want to copy the list output to a file.
I'm aware of the --noconfirm option, but I don't want pacman to take any action at all, simply list the packages.
Can this be done?
Hi. I'm a sig. What are you?
Offline
pacman -Syp
This updates your package database and prints out the URL of packages which could be updated. Of course this is not what you want but the closest thing to that.
Greets
dojo
Offline
pacman -Syp
Thanks dojo. Does this also list the package names? I can't test it on my machine because everything's up to date. If it does, then I can work with that.
I'm just trying to find a better way for conky to let me know what updates are available. As it is now, I have to use the --noconfirm and -w options so that the pacman will quit at some point. If I use pacman -Syu, pacman will keep running until it gets some sort of confirmation, which it will never get.
Here's what I have now.
#!/bin/bash
LOGFILE=pacman.log
pacman -Sywu --noprogressbar --noconfirm > pacman.log
if less $LOGFILE | grep "Target"; then
sed -n '{/^Target.*/p;/^ .*/p}' pacman.log | cut -b 10-
else
echo No updates available.
fi
This works, but I'd rather not have to download the packages everytime.
Hi. I'm a sig. What are you?
Offline
IIRC, the -p option lists the URIs to the packages, eg:
http://www.mirror.net/path/to/parkages/ … pkg.tar.gz
You should be able to use awk or cut or something to extract the packagename out of that path; cut it between the last / and the last -. (This is why pkgver isn't allowed to have a - in it! ;-))
Dusty
Offline
Assuming you're in a -Sy state, you can use:
pacman -Sup | sed 's|.*/([^-]*)-(.*).pkg.tar.gz|1 upgrade 2|g'
Offline
IIRC, the -p option lists the URIs to the packages, eg:
http://www.mirror.net/path/to/parkages/ … pkg.tar.gz
You should be able to use awk or cut or something to extract the packagename out of that path; cut it between the last / and the last -. (This is why pkgver isn't allowed to have a - in it! ;-))
Dusty
I was afraid of that. You're right though, I can get what I need from that.
Daniel
Hi. I'm a sig. What are you?
Offline
Assuming you're in a -Sy state, you can use:
pacman -Sup | sed 's|.*/([^-]*)-(.*).pkg.tar.gz|1 upgrade 2|g'
That's handy. Just have to format the output a liitle so that conky doesn't eat up too much real estate. Thanks.
Daniel
PS. It probably would have taken me all night to come up with that regexp expression. I stink with that.
Hi. I'm a sig. What are you?
Offline