Skip to content

How to find new packages?

Is there an easy way to see packages that are new (not updated) to the official (not AUR) repos?

3 points9 comments
Open on Reddit
About this post
Posted
Archived
Score
3 · 71% up
Kind
Text
ID
ndtzvm

Author

3
posts
83
comments
0
media
View profile

11 comments

you can run something like this daily.. firt time it will run, it will give an error about file not found but will be Ok on the second run.
#!/bin/bash
mv pkg-list.txt pkg-old.txt # keep previous package list
pacman -Ssq > pkg-list.txt # generate the current list of available packages
diff pkg-list.txt pkg-old.txt # diff the 2 lists

5 points

No, I don't think anything like that exists. If you know a little programming, write it yourself. You need to keep the list of known packages, have a service polling for updated packages once per hour or so (Arch has RSS for official packages update), exclude known packages from the result set and you have the list of new packages. The hardest part is XML parsing, for reliable parsing you should find a library, and I believe finding the library will be the most time-consuming task.

Edit: I was making the solution more complex than it should, u/slayerizer solution is superior. You already have the package database, just query for the list of current ones and exclude the know packages. You can use pacman -Slq to get the name of available packages in your database, then compare it with the old one to find out what packages are added added, this way no parsing or background service needed. Below is a short shell script to demonstrate how it works, update to query new package list, view to see what packages are added, save to mark things as read so the next view does not print the packages. Note that view also reports the packages removed, it may or may not be what you want.

#!/bin/bash

touch pkgs.old.txt
case "$1" in
    update)
        pacman -Slq | sort -u > pkgs.new.txt
        ;;
    view)
        if [ ! -f pkgs.new.txt ] || (diff pkgs.{old,new}.txt > /dev/null); then
            echo "Nothing changes"
            exit
        fi
        cat pkgs.{old,new}.txt | sort | uniq -c | grep -Po '1 \S+' | cut -f2 -d' '
        ;;
    save)
        # Choose one approach depending on how you want to treat
        # packages removed from official repos.
        # mv will not save these packages so if they get re-added
        # to the official repos you will see it reported again
        mv pkgs.new.txt pkgs.old.txt
        # If you don't want that, do an actual merge instead
        # cat pkgs.{old,new}.txt | sort -u > pkg.merged.txt
        # mv pkg.merged.txt pkgs.old.txt
        ;;
    *)
        echo "Usage: ${0} update|view|save"
        exit 1
        ;;
esac
1 points

That's what I meant by "easy": You point out the way, I might be able to do so, but have prior tasks (plus a job to do)

1 points

After reading the other comment, I changed my mind. RSS is not so reliable, especially when there are more than 50 packages get updated at once. See my edit instead.

1 points
unknown author

Deleted before we saved it.

1 points
unknown author

Deleted before we saved it.

1 points

Install pacman-contrib. It has a bunch of useful stuff including checkupdates which displays a list of packages that can be updated.

Looks like I misunderstood what OP wanted...

0 points

I don't think that is what OP is looking for. I think OP wants a list of packages that have recently been moved from AUR to extra/community.

6 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.