Improve PKGget sync with APT
PKGget is now a GUI frontend for APT; however, it is a long-term project, only partly complete.
Today I discovered that APT wants the full 'less' utility; not happy with the busybox one.
If you want to install it, APT won't, as I created an "equivs" 'less' .deb, which is an empty package that prevents APT from installing the real 'less' .deb The reason for doing this was that busybox provides the 'less' utility.
The full 'less' will be in the next release, but if you want to install it now, you have to download it from here:
https://packages.debian.org/trixie/less
...then just click on the .deb to install it.
Another problem is that APT does not understand the aufs or overlayfs layers. When EasyOS was updated from 7.0.2 to 7.0.3, there were less packages in easy.sfs The problem is that the dpkg database of installed packages in easy.sfs now differs from the top layer of aufs, that is, what is in the /mnt/wkg/.session folder.
The database has become broken. Not seriously, there are just warnings. But, it does need to be fixed. This code lists the packages that are no longer in easy.sfs:
# LANG=C /usr/bin/dpkg --audit | sed -n '/following packages are missing the list control file/,/^$/p' | grep '^ [a-zA-Z0-9]' | cut -f 1 -d ':' | cut -f 2 -d ' ' | sort -u
gir1.2-ayatanaappindicator3-0.1
libayatana-appindicator3-1
libayatana-ido3-0.4-0
libayatana-indicator3-7
libdbusmenu-glib4
libdbusmenu-gtk3-4
python3-xdg
redshift-gtk
So, I have put some code into /usr/local/petget/update-dbs.sh, which is the script that runs before the PKGget GUI is launched. Inserted this:
#20250820 new version of easyos, maybe broken db... sed extracts one paragraph
BR1="$(LANG=C /usr/bin/dpkg --audit | sed -n '/following packages are missing the list control file/,/^$/p' | grep '^ [a-zA-Z0-9]' | cut -f 1 -d ':' | cut -f 2 -d ' ' | sort -u)"
#...list of pkgs in db but missing
for aBR in ${BR1}
do
[ -z "$aBR" ] && continue
/usr/bin/apt purge -y ${aBR} >/dev/null 2>&1
sleep 0.01
done
That has re-sync'ed the dpkg database, but is only detecting one situation. This code may need to be expanded in the future.
Note, you can find out for yourself any problems in the dpkg database by doing this:
# dpkg --audit
Tags: easy