List of upgradable packages using pacman on command line

Hi,
What is the pacman command line option to get the list of packages for which updates are available?

Pamac automatically notifies me of any updates. However, sometimes I would like to manually check for updates on pacman on the terminal.

  • Manjoy

If you would just type

sudo pacman -Syyu 

on the terminal, which is the command to update, it will show you the list of updates, and ask if you'd like to install them.

1 Like

Or try pacui

Thanks. After browsing man pages for pacman, I think the following command might work too:

pacman -Qu -p

-Qu: query the database and find out-of-date packages
-p: for only printing without performing action.

But, I have never tried these options.

Thanks. I will check it.

pacman -Qu -p did not work.

pacman -Qu
should be enough to list the updates. Right now my system is up-to-date. I am yet to verify the command when the updates are available.

1 Like

I use since the new pacman-mirrors version

$ sudo pacman-mirrors -dn && sudo pacman -Syyu
[sudo] Passwort für laza: 
.: INFO Lade Mirrorliste herunter von  repo.manjaro.org
:: Synchronisiere Paketdatenbanken...
 core                                                                                                                                                                 137,3 KiB  1320K/s 00:00 [########################################################################################################################] 100%
 extra                                                                                                                                                               1763,8 KiB  5,43M/s 00:00 [########################################################################################################################] 100%
 community                                                                                                                                                              4,4 MiB  5,61M/s 00:01 [########################################################################################################################] 100%
 multilib                                                                                                                                                             178,9 KiB  5,82M/s 00:00 [########################################################################################################################] 100%
:: Starte vollständige Systemaktualisierung...
Warnung: amule: Ignoriere Paket-Aktualisierung (10965-2 => 10990-3)
 Es gibt nichts zu tun

Type

man pacman-mirrors

and

man pacman

for detailed information about the parameters i use.

I am using pacman-mirrors Version 4.3.0. I did not find explanation for -dn option. What version do you use?

$ sudo pacman -Qi pacman-mirrors
[sudo] Passwort für laza: 
Name                     : pacman-mirrors
Version                  : 4.3rc10-1
Beschreibung             : Manjaro Linux mirror list for use by pacman
Architektur              : any
URL                      : https://github.com/manjaro/pacman-mirrors.git
Lizenzen                 : GPL
Gruppen                  : Nichts
Stellt bereit            : pacman-mirrorlist=20171028
Hängt ab von             : python  python-npyscreen
Optionale Abhängigkeiten : gtk3: for interactive mode (GUI) [Installiert]
                           python-gobject: for interactive mode (GUI) [Installiert]
Benötigt von             : pacli  pacman  pamac
Optional für             : Nichts
In Konflikt mit          : pacman-mirrorlist  pacman-mirrorlist-dev
Ersetzt                  : pacman-mirrorlist  pacman-mirrorlist-dev
Installationsgröße       : 741,00 KiB
Packer                   : Philip Mueller <philm@manjaro.org>
Erstellt am              : Sa 28 Okt 2017 10:25:30 CEST
Installiert am           : Sa 28 Okt 2017 12:16:37 CEST
Installationsgrund       : Installiert als Abhängigkeit für ein anderes Paket
Installations-Skript     : Nein
Verifiziert durch        : Signatur

-n, --no-mirrorlist
Use to skip generation of mirrorlist

-d seems gone, was afaik --default

For some more informations and discussion look at

Thanks for the info!

1 Like

Doesn't pacman -Qu only list updates that you have in your synced repos? Or does it actually go and fetch those lists?

I think -Qu option queries the local repo alongwith the remote repo. It gets the names of upgradable packages but does not download the packages. I am not sure.

Right now, my system is up-to-date. I will experiment more once I get any notification of updates by Pamac.

I request more experienced users add to the discussion to explain this clearly.

"
pacman queries the local package database with the -Q flag, the sync database with the -S flag and the files database with the -F flag. See pacman -Q --help, pacman -S --help and pacman -F --help for the respective suboptions of each flag.
"

https://wiki.archlinux.org/index.php/Pacman

I hope you guys find now the way...

Absolutely. Since -Qu queries only the local database, it is a must to sync the database with -Syy option before querying for the updates. After some experimentation, here is the summary of my understanding:

  1. sudo pacman-mirrors -f 5 This finds the top 5 responsive mirrors for finding and installing updates.
  2. sudo pacman -Syyu -p This command syncs the databse and only prints all the upgradable packages. This does not install the updates.
  3. sudo pacman -Syyu This syncs the database and shows all the upgradable packages and asks for your confirmation to go ahead for installtion. You can press "n" if you don't want to upgrade.
  4. sudo pacman -Qu This queries the local database and lists the upgradable packages alongwith full path to repo.

From the above discussion, if you just want to only list upgradable packages, use:
sudo pacman-mirrors -f 5 && sudo pacman -Syyu -p

Or,
sudo pacman-mirrors -f 5 && sudo pacman -Syy && sudo pacman -Qu

If you want to check for updates and would like to install updates, use:
sudo pacman-mirrors -f 5 && sudo pacman -Syyu

Thanks everyone for your responses. If anybody else knows any other alternatives, please share.

2 Likes

The problem I have with the way things currently work is that you don't want to do a partial upgrade (ie. sync the repos and then not update, and install some other packages). It would be nice if it would fetch the updates, or use an alternate sync db for -Q.

# pacman -Syu >> 20171106_paclist.txt will create a list of everything that is ready to be updated, you can always select n to not update if you only want to see what latest releases (not testing) are. Testing if you have pacman.conf to also pull in the testing repos.
Example: # pacman -Syu >> 20171106_list.txt
:: Proceed with installation? [Y/n] n
Then go look at the list it created.

Good idea. Similarly one can "see" the upgradable packages on the screen as well as redirect the list to a file as:
pacman -Syu -p | tee 20171107_paclist.txt

Advantage here is you don't have to answer Y/N question.

1 Like

Since every system is in a different state, I think it would be mandatory to sync the local database to compare with the list of installed packages.

Yes, if there is an command line option to check for new updates released it would be great. This would help us to run a simple query command to check for updates whenever we feel like, not waiting for Pamac to notify us.

I hope I explained my view clearly.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.

Forum kindly sponsored by