Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
4
rated 0 times [  4] [ 0]  / answers: 1 / hits: 510  / 3 Years ago, wed, october 6, 2021, 5:40:03

My server runs a Java application that requires I replace a few java library files with ones I downloaded on my own. This has to do with JCE security extensions and isn't really relevant to my question.



I've found that these library files tend to get overwritten by apt when it later updates my java package.



Is there an apt-friendly way of masking these specific files so apt won't touch them?



Potential Solutions




  1. I'm considering just removing the write flag from the files, though I'm expecting this will cause apt to spew its guts everywhere when it later tries to overwrite them?


  2. Perhaps there's a java custom library directory I don't know of, where I can park my files and they'll be loaded instead of the package's defaults?


  3. The last-resort option I'm considering is writing a cron job to periodically replace the files with my versions. I hate this option.



More From » apt

 Answers
5

There is an elegant way, with dpkg-divert command (Override a package's version of a file, see this answer).


dpkg-divert --divert /full_path/file_to_preserve.packaged --rename /full_path/file_to_preserve

Please consider that putting together different versions of files of a given package it might be risky...


[#23543] Thursday, October 7, 2021, 3 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ameatoes

Total Points: 321
Total Questions: 106
Total Answers: 112

Location: Belarus
Member since Sat, Jul 18, 2020
4 Years ago
ameatoes questions
Tue, Aug 16, 22, 22:50, 2 Years ago
Fri, May 14, 21, 03:36, 3 Years ago
Sat, Oct 8, 22, 01:00, 2 Years ago
Fri, Feb 17, 23, 14:44, 1 Year ago
;