3

I somehow managed to remove the /var/run/saslauthd directory while installing authentication for Postfix, so I was trying to apt-get purge and then reinstall the various saslauthd packages in order to regenerate all the files. However, when I tried to run apt-get purge libsasl2-2 sasl2-bin libsasl2-modules, APT was trying to remove a bunch of unrelated packages like Apache and Git.

root@localhost:~# apt-get purge libsasl2-2 sasl2-bin libsasl2-modules
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-data apache2-utils bsdtar db-util db5.3-util debugedit fonts-droid-fallback fonts-noto-mono gamin ghostscript git-man imagemagick-common libapr1 libapr1-dev libaprutil1 libaprutil1-dbd-sqlite3 libarchive-tools libarchive13
  libconfig-file-perl libcupsfilters1 libcupsimage2 libecap3 liberror-perl libfftw3-double3 libgamin0 libgs9 libgs9-common libijs-0.35 libjbig2dec0 liblqr-1-0 liblua5.1-0 liblzo2-2 libm17n-0 libmagickcore-6.q16-2 libmagickwand-6.q16-2
  libminiupnpc10 libnatpmp1 libotf0 libpaper-utils libpaper1 libregexp-assemble-perl librpm3 librpmbuild3 librpmio3 librpmsign3 librtmp1 libsctp-dev libsctp1 libsqlite0 lksctp-tools m17n-db poppler-data python-libxml2 python-lzma
  python-rpm python-sqlite python-sqlitecachec python3-xkit rpm rpm-common rpm2cpio ruby-childprocess ruby-domain-name ruby-erubis ruby-ffi ruby-http-cookie ruby-i18n ruby-listen ruby-log4r ruby-mime-types ruby-net-scp ruby-net-sftp
  ruby-net-ssh ruby-netrc ruby-nokogiri ruby-pkg-config ruby-rb-inotify ruby-rest-client ruby-sqlite3 ruby-unf ruby-unf-ext spawn-fcgi sqlite3 squid-common squid-langpack transmission-common ubuntu-drivers-common uuid-dev
Use 'apt autoremove' to remove them.
The following packages will be REMOVED:
  apache2* apache2-bin* apache2-dev* apt-file* apt-transport-https* curl* dirmngr* emacs24* gconf-service* gconf-service-backend* gconf2* git* libaprutil1-dev* libaprutil1-ldap* libcurl3* libcurl3-gnutls* libcurl4-gnutls-dev*
  libldap-2.4-2* libldap2-dev* libsasl2-2* libsasl2-dev* libsasl2-modules* lighttpd* php-elisp* php7.0-curl* postfix* python-apt* python-pycurl* python-software-properties* python-urlgrabber* python3-pycurl*
  python3-software-properties* sasl2-bin* software-properties-common* software-properties-gtk* squid* squid3* transmission-cli* vagrant* yum*
0 upgraded, 0 newly installed, 40 to remove and 0 not upgraded.
After this operation, 85.4 MB disk space will be freed.
Do you want to continue? [Y/n]

I'm running Ubuntu 16.10.

How can I fix this?

  • You could try `apt-get install --reinstall libsasl2-2 sasl2-bin libsasl2-modules`, which should just reinstall the packages. – Thomas Jan 08 '17 at 18:30
  • @Thomas That doesn't regenerate the configs and everything, though. – Nick Clifford Jan 08 '17 at 18:35
  • Isn't that reconfigure stuff a job for `dpkg-reconfigure`? – Thomas Jan 08 '17 at 18:36
  • If so, it doesn't do anything when running `dpkg-reconfigure libsasl2-2`. – Nick Clifford Jan 08 '17 at 18:42
  • As far as I have seen, only the `sasl2-bin` package is related to `/var/run/saslauthd`. But you could check with `grep saslauthd /var/lib/dpkg/info/* | grep 'var/run'`. I also had to enter `dpkg-statoverride --remove /var/run/saslauthd`, then `dpkg-reconfigure sasl2-bin`, which brought back the directory. I think you also have to restart the related services. – Thomas Jan 08 '17 at 19:07
  • I checked, and it seems like you are correct. However, reconfiguring like you suggested and even purging and reinstalling didn't fix it. – Nick Clifford Jan 08 '17 at 19:32
  • path `/var/run/saslauthd` is not belonged to any package. It is a dynamically created directory when starting `saslauthd`. So simply restart it. – Ipor Sircer Jan 08 '17 at 21:22
  • @IporSircer Are you sure about that? Simply using the `/etc/init.d` script or `service saslauthd restart` does not recreate it. – Nick Clifford Jan 09 '17 at 14:31

1 Answers1

0

Alright, so I'm not sure how this fixed it, but uninstalling and reinstalling Postfix managed to work.