Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

keep old config after apt install

Off-Topic discussions about science, technology, and non Debian specific topics.
Post Reply
Message
Author
ptz
Posts: 8
Joined: 2018-07-11 11:05

keep old config after apt install

#1 Post by ptz »

Package installation question. I am on Ubuntu xenial. I can't get apt-get to keep an old configuration file when updating a package. Things I tried:

Code: Select all

apt-get -o Dpkg::Options::="--force-confdef" -o Dpkg::Options::="--force-confold" install <package>

Code: Select all

export DEBIAN_FRONTEND=noninteractive ; apt-get install -y -o Dpkg::Options::="--force-confold" <package>
And a few variations; I tried both editing and not editing the config file prior to running the package update. Nothing works, the new config file is always silently installed (without backing up the old one).

What am I doing wrong?

User avatar
sunrat
Administrator
Administrator
Posts: 6457
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 116 times
Been thanked: 472 times

Re: keep old config after apt install

#2 Post by sunrat »

ptz wrote:What am I doing wrong?
You're asking a Ubuntu question on Debian forum.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

ptz
Posts: 8
Joined: 2018-07-11 11:05

Re: keep old config after apt install

#3 Post by ptz »

sunrat wrote:
ptz wrote:What am I doing wrong?
You're asking a Ubuntu question on Debian forum.
Lol. But isn't the packaging part rather similar? Or does Ubuntu deviate significantly?

User avatar
GarryRicketson
Posts: 5644
Joined: 2015-01-20 22:16
Location: Durango, Mexico

Re: keep old config after apt install

#4 Post by GarryRicketson »

Yes it does. Ubuntu is NOT Debian
ptz wrote:
What am I doing wrong?
Using Ubuntu , instead of Debian.

User avatar
stevepusser
Posts: 12930
Joined: 2009-10-06 05:53
Has thanked: 41 times
Been thanked: 71 times

Re: keep old config after apt install

#5 Post by stevepusser »

Plus you're leaving out what package is giving you the problem. The apt system is also supposed to stop and let you decide if you want to keep or overwrite a configuration file if you've changed it from the default. We see that a lot in MX if we have to change the sources.lists files for some reason installed from one of our MX default settings packages--then it stops and wants input from the user, and some new users are really scared of the terminal.
MX Linux packager and developer

ptz
Posts: 8
Joined: 2018-07-11 11:05

Re: keep old config after apt install

#6 Post by ptz »

stevepusser wrote:Plus you're leaving out what package is giving you the problem.

My own packaged software.
stevepusser wrote:The apt system is also supposed to stop and let you decide if you want to keep or overwrite a configuration file if you've changed it from the default.
So I hear. Doesn't happen for some reason.

ptz
Posts: 8
Joined: 2018-07-11 11:05

Re: keep old config after apt install

#7 Post by ptz »

GarryRicketson wrote:Yes it does. Ubuntu is NOT Debian
ptz wrote:
What am I doing wrong?
Using Ubuntu , instead of Debian.
Ubuntu is not debian, but aptitude is aptitude, and dpkg is dpkg.

I have little choice in the matter of platform, I am on an embedded device with Ubuntucore-based OS provided by the manufacturer.

ptz
Posts: 8
Joined: 2018-07-11 11:05

Re: keep old config after apt install

#8 Post by ptz »

I kind of omitted the most important bit of info. It's a package I am building myself. And it seems that I have not marked the conf file with conffiles, so dpkg doesn't know it's a special file.

Post Reply