I've been using Arch for a while, and like it. However, every time I install a custom package by hand I'm setting myself up for a headache later when the libraries it depends on disappear.

Is there a way to tell pacman that it should upgrade like normal except never rm /usr/lib/libwhatever.so.$prev ? I'm perfectly fine with the fact that my lib directory will fill up with leftover crap. (I have more storage space than free time, and 30 years from now when I'm retired I'll worry about cleaning up my 1TB of lib files.)

I don't want to have to take extra steps when I run pacman, I just want it to leave all .so files behind.

  • not a pacman expert, but i get the impression it doesn't have the functionality you're asking for natively. however, if space is no issue, you could (1) configure it not to delete old packages from its download cache, and (2) write a hook script to extract the old lib versions from the previous package versions (to your new libwhatever.so.$prev name) after an upgrade. a hook to move the about-to-be-overwritten libs before the new version is installed is also possible but that might be less safe in the event of upgrade failures. – quixotic Nov 15 '17 at 0:07
  • I had a Rube Goldberg idea already of wrapping pacman with another script which would mount overlayfs on the lib directories, let pacman do whatever, and then rsync from the overlay back to the actual directory as the command completes. This way I would get all the new files and silently undo the deletions. But... I'm hoping there's some Arch veteran out there who knows of some developer environment variable or something to tell it to leave behind existing lib files. – M Conrad Nov 15 '17 at 1:06
  • the official packages sometimes do this for particular versions (compare packages for python vs python2, or ffmpeg vs ffmpeg2.8), and you can find some examples on the AUR (gcc43, gcc44, gcc5, etc). your best bet might be to construct your own local packages providing those specific library versions. – quixotic Nov 15 '17 at 12:14

Arch Linux is a rolling release distribution and as such holding a package is meaningless. You may be able to mark a major version of a library as explicitly installed using:

pacman --asexplicit -S libsomething0

But generally you won't be able to avoid needing to recompile your software on a rolling release distribution. If the library disappears you're out of phase with Arch Linux itself. Thats just how rolling release works. But depending on what it is at least generally library versions should stick around for a while.

To make this whole process easier you should probably use makepkg.

  • Are you saying there's a way to keep a version of a library installed while also installing newer versions of that library? I've lost my actual example that started all this, but I'll make a new one that is about equivalent. I installed a tree of perl libraries using perlbrew and one module compiles a .so that depends on /usr/lib/libdb-5.3.so. That comes from Arch package db 5.3.28-3. If Arch ships a new db 4.0.0 next week, pacman will delete libdb-5.3.so and my perl module will be broken until I re-install it. – M Conrad Nov 15 '17 at 1:23
  • If you're saying there's a way to tell packan to keep db 3.5.28-3 while also installing db 4.0.0 then that mostly solves my problem, though I would also need to automate the process of detecting which packages a tree of files depends on. – M Conrad Nov 15 '17 at 1:26
  • I meant to say db 5.3.28-3 and db 5.4.0 in the examples. Pardon my dyslexia (and grr at comment editing time windows). – M Conrad Nov 15 '17 at 1:33
  • No. In hindsight I wish I answered this completely differently now that I see what your issue is. – jdwolf Nov 15 '17 at 1:35
  • @jdwolf if you don’t want to change your answer radically because it’s been upvoted, you could add another (and perhaps delete this one if you’re really unhappy with it). – Stephen Kitt Nov 15 '17 at 6:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.