apt update always overrides old config file The 2019 Stack Overflow Developer Survey Results Are In Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Community Moderator Election ResultsTrouble migrating from Yum to apt-getInstalling courier-mta causes sendmail to be installed instead“except (IOError, OSError), e: SyntaxError: invalid syntax” when configuring python-lockfilemessed up system after offline package installation for WLAN driverIs it possible to have a Debian package pre-install script run apt-get commands?How to install latest version of Tiled Editor on Linux Mint?How do I install a specific version of reiserfsprogs?Getting a local copy of Debian's extended package descriptionsReading package lists…Error!APT version conflicts across different architectures even with Multi-Arch: same?
Identify 80s or 90s comics with ripped creatures (not dwarves)
Define a list range inside a list
"... to apply for a visa" or "... and applied for a visa"?
Can the Right Ascension and Argument of Perigee of a spacecraft's orbit keep varying by themselves with time?
Is an up-to-date browser secure on an out-of-date OS?
Variable with quotation marks "$()"
What was the last x86 CPU that did not have the x87 floating-point unit built in?
Would an alien lifeform be able to achieve space travel if lacking in vision?
How do you keep chess fun when your opponent constantly beats you?
Using dividends to reduce short term capital gains?
Example of compact Riemannian manifold with only one geodesic.
Does Parliament hold absolute power in the UK?
Did the new image of black hole confirm the general theory of relativity?
How to support a colleague who finds meetings extremely tiring?
Can the DM override racial traits?
What force causes entropy to increase?
Accepted by European university, rejected by all American ones I applied to? Possible reasons?
My body leaves; my core can stay
What does Linus Torvalds mean when he says that Git "never ever" tracks a file?
Why not take a picture of a closer black hole?
Do I have Disadvantage attacking with an off-hand weapon?
Is it ethical to upload a automatically generated paper to a non peer-reviewed site as part of a larger research?
How to politely respond to generic emails requesting a PhD/job in my lab? Without wasting too much time
Why can't wing-mounted spoilers be used to steepen approaches?
apt update always overrides old config file
The 2019 Stack Overflow Developer Survey Results Are In
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Community Moderator Election ResultsTrouble migrating from Yum to apt-getInstalling courier-mta causes sendmail to be installed instead“except (IOError, OSError), e: SyntaxError: invalid syntax” when configuring python-lockfilemessed up system after offline package installation for WLAN driverIs it possible to have a Debian package pre-install script run apt-get commands?How to install latest version of Tiled Editor on Linux Mint?How do I install a specific version of reiserfsprogs?Getting a local copy of Debian's extended package descriptionsReading package lists…Error!APT version conflicts across different architectures even with Multi-Arch: same?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I am building and distributing my code as a deb package (built with cmake, packaged with CpackDeb) to a Ubuntucore-based 16.04 LTS. The package installs a config file among else. I can't get apt/apt-get to keep the old configuration file during an update. It silently overrides the old config in all test cases and regardless of whether it had been edited or not. Things I tried:
$ apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install <package>
$ export DEBIAN_FRONTEND=noninteractive ; apt-get install -y -o Dpkg::Options::="--force-confold" <package>
And some variations. The result is always the same - a silent override of the old config file. apt version is 1.2.31, I am on an arm64 processor.
Maybe I am not packaging the deb correctly? My config file is simply an installable. I'm not aware of any special requirements for config files, are there any?
apt deb
add a comment |
I am building and distributing my code as a deb package (built with cmake, packaged with CpackDeb) to a Ubuntucore-based 16.04 LTS. The package installs a config file among else. I can't get apt/apt-get to keep the old configuration file during an update. It silently overrides the old config in all test cases and regardless of whether it had been edited or not. Things I tried:
$ apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install <package>
$ export DEBIAN_FRONTEND=noninteractive ; apt-get install -y -o Dpkg::Options::="--force-confold" <package>
And some variations. The result is always the same - a silent override of the old config file. apt version is 1.2.31, I am on an arm64 processor.
Maybe I am not packaging the deb correctly? My config file is simply an installable. I'm not aware of any special requirements for config files, are there any?
apt deb
Where is your config file installed? Are you usingdebhelperto build your package?
– Stephen Kitt
yesterday
I am using Cmake's CPackDeb. Installed to /etc/<foo>/
– user907323
yesterday
add a comment |
I am building and distributing my code as a deb package (built with cmake, packaged with CpackDeb) to a Ubuntucore-based 16.04 LTS. The package installs a config file among else. I can't get apt/apt-get to keep the old configuration file during an update. It silently overrides the old config in all test cases and regardless of whether it had been edited or not. Things I tried:
$ apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install <package>
$ export DEBIAN_FRONTEND=noninteractive ; apt-get install -y -o Dpkg::Options::="--force-confold" <package>
And some variations. The result is always the same - a silent override of the old config file. apt version is 1.2.31, I am on an arm64 processor.
Maybe I am not packaging the deb correctly? My config file is simply an installable. I'm not aware of any special requirements for config files, are there any?
apt deb
I am building and distributing my code as a deb package (built with cmake, packaged with CpackDeb) to a Ubuntucore-based 16.04 LTS. The package installs a config file among else. I can't get apt/apt-get to keep the old configuration file during an update. It silently overrides the old config in all test cases and regardless of whether it had been edited or not. Things I tried:
$ apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install <package>
$ export DEBIAN_FRONTEND=noninteractive ; apt-get install -y -o Dpkg::Options::="--force-confold" <package>
And some variations. The result is always the same - a silent override of the old config file. apt version is 1.2.31, I am on an arm64 processor.
Maybe I am not packaging the deb correctly? My config file is simply an installable. I'm not aware of any special requirements for config files, are there any?
apt deb
apt deb
edited yesterday
user907323
asked yesterday
user907323user907323
487
487
Where is your config file installed? Are you usingdebhelperto build your package?
– Stephen Kitt
yesterday
I am using Cmake's CPackDeb. Installed to /etc/<foo>/
– user907323
yesterday
add a comment |
Where is your config file installed? Are you usingdebhelperto build your package?
– Stephen Kitt
yesterday
I am using Cmake's CPackDeb. Installed to /etc/<foo>/
– user907323
yesterday
Where is your config file installed? Are you using
debhelper to build your package?– Stephen Kitt
yesterday
Where is your config file installed? Are you using
debhelper to build your package?– Stephen Kitt
yesterday
I am using Cmake's CPackDeb. Installed to /etc/<foo>/
– user907323
yesterday
I am using Cmake's CPackDeb. Installed to /etc/<foo>/
– user907323
yesterday
add a comment |
1 Answer
1
active
oldest
votes
You need to include a conffiles file in your control control.tar.gz. When creating a package with dpkg-deb this is placed in DEBIAN/conffiles. This file should have exactly one line for every config file contained in your debian package. Each line specifies the full path of a config file.
See https://manpages.debian.org/testing/dpkg-dev/deb-conffiles.5.en.html
The result of including this will be that these files are registered on the system as config files and will not be automatically overwritten.
I've not used CPackDeb myself, but there's a reference for how to add files to control.tar.gz here:
https://cmake.org/cmake/help/v3.0/module/CPackDeb.html?highlight=conffiles
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR/prerm;$CMAKE_CURRENT_SOURCE_DIR/postrm")
... assuming you're usingdh_installdebwhich I've never bothered to. But okay I'll edit
– Philip Couling
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulateDEBIANdirectly. If you write aconffilesin your control directory, it won’t be taken into account indebhelpercompatibility level 12 or later. Of course if you don’t usedebhelperthen you need to deal with things yourself but that’s not what I’d expect new packagers to do...
– Stephen Kitt
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
I can see the ambiguity withdebhelper's nomenclature. I've edited to quantify the use of theDEBIANdirectory fordpkg-debalthough I note aconffilesfile for installation intoDEBIANis also correct fordebhelperwhere it does not automatically find config files. The underlying file format doesn't use the nameDEBIANand I was unaware of any name collisions with other packaging utilities.
– Philip Couling
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, usingdpkg-deb(which you’ve made explicit) and (2) thatconffilesis a universal solution — as mentioned above, in the current compatibility level (12),debhelperwill ignore anyconffilesprovided in the packaging.
– Stephen Kitt
yesterday
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511862%2fapt-update-always-overrides-old-config-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
You need to include a conffiles file in your control control.tar.gz. When creating a package with dpkg-deb this is placed in DEBIAN/conffiles. This file should have exactly one line for every config file contained in your debian package. Each line specifies the full path of a config file.
See https://manpages.debian.org/testing/dpkg-dev/deb-conffiles.5.en.html
The result of including this will be that these files are registered on the system as config files and will not be automatically overwritten.
I've not used CPackDeb myself, but there's a reference for how to add files to control.tar.gz here:
https://cmake.org/cmake/help/v3.0/module/CPackDeb.html?highlight=conffiles
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR/prerm;$CMAKE_CURRENT_SOURCE_DIR/postrm")
... assuming you're usingdh_installdebwhich I've never bothered to. But okay I'll edit
– Philip Couling
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulateDEBIANdirectly. If you write aconffilesin your control directory, it won’t be taken into account indebhelpercompatibility level 12 or later. Of course if you don’t usedebhelperthen you need to deal with things yourself but that’s not what I’d expect new packagers to do...
– Stephen Kitt
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
I can see the ambiguity withdebhelper's nomenclature. I've edited to quantify the use of theDEBIANdirectory fordpkg-debalthough I note aconffilesfile for installation intoDEBIANis also correct fordebhelperwhere it does not automatically find config files. The underlying file format doesn't use the nameDEBIANand I was unaware of any name collisions with other packaging utilities.
– Philip Couling
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, usingdpkg-deb(which you’ve made explicit) and (2) thatconffilesis a universal solution — as mentioned above, in the current compatibility level (12),debhelperwill ignore anyconffilesprovided in the packaging.
– Stephen Kitt
yesterday
add a comment |
You need to include a conffiles file in your control control.tar.gz. When creating a package with dpkg-deb this is placed in DEBIAN/conffiles. This file should have exactly one line for every config file contained in your debian package. Each line specifies the full path of a config file.
See https://manpages.debian.org/testing/dpkg-dev/deb-conffiles.5.en.html
The result of including this will be that these files are registered on the system as config files and will not be automatically overwritten.
I've not used CPackDeb myself, but there's a reference for how to add files to control.tar.gz here:
https://cmake.org/cmake/help/v3.0/module/CPackDeb.html?highlight=conffiles
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR/prerm;$CMAKE_CURRENT_SOURCE_DIR/postrm")
... assuming you're usingdh_installdebwhich I've never bothered to. But okay I'll edit
– Philip Couling
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulateDEBIANdirectly. If you write aconffilesin your control directory, it won’t be taken into account indebhelpercompatibility level 12 or later. Of course if you don’t usedebhelperthen you need to deal with things yourself but that’s not what I’d expect new packagers to do...
– Stephen Kitt
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
I can see the ambiguity withdebhelper's nomenclature. I've edited to quantify the use of theDEBIANdirectory fordpkg-debalthough I note aconffilesfile for installation intoDEBIANis also correct fordebhelperwhere it does not automatically find config files. The underlying file format doesn't use the nameDEBIANand I was unaware of any name collisions with other packaging utilities.
– Philip Couling
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, usingdpkg-deb(which you’ve made explicit) and (2) thatconffilesis a universal solution — as mentioned above, in the current compatibility level (12),debhelperwill ignore anyconffilesprovided in the packaging.
– Stephen Kitt
yesterday
add a comment |
You need to include a conffiles file in your control control.tar.gz. When creating a package with dpkg-deb this is placed in DEBIAN/conffiles. This file should have exactly one line for every config file contained in your debian package. Each line specifies the full path of a config file.
See https://manpages.debian.org/testing/dpkg-dev/deb-conffiles.5.en.html
The result of including this will be that these files are registered on the system as config files and will not be automatically overwritten.
I've not used CPackDeb myself, but there's a reference for how to add files to control.tar.gz here:
https://cmake.org/cmake/help/v3.0/module/CPackDeb.html?highlight=conffiles
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR/prerm;$CMAKE_CURRENT_SOURCE_DIR/postrm")
You need to include a conffiles file in your control control.tar.gz. When creating a package with dpkg-deb this is placed in DEBIAN/conffiles. This file should have exactly one line for every config file contained in your debian package. Each line specifies the full path of a config file.
See https://manpages.debian.org/testing/dpkg-dev/deb-conffiles.5.en.html
The result of including this will be that these files are registered on the system as config files and will not be automatically overwritten.
I've not used CPackDeb myself, but there's a reference for how to add files to control.tar.gz here:
https://cmake.org/cmake/help/v3.0/module/CPackDeb.html?highlight=conffiles
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA
"${CMAKE_CURRENT_SOURCE_DIR/prerm;$CMAKE_CURRENT_SOURCE_DIR/postrm")
edited yesterday
answered yesterday
Philip CoulingPhilip Couling
2,5791123
2,5791123
... assuming you're usingdh_installdebwhich I've never bothered to. But okay I'll edit
– Philip Couling
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulateDEBIANdirectly. If you write aconffilesin your control directory, it won’t be taken into account indebhelpercompatibility level 12 or later. Of course if you don’t usedebhelperthen you need to deal with things yourself but that’s not what I’d expect new packagers to do...
– Stephen Kitt
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
I can see the ambiguity withdebhelper's nomenclature. I've edited to quantify the use of theDEBIANdirectory fordpkg-debalthough I note aconffilesfile for installation intoDEBIANis also correct fordebhelperwhere it does not automatically find config files. The underlying file format doesn't use the nameDEBIANand I was unaware of any name collisions with other packaging utilities.
– Philip Couling
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, usingdpkg-deb(which you’ve made explicit) and (2) thatconffilesis a universal solution — as mentioned above, in the current compatibility level (12),debhelperwill ignore anyconffilesprovided in the packaging.
– Stephen Kitt
yesterday
add a comment |
... assuming you're usingdh_installdebwhich I've never bothered to. But okay I'll edit
– Philip Couling
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulateDEBIANdirectly. If you write aconffilesin your control directory, it won’t be taken into account indebhelpercompatibility level 12 or later. Of course if you don’t usedebhelperthen you need to deal with things yourself but that’s not what I’d expect new packagers to do...
– Stephen Kitt
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
I can see the ambiguity withdebhelper's nomenclature. I've edited to quantify the use of theDEBIANdirectory fordpkg-debalthough I note aconffilesfile for installation intoDEBIANis also correct fordebhelperwhere it does not automatically find config files. The underlying file format doesn't use the nameDEBIANand I was unaware of any name collisions with other packaging utilities.
– Philip Couling
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, usingdpkg-deb(which you’ve made explicit) and (2) thatconffilesis a universal solution — as mentioned above, in the current compatibility level (12),debhelperwill ignore anyconffilesprovided in the packaging.
– Stephen Kitt
yesterday
... assuming you're using
dh_installdeb which I've never bothered to. But okay I'll edit– Philip Couling
yesterday
... assuming you're using
dh_installdeb which I've never bothered to. But okay I'll edit– Philip Couling
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulate
DEBIAN directly. If you write a conffiles in your control directory, it won’t be taken into account in debhelper compatibility level 12 or later. Of course if you don’t use debhelper then you need to deal with things yourself but that’s not what I’d expect new packagers to do...– Stephen Kitt
yesterday
You’re making a few assumptions which are liable to confuse readers. If building from source, you hardly ever manipulate
DEBIAN directly. If you write a conffiles in your control directory, it won’t be taken into account in debhelper compatibility level 12 or later. Of course if you don’t use debhelper then you need to deal with things yourself but that’s not what I’d expect new packagers to do...– Stephen Kitt
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
Aha, so I am indeed not packaging correctly. Any idea how to achieve that behavior with CPack? Will look into CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA.
– user907323
yesterday
I can see the ambiguity with
debhelper's nomenclature. I've edited to quantify the use of the DEBIAN directory for dpkg-deb although I note a conffiles file for installation into DEBIAN is also correct for debhelper where it does not automatically find config files. The underlying file format doesn't use the name DEBIAN and I was unaware of any name collisions with other packaging utilities.– Philip Couling
yesterday
I can see the ambiguity with
debhelper's nomenclature. I've edited to quantify the use of the DEBIAN directory for dpkg-deb although I note a conffiles file for installation into DEBIAN is also correct for debhelper where it does not automatically find config files. The underlying file format doesn't use the name DEBIAN and I was unaware of any name collisions with other packaging utilities.– Philip Couling
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, using
dpkg-deb (which you’ve made explicit) and (2) that conffiles is a universal solution — as mentioned above, in the current compatibility level (12), debhelper will ignore any conffiles provided in the packaging.– Stephen Kitt
yesterday
@Philip thanks, your answer seems OK to me now. The assumptions I was referring to were that (1) that users were building binary packages directly, using
dpkg-deb (which you’ve made explicit) and (2) that conffiles is a universal solution — as mentioned above, in the current compatibility level (12), debhelper will ignore any conffiles provided in the packaging.– Stephen Kitt
yesterday
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f511862%2fapt-update-always-overrides-old-config-file%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
-apt, deb
Where is your config file installed? Are you using
debhelperto build your package?– Stephen Kitt
yesterday
I am using Cmake's CPackDeb. Installed to /etc/<foo>/
– user907323
yesterday