[arch-general] /var lost, how "reinstall" Archlinux?

Carl Schaefer schaefer at trilug.org
Mon Apr 14 23:03:52 EDT 2014


> > I've lost content of /var, other partitions are ok, so system somewhat
> > boots up (to recovery mode).
> > What is the less pain method to get it again up and running?
> 
> If you have enough time, I would try using pkgfile to recover the
> installed packages. I thing something like this should suffice:
> # update the pkgfile database
> pkgfile -u
> # find the package names for all binaries
> find /usr/bin -type f -exec pkgfile '{}' ';' | uniq
> 
> I assume that the libs would be installed as depends for the programs
> that has a binary in /usr/bin

this seemed like a clever idea, so I gave it a try:

0. Adding -L to the 'find' helped slightly

1. For some binaries pkgfile returns a list, e.g.

$ pkgfile /usr/bin/emacs
extra/emacs
community/emacs-nox

on my system this is the case for 69 out of 2891 files under /usr/bin,
with jack/jack2 and gcc/gcc-multilib responsible for 47 of that 69.  So,
just a bit of manual intervention is needed to select the appropriate
package in these cases.

2. Some files in /usr/bin had no package that pkgfile could find.  Most
were from AUR, but there was also this:

$ pkgfile /usr/bin/init.lxc 
$ pacman -Qo /usr/bin/init.lxc
/usr/bin/init.lxc is owned by lxc 1:1.0.3-1

It seems the 'lxc' package installs 'init.lxc' into /usr/sbin, which
symlinks to /usr/bin.  Not knowing anything about how these tools work,
I'm more surprised that 'pacman -Qo' figured this out, than I am that
'pkgfile' didn't.

3. Ultimately the packages that pkgfile computed from /usr/bin, along
with their dependencies, represented about 94% of the packages on my
system.  The missing packages (listed below) were mostly:

dependencies for things I've installed outside of pacman (e.g. AUR)
gstreamer bits
desktop/X-related (e.g. some fonts, themes)
misc. perl modules

Overall conclusion - potentially useful, and I hope I never have to
deploy it in real life...
Carl

aspell-en
docbook-xml
docbook-xsl
gstreamer0.10-base-plugins
gstreamer0.10-ffmpeg
gstreamer0.10-good
gtk-engine-murrine
gtk-engines
gvfs-smb
hunspell-en
lib32-gcc-libs
lib32-glib
lib32-glibc
lib32-libstdc++5
lib32-zlib
libmspack
libreoffice-extension-nlpsolver
libreoffice-gnome
libtracker-sparql
libva-intel-driver
libvisual
licenses
linux
linux-firmware
linux-headers
man-pages
mate-icon-theme
mate-themes
perl-io-socket-ssl
perl-lwp-protocol-https
perl-mozilla-ca
perl-net-ssleay
perl-text-csv
perl-timedate
ttf-arphic-uming
ttf-baekmuk
ttf-hannom
ttf-sazanami
ttf-tibetan-machine
ttf-tlwg
x11-ssh-askpass
xaw3d
xorg-fonts-type1



More information about the arch-general mailing list