[Unstable Update] 2023-05-21 - Repository changes

That’s the whole idea. One will not receive pacman 6.0.2-11 until their mirror has synced with the changes.

We won’t be making changes on GitLab until the repo changes are in all branches with both x86_64 and ARM.

2 Likes

I think @papajoke may have been referring to the need to specifically update the files database prior to changing pacman.conf:

sudo pacman -Fy

since pamac update will do this automatically, but pacman -Syu will not.

I always run sudo pacman -Fy after sudo pacman -Syu. :wink:

3 Likes

Whereas I’m not sure most manjaro users ever use any variant pacman -F :spider_web:

But I suppose this does bring up some points that have gone unspoken.

Which is more or less that you want to run the things twice.

First you get everything new and changed:

sudo pacman -Syu
sudo pacman -Fy

Then you want to manage your pacnews - specifically pacman.conf.pacnew:
(example using meld and directly)

meld admin:////etc/pacman.conf.pacnew admin:////etc/pacman.conf

Then do it again so everything is lined up:

sudo pacman -Syu
sudo pacman -Fy
6 Likes

Don’t you think that with the repo updates that your post should be part of the first or second post?

Well … theres also some info missing there.
We are in the Unstable section of course :wink:

But just to fill it out …

The proper way to deal with pacnews is by using pacdiff.
It will print pacnew/pacsave/etc/s with just

pacdiff -o

But … it wont be easy to manage using pacdiff if you havent set DIFFPROG and/or SUDO_EDITOR.
Even then … in its current state you wont be able to edit things unless you run it with sudo.
Which of course is extra bad if you rely on a graphical editor to manage diffs.

I patched pacdiff to use syntax like above which should work if you have a diff application supported by KIO/GVFS/Polkit:

https://0x0.st/HNgz.sh

If you save it and run it you will have an edit option:

curl -o mandiff https://0x0.st/HNgz.sh
chmod +x mandiff
bash mandiff

Example run:

$ bash mandiff 
==> pacnew file found for /etc/pacman.conf
:: (V)iew, (E)dit, (M)erge, (S)kip, (R)emove pacnew, (O)verwrite with pacnew, (Q)uit: [v/e/m/s/r/o/q] 


No warranties. Have fun. :blush:

4 Likes

You meant this?

