You are not logged in.

#26 2011-07-21 08:35:19

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Keeping arch system clean

DasFox wrote:

So how would we use it to do that as well?

Errr, that's a simple tar command, you need to specify the path where the resulting compressed and archive db will be stored. I have no idea where do you want to put it, I would do

tar cfz /home/karol/backup/pacman-database.tgz /var/lib/pacman/local

Offline

#27 2011-07-21 08:57:33

Meyithi
Member
From: Wirral, UK
Registered: 2009-06-21
Posts: 550
Website

Re: Keeping arch system clean

Since this thread has been resurrected from 16 months back, that script I posted contains

sudo pacman-optimize && sync

Since then, the DB format has changed and I'm not sure if the pacman-optimize script is still useful, it may even be harmful for all I know.  I'm still using it due to being too lazy to update my scripts but I've not looked into if it causes any harm or makes any concern-able difference with the new DB format.


The mind roams more freely in empty rooms.
dwm - colours - ncmpcpp - system
irc://irc.freenode.net:meyithi

Offline

#28 2011-07-21 09:00:47

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Keeping arch system clean

Meyithi wrote:

Since this thread has been resurrected from 16 months back, that script I posted contains

sudo pacman-optimize && sync

Since then, the DB format has changed and I'm not sure if the pacman-optimize script is still useful, it may even be harmful for all I know.  I'm still using it due to being too lazy to update my scripts but I've not looked into if it causes any harm or makes any concern-able difference with the new DB format.

I've been doing some tests myself and I don't think it does much but wastes some time for the "optimization". No harm so far though.

Offline

#29 2020-12-25 10:32:33

ratijas
Member
Registered: 2020-11-21
Posts: 3
Website

Re: Keeping arch system clean

Hi,

Sorry to bump an old thread. I found it because of Arch Linux plugin in oh-my-zsh repository. It has a function paclist() which references this thread's URL.

Here it is:

function paclist() {
  # Source: https://bbs.archlinux.org/viewtopic.php?id=93683
  LC_ALL=C pacman -Qei $(pacman -Qu | cut -d " " -f 1) | \
    awk 'BEGIN {FS=":"} /^Name/{printf("\033[1;36m%s\033[1;37m", $2)} /^Description/{print $2}'
}
# README.md
List all installed packages with a short description

At first, I struggled to understand that function, because it's description is incorrect, and shell invocation chain is little bit weird. Nevertheless, in the end I figured out it's not actually about "all installed packages", but rather "packages which are available for upgrade".

Nowadays, the same can be achieved much simpler and more reliable with just pacman -Qqeui. Why reliable? Because in absence of upgradable packages shell substitution would produce no arguments, hence pacman -Qei would be treated as it is, and will print ALL explicitly installed packages.

Besides, the whole awk stuff probably can be replaces with proper expac(1) invocation:

pacman -Qqeu | xargs -I '{}' expac '\e[1;36m%n\e[1;37m %d\e[m' '{}'

Note that xargs -I syntax is resistant to empty input, and won't run expac at all.

However, pure expac cannot show versions like pacman -Que, since it only operates on either local db, or sync db at a time.


"Everything not saved will be lost" -- Nintendo quit screen message.

"Anything not merged upstream will be left behind" -- my attitude.

Offline

#30 2020-12-25 13:07:06

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,657

Re: Keeping arch system clean

That just reads quite horrifying from the outset as the only way that command is even gonna give you any output is when you bring yourself into partial update territory by running -Sy without an -u but that's probably par for course with OMZ...

Just use checkupdates if you want to care about that list in a safe manner.

In any case one should read https://wiki.archlinux.org/index.php/System_maintenance if one cares about what's the current strategy regarding maintaining a system.

Closing this old thread.

Offline

Board footer

Powered by FluxBB