You are not logged in.
hi, i'm currently using the checkupdate script (https://gitorious.org/pacman/mainline/c … 4b7a793326), and it shows me which packages need upgrade.
it shows the version i'm currently running on my machine, but it doesn't show which version would i upgrade to.
does anyone know of a patch for this scripts or some other cli tool that would show me the new versions of packages to be upgraded ?
thanks in advance
Offline
Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?
:: Starting full system upgrade...
resolving dependencies...
looking for inter-conflicts...
Packages (6):
Name Old Version New Version Net Change Download Size
testing/cloog 0.18.1-2 0.18.1-3 0.02 MiB 0.08 MiB
testing/gcc 4.9.0-3 4.9.0-4 -2.63 MiB 21.34 MiB
testing/gcc-libs 4.9.0-3 4.9.0-4 0.00 MiB 1.06 MiB
testing/isl 0.12.2-1 0.13-1 0.29 MiB 0.51 MiB
testing/xf86-video-intel 2.99.911-2 2.99.912-1 0.24 MiB 0.64 MiB
Total Download Size: 23.62 MiB
Total Installed Size: 89.17 MiB
Net Upgrade Size: -2.08 MiB
:: Proceed with installation? [Y/n] Offline
Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?
because it's not used here? It's a -Qu not a -Su operation that is being done, just listing packages.
If you replace, in the script, the -Qqu with simply -Qu you should get both versions displayed. (Side note, kalu can be compiled as CLI, if you want e.g. info about AUR or watched (i.e. non-installed) packages.)
Offline
karol wrote:Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?
because it's not used here?
I meant: don't use that script, use 'pacman -Syu'.
Offline
jjacky wrote:karol wrote:Why not just use pacman with VerbosePkgLists option enabled in pacman.conf?
because it's not used here?
I meant: don't use that script, use 'pacman -Syu'.
Oh; But (I assume) he only wants to know about pending updates, not necessarily do the upgrade right away. That's the point of such tools/scripts, to know about available updates without having to sync/apply them right away.
Offline
The current 'checkupdates' included in pacman doesn't show any versions:
$ checkupdates
cloog
gcc
gcc-libs
isl
libsystemd
s-nail
systemd
systemd-sysvcompat
xf86-video-intelOffline
Oh; But (I assume) he only wants to know about pending updates, not necessarily do the upgrade right away. That's the point of such tools/scripts, to know about available updates without having to sync/apply them right away.
~ ❯ # pacman -Syu
[sudo] password for anoknusa:
:: Synchronizing package databases...
core 110.7 KiB 506K/s 00:00 [--------------------------------------------------------] 100%
extra 1679.4 KiB 949K/s 00:02 [--------------------------------------------------------] 100%
community 2.2 MiB 1016K/s 00:02 [--------------------------------------------------------] 100%
multilib is up to date
:: Starting full system upgrade...
resolving dependencies...
looking for inter-conflicts...
Packages (2):
Name Old Version New Version Net Change Download Size
core/binutils 2.24-4 2.24-5 0.07 MiB 4.08 MiB
community/nodejs 0.10.28-3 0.10.29-1 -0.78 MiB 3.16 MiB
Total Download Size: 7.24 MiB
Total Installed Size: 37.73 MiB
Net Upgrade Size: -0.71 MiB
:: Proceed with installation? [Y/n] n
~ ❯ Without more input from the OP, it's hard to imagine what purpose knowing the version number without upgrading would serve. In anticipation of a possible response: Partial updates are not supported and strongly discouraged.
Offline
'echo n | sudo pacman -Syu' should work w/o user input.
'pacman -Qu' shows the current versions, not the new ones.
Offline
Right, so anything involving Sy without u (inc. saying no to performing the upgrade) isn't good/supported, obviously. Which leads us back to such tools/scripts, handling using temporary dbs automatically.
'pacman -Qu' shows the current versions, not the new ones.
Oh? Does for me:
% pacman --dbpath /tmp/checkup-db-jjacky/ -Qu | head -1
binutils 2.24-4 -> 2.24-5Although I just realized I'm running a pacman-git so maybe it's new/doesn't do it with the latest stable?
Offline
$ pacman -Qu | head -1
cloog 0.18.1-2I edited the 'checkupdates' script:
#pacman -Qqu --dbpath "$CHECKUPDATES_DB" 2> /dev/null
/usr/bin/paste -d " " <(/usr/bin/printf "%-20.20s %-20s => \n" $(/usr/bin/pacman -Qu)) <(/usr/bin/pacman -Sdp --print-format "%v" $(/usr/bin/pacman -Qqu))$ checkupdates
cloog 0.18.1-2 => 0.13-1
gcc 4.9.0-3 => 0.18.1-3
gcc-libs 4.9.0-3 => 4.9.0-4
isl 0.12.2-1 => 4.9.0-4
libsystemd 213-8 => 213-9
s-nail 14.6.4-1 => 14.7-1
systemd 213-8 => 213-9
systemd-sysvcompat 213-8 => 213-9
xdg-utils 1.1.0.git20140207-1 => 1.1.0.git20140426-1
xf86-video-intel 2.99.911-2 => 2.99.912-1Edit: This doesn't look right. The version numbers got mixed up - look at cloog for example.
Last edited by karol (2014-06-10 17:21:51)
Offline
Edit: This doesn't look right. The version numbers got mixed up - look at cloog for example.
Yeah I'm guessing the order from -Sdp isn't the one you'd like, because packages might be ordered based on which repo they were found or something (since pacman would still process a dependency before the package requiring it and such), so you can't really do that. (Also you'd want to double the "d" else it could still pull new dependencies.)
Offline
thanks, what im looking for is to know to which versions im updating the packages... some of what i have move so fast i dont know what id be installing before doing pacman -Syu, not doing partial updates
Offline
some of what i have move so fast i dont know what id be installing before doing pacman -Syu
What do you mean by this? What "moves so fast," and how do you not know what you're installing?
Right, so anything involving Sy without u (inc. saying no to performing the upgrade) isn't good/supported, obviously. Which leads us back to such tools/scripts, handling using temporary dbs automatically.
"pacman -Sy <package> is a bad idea, but simply refreshing the database is fine. There are no "temporary" pacman databases. The danger in partial upgrades is in installing packages whose libraries or dependencies conflict with other installed packages. The purpose of the checkupdates script is to pipe a list of pending updates to some status or notification script or daemon; it's to alert you that there are updates, not provide a complete run-down of everything awaiting approval. If you need comprehensive information on software that is installed or is to be installed, the package manager is there for you. You can always choose not to proceed with an update without any risk, provided the next system update is a complete one.
Last edited by ANOKNUSA (2014-06-10 19:48:05)
Offline
What about
$ expac "%n %v" -S $(checkupdates)
flashplugin 11.2.202.359-1
s-nail 14.7-1Offline
Edit the checkupdates script and take out the -q quiet switch on line 40. It should look like this
40 pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/nullOffline
"pacman -Sy <package> is a bad idea, but simply refreshing the database is fine. There are no "temporary" pacman databases. The danger in partial upgrades is in installing packages whose libraries or dependencies conflict with other installed packages. The purpose of the checkupdates script is to pipe a list of pending updates to some status or notification script or daemon; it's to alert you that there are updates, not provide a complete run-down of everything awaiting approval. If you need comprehensive information on software that is installed or is to be installed, the package manager is there for you. You can always choose not to proceed with an update without any risk, provided the next system update is a complete one.
Actually, no. Doing a pacman -Sy, or "simply refreshing the database" as you put it, is just as bad, because then your next "pacman -S foobar" is really a "pacman -Sy foobar" And that's exactly why tools/scripts like the ones mentionned here use "temporary" databases, as in they make a temporary copy of the dbs, and sync those to get the list of available updates *without* affecting the system.
Quoting the very link you yourself posted earlier:
Do not use pacman -Sy package or any equivalent such as pacman -Sy and then pacman -S package
So you don't want sucha tool/script to perform a -Sy, because then you will forget about it and it will lead you to doing a "-Sy foobar" without realizing it, and wondering why everything is broken.
Offline
Quoting the very link you yourself posted earlier:
Do not use pacman -Sy package or any equivalent such as pacman -Sy and then pacman -S package
Indeed. Now read the next sentence in that section.
I'm still curious as to why the the OP needs to know what version a package will be upgraded to before actually considering an update---if the idea is to hold off until a particular package reaches a particular version, that's just a bad idea---but I'm afraid I've already derailed this thread, so I'll stop.
Offline
Ok, so I've been messing around with the checkupdates script some more, my previous post only shows the old version number of the packages that need to be upgraded. Here is the new code that will print out the packages that need to be updated along with the old version number and the new version number in the format PackageName OldVersion => NewVersion.
40 # pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null
41 PACKNAME=($(pacman -Qqu --dbpath "$CHECKUPDATES_DB" 2> /dev/null))
42 OLDVER=($(pacman -Qu --dbpath "$CHECKUPDATES_DB" 2> /dev/null | awk -v ORS=' ' '{ print $2 }'))
43 NEWVER=($(pacman -Si --dbpath "$CHECKUPDATES_DB" ${PACKNAME[@]} 2> /dev/null \
44 | awk -v ORS=' ' '/^Version/ { print $3}'))
45 for ((i=0; i<${#PACKNAME[@]}; i++)) do
46 echo -e "${PACKNAME[$i]}\t${OLDVER[$i]} => ${NEWVER[$i]}"
47 doneEdit:
Minor point: awk handles pattern matching, so you don't need the grep pipe.
Fixed.
Last edited by fungle (2014-06-10 23:43:46)
Offline
Nice.
Minor point: awk handles pattern matching, so you don't need the grep pipe.
Offline
Nice indeed.
(And just for the record, next version of pacman will indeed do so on -Qu)
Offline
Here's my thought, to those that are messing with the script itself. When you've gotten it to do something productive (like adding version numbers to the output), offer that as a commit upstream. It'd be nice if it were to become official!
All the best,
-HG
Offline
That's true, however, as per jjacky's post, pacman -Qu will do what my little hack just did so eventually it'll be redundant.
Offline
thanks a lot to you all for the feedback !!
will use the updated script from fungle, until pacman -Qu does the same ![]()
Offline
It would be good if someone sent a patch to pacman-dev to implement this...
Offline
Yes send the patch, send the patch, Not make the benefit only for you, I'm sure all want it.
Life is a two way road
I could do it but I'm not sure if the change is finished or you do want add more
Last edited by Jristz (2014-06-11 03:52:59)
Lenovo ThinkPad L420 modified
:: Intel i7 2560QM :: 8 GB RAM :: SSD 256 GB ::
:: DVD read+Writter :: 3 USB 3.0 Expresa Card ::
:: a Favulous 1 mins lasting Io-Li battery ::cry::
Offline