Score:1

Can I make my own .deb's that modify files created by other .debs?

us flag

For example, I'd like all the Ubuntu Desktops that I deploy to have some customization's to the settings found in /usr/share/glib-2.0/schemas/, but if i edit those files, and then do apt update && apt upgrade, apt overwrites the changes i made.

I'm thinking I should make a repository that installs after the gsettings-desktop-schemas package. Such that my computers can pull down updates to Ubuntu's schemas, and then pull in my edited files after.

Is that possible? And is it considered "permissible"? I don't want to violate "best practices" in my search for solutions.

Any thoughts would be appreciated.

ru flag
No, you cannot create a .deb that touches other .debs files - that results in "conflicting files" and can break other packages. One package's files are NOT PERMITTED (by policy) to alter the files of other packages. It *is* allowed to use the same directories and dir paths, but it is NOT permitted to alter the other packages' files.
Lucas Krupinski avatar
us flag
SO, if i want to modify the files installed by another package, I must fork that package and then modify the files in my own package? And then every time the source files are updated, I'd need to fork the next version they release, and make my edits to those files? Just to change default configuration files, in this example?
ru flag
Typically, these 'other' packages are configured to *not* replace default files if they're already present - so that there's no overwrite of user-modified settings (i.e. `/etc/nginx/nginx.conf` for example can be edited by admins but will not be overwritten on package upgrades). However, if you are going to constantly alter the 'defaults' for new installs then yes, you need to fork the package and software each time and alter that package with your revisions.
us flag
If you use git, and want to make a single change, you can `git pull` afterwards to merge the change in the upstream repository (from which you had forked).
us flag
This may be a [XY Problem](https://xyproblem.info/). Please edit the question and specifically tell us what you want to accomplish, with details.
user535733 avatar
cn flag
This is what patches do. Your changes to one schema file is one patch. You re-apply your patch(es) to newly-updated packages. Re-applying patches is usually trivial and can be easily scripted. See `man patch` and `man diff` to begin.
Lucas Krupinski avatar
us flag
I dont think this is an XY Problem, but maybe it is. Some things I want to do include: Replace the default desktop backgrounds with my own generated backgrounds (for any user of the system, not just my own user). Therefore, my desire is to purge the default backgrounds, and replace them with a few others. I also want to make some permanent changes to other visual settings. Different default fonts, etc. Again, not for just 1 user of the system, but no matter which user signs in. It seems like the files i need to edit are once that install from Ubuntu's repositories.
Score:1
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.