$ du -hs /var/cache/pkgfile/*
310M /var/cache/pkgfile/community.files
18M /var/cache/pkgfile/core.files
88M /var/cache/pkgfile/extra.files
560K /var/cache/pkgfile/multilib.files

pkgfile is its own thing. (and not installed on every system - like here)
why it uses its own cache, I have no idea … but it do.

yes (300Mo ??? :crazy_face:)

After remove repo in pacman.conf, run

[ -f /var/tmp/pamac/dbs/sync/community.db ] && sudo rm -v /var/tmp/pamac/dbs/sync/community.*
[ -f /var/lib/pacman/sync/community.db ] && sudo rm -v /var/lib/pacman/sync/community.*
[ -f /var/cache/pkgfile/community.db ] && sudo rm -v /var/cache/pkgfile/community.*
3 Likes

yeah and it constantly updates via its service…
oh and when you were already annoyed that you typed car instead of cat … it will then parse all of those databases to see if there is in fact a program providing the car executable … so you wait for another 20 seconds to get your prompt back. Pure joy :sweat_smile:

it will be more fun now as extra and community most likely will be like 400 MB in size.

Funny yes, do you remember when we propose/inform arch linux dev to increase community db size since was at the limite size :smile:

In case you don’t know manjaro-tools-base.git still has community repo in it.

It’s all been updated today so many thanks.

This is my solution to it, which can be found here: :wink:

    if [[ -n $DIFFPROG ]]; then
        sudo -E pacdiff
    else
        sudo -E DIFFPROG="meld" pacdiff
    fi
1 Like

Or…
And for Pacman…

❯ sudo pacman -Sc
Packages to keep:
  All locally installed packages

Cache directory: /var/cache/pacman/pkg/
:: Do you want to remove all other packages from cache? [Y/n] n

Database directory: /var/lib/pacman/
:: Do you want to remove unused repositories? [Y/n] 
removing unused sync repositories...

See:

man pacman | less -p '-c, --clean'
SYNC OPTIONS (APPLY TO -S)
      -c, --clean
           Remove packages that are no longer installed from the cache as well
           as currently unused sync databases to free up disk space. When
           pacman downloads packages, it saves them in a cache directory. In
           addition, databases are saved for every sync DB you download from
           and are not deleted even if they are removed from the configuration
           file pacman.conf(5). Use one --clean switch to only remove packages
           that are no longer installed; use two to remove all files from the
           cache. In both cases, you will have a yes or no option to remove
           packages and/or unused downloaded databases.
4 Likes

yes, exists. But only for pacman …

a script “repo-clean.py” for pacman/pamac and pkgfile :

#!/usr/bin/env python
from pathlib import Path
import subprocess

repos = ['refresh_timestamp']   # exclude some files

p = subprocess.run("pacman-conf -l", capture_output=True, text=True, shell=True)
repos.extend(p.stdout.split())

print(repos[1:])
if "community" in repos:
    exit(9)

dirs = (
    "/var/tmp/pamac/dbs/sync/",
    "/var/lib/pacman/sync/",
    "/var/cache/pkgfile/"
)

removes = []
for item in dirs:
    try:
        for child in Path(item).iterdir():
            name = child.stem.split(".", 1)[0]
            if name not in repos:
                #child.unlink()
                removes.append(f'"{child}"')
    except FileNotFoundError:
        print("    # ", item, f"not exists, {item.split('/')[3]} not installed")

if removes:
    print("sudo rm -I", " ".join(removes))

one result:

[Running] /usr/bin/env python "/home/patrick/repo-clean.py"
['core', 'extra', 'andontie-aur']
    #  /var/cache/pkgfile/ not exists, pkgfile not installed
sudo rm -I "/var/tmp/pamac/dbs/sync/truc.db.sig" "/var/lib/pacman/sync/truc.db" "/var/lib/pacman/sync/truc.db.sig" "/var/lib/pacman/sync/TEST.db"
2 Likes

Can I ask, which files within the past 12 months have had a .pacnew generation just out of curiosity? I can’t recall. (I have made applicable changes)

Hard to say as it also depends on your system config … things like pacnew or pacsave is generally created because the file is different from upstream, ie - if you made changes to grub then you get one from that update, but if you havent then you dont.

But for me … going back to May of last year …

[ALPM] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
[ALPM] warning: /etc/systemd/system.conf installed as /etc/systemd/system.conf.pacnew
[ALPM] warning: /etc/mkinitcpio.conf installed as /etc/mkinitcpio.conf.pacnew
[ALPM] warning: /etc/sudoers installed as /etc/sudoers.pacnew
[ALPM] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
[ALPM] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
[ALPM] warning: /etc/locale.gen installed as /etc/locale.gen.pacnew
[ALPM] warning: /etc/pam.d/system-login installed as /etc/pam.d/system-login.pacnew
[ALPM] warning: /etc/pam.d/passwd installed as /etc/pam.d/passwd.pacnew
[ALPM] warning: /etc/systemd/system.conf installed as /etc/systemd/system.conf.pacnew
[ALPM] warning: /etc/makepkg.conf installed as /etc/makepkg.conf.pacnew
[ALPM] warning: /etc/mkinitcpio.conf installed as /etc/mkinitcpio.conf.pacnew
[ALPM] warning: /etc/php/php.ini installed as /etc/php/php.ini.pacnew
[ALPM] warning: /etc/pacman.conf installed as /etc/pacman.conf.pacnew
[ALPM] warning: /etc/pamac.conf installed as /etc/pamac.conf.pacnew
[ALPM] warning: /etc/php/php.ini installed as /etc/php/php.ini.pacnew
[ALPM] warning: /etc/systemd/system.conf installed as /etc/systemd/system.conf.pacnew
[ALPM] warning: /etc/default/grub installed as /etc/default/grub.pacnew
[ALPM] warning: /etc/httpd/conf/httpd.conf installed as /etc/httpd/conf/httpd.conf.pacnew
[ALPM] warning: /etc/pacman.conf installed as /etc/pacman.conf.pacnew
2 Likes

To find historical information, view the pacman log:

grep 'pacnew' /var/log/pacman.log

After an update, view and conditionally take action on .pacnew files. Follow the prompts.

DIFFPROG=meld pacdiff
1 Like

My rule of thumb is I get one and wait several reboots to see if anything is actually affected. If not the file just gets deleted. I’ve found that the need to actually merge content from the old file to the new one is rare.

1 Like