FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Debian > Debian dpkg

 
 
LinkBack Thread Tools
 
Old 06-27-2010, 05:58 PM
Daniel Bock
 
Default Feature request: Reset configuration

Hi,

I recently read this workaround:

If the dpkg-reconfigure foo doesn't work, use this:

1. Remove or rename the broken configuration file.
sudo mv /etc/samba/smb.conf /etc/samba/smb.conf.broken

2. Request replacements from dpkg.
sudo dpkg -i --force-confmiss /path/to/samba-common.deb

This tells dpkg to replace missing configuration files with those from
the .deb. You might find the original package .deb in
/var/cache/apt/archives, or you can use a fresh copy of the same version
from your distribution's repositories.


dpkg -i --force-confnew foo.deb

That flag only forces dpkg to overwrite the config file if it would
otherwise have asked for permission to do so. It does not make it
magically recreate pristine config files from the package.


from superuser: How do I get the default configuration from a .deb file?
<http://superuser.com/questions/69045/how-do-i-get-the-default-configuration-from-a-deb-file>
(quack quixote♦ and Teddy) and serverfault: Linux: how to restore config
file using apt-get/aptitude?
<http://serverfault.com/questions/82801/linux-how-to-restore-config-file-using-apt-get-aptitude>
(TRS-80)


--

This is the workaround needed to reset the configuration of some debian
packages who need them. There are also other workarounds (e.g. purge
first and ignore dependencies and then install again; e.g. Extract
configuration files from .deb manually), but they are ugly and
workarounds as well. Or have I overlooked something?


It seems to be an important feature and I propose you to implement this
option to magically make the configuration of an package pristine. Come
on, everybody will be happy about such feature.


Regards,
Daniel Bock


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4C279129.7020509@web.de">http://lists.debian.org/4C279129.7020509@web.de
 
Old 06-27-2010, 08:23 PM
Jonathan Nieder
 
Default Feature request: Reset configuration

Daniel Bock wrote:

> This is the workaround needed to reset the configuration of some
> debian packages who need them. There are also other workarounds
> (e.g. purge first and ignore dependencies and then install again;
> e.g. Extract configuration files from .deb manually), but they are
> ugly and workarounds as well. Or have I overlooked something?

I agree. It would be nice to have

dpkg-deb --extract foo.deb / /etc

to extract the /etc directory from a package and

dpkg-deb --conffiles foo.deb | xargs dpkg-deb --extract foo.deb /

or maybe

dpkg-deb --extract foo.deb / --conffiles

to extract all files marked as conffile.

Note, though, that this is not enough to reset the configuration in
many cases. Sometimes maintainer scripts go as far as writing files
in /etc themselves from scratch.

> It seems to be an important feature and I propose you to implement
> this option

This part, though, I disagree with. If you or anyone you know would
like to work on this, I would be glad to help them.

(A not small part of my motivation in this is to give others the
opportunity to read and write dpkg code, too.)

Hope that helps,
Jonathan


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100627202314.GC9565@burratino">http://lists.debian.org/20100627202314.GC9565@burratino
 
Old 06-27-2010, 08:40 PM
sean finney
 
Default Feature request: Reset configuration

On Sun, Jun 27, 2010 at 03:23:14PM -0500, Jonathan Nieder wrote:
> > This is the workaround needed to reset the configuration of some
> > debian packages who need them. There are also other workarounds
>
> I agree. It would be nice to have
>
> dpkg-deb --extract foo.deb / /etc
>
> to extract the /etc directory from a package and
>
> dpkg-deb --conffiles foo.deb | xargs dpkg-deb --extract foo.deb /
>
> or maybe
>
> dpkg-deb --extract foo.deb / --conffiles
>
> to extract all files marked as conffile.

alternatively, if there were some progress on the conffile "database"
handling code, the pristine version of the package's conffile would
be already sitting on the fs and/or available to a helper program...


sean
 
Old 06-27-2010, 08:45 PM
Jonathan Nieder
 
Default Feature request: Reset configuration

Hi Sean,

sean finney wrote:

> alternatively, if there were some progress on the conffile "database"
> handling code, the pristine version of the package's conffile would
> be already sitting on the fs and/or available to a helper program...

I agree with this. In the past it seemed like you were mostly
interested in hearing from people with the ability to commit changes,
so I quieted down. Really I think it would be better to treat
development and deployment of that code as separate steps: i.e., first
work together to get the design right and ask people to try it out
(maybe in Debian experimental, maybe as an unofficial thing) and only
once there has been some success merge it to sid.

Just my two cents,
Jonathan


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100627204547.GA10385@burratino">http://lists.debian.org/20100627204547.GA10385@burratino
 
Old 06-28-2010, 07:21 AM
sean finney
 
Default Feature request: Reset configuration

hi jonathan,

On Sun, Jun 27, 2010 at 03:45:47PM -0500, Jonathan Nieder wrote:
> I agree with this. In the past it seemed like you were mostly
> interested in hearing from people with the ability to commit changes,

no, i wouldn't say so. however, there is/was a fairly strict intersection
of those reviewing c code and those committing c code, given that with few
exceptions it has basically been one person in this project.

i did ask for one specific change to be committed, mostly as a sign of
good faith and to make my life easier. this was code not directly related
to the feature and should have been entirely non-controversial (moving
some common functions out of the problematic help.c file). if this
change isn't done, rebasing the rest of the patches is a major PITA as
they depend on these functions, and unit tests for the code (also requested
by the maintainer) are impossible.

the fact that this was not done, along with the lack of any further
responses to my follow-up questions (in february) was taken by me as a
sign that the maintainer isn't too interested in pursuing things further,
at least at this point.

given the amount of work i've already invested into this (60-80 hours
would be a conservative estimate), and this apparent lack of interest,
you'll have to excuse me if i come off as a bit... "meh" about it,
but i'm not exactly motivated to spend more of my time on it.

> so I quieted down. Really I think it would be better to treat
> development and deployment of that code as separate steps: i.e., first
> work together to get the design right and ask people to try it out
> (maybe in Debian experimental, maybe as an unofficial thing) and only
> once there has been some success merge it to sid.

the "design" stuff was, at least in broad strokes, worked out for some
time based on earlier discussions. in more specific terms the
current patches seem to be lost in a mire of implementation details and
aesthetic minutae, and discussion died off somewhere in the process of
seperating the two.

i should add that don't consider these patches to be written in stone
and there have indeed been a few iterations of them, but in order for
progress to be made there needs to be a discussion, and in order for
there to be a discussion there needs to be somone on both ends of teh
tubez willing to spend some time on this.


sean
 
Old 06-28-2010, 04:44 PM
Jonathan Nieder
 
Default Feature request: Reset configuration

Daniel Bock wrote:

>> If I would set cc to 'y', I would _always_ get the maintainer
>> configuration, isn't?
[...]

Sorry for the slow response. The question that 'y' might be an
answer to is about how to handle a change in a conffile on package
update. I would suggest first doing a little reconnaissance:

fprintf(stderr, "IN deferred_conffile_configure pkg = %s
", pkg->name);
fprintf(stderr, "conff = %s
", conff->name);

to make sure you are working on the right piece of code.


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100628164447.GA9768@burratino">http://lists.debian.org/20100628164447.GA9768@burratino
 
Old 06-28-2010, 04:48 PM
Jonathan Nieder
 
Default Feature request: Reset configuration

Daniel Bock wrote:
> Jonathan Nieder wrote:

>> dpkg-deb --extract foo.deb / /etc
[...]
>> dpkg-deb --conffiles foo.deb | xargs dpkg-deb --extract foo.deb /
[...]
>> dpkg-deb --extract foo.deb / --conffiles
[...]
> Yeah, that's not enough, because these commands don't work, yet. But
> if there would be a command to also reinstall the configuration
> files installed by maintainer scripts, nobody would use them.

I was only suggesting that that’s an interface I would like. It
would be useful for extracting other directories, too, as when I
want to look at the man pages from a not-installed package.

But if something else is just as convenient to use and easier to
implement, I don’t mind.

Thanks for your hard work,
Jonathan


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100628164840.GB9768@burratino">http://lists.debian.org/20100628164840.GB9768@burratino
 
Old 06-29-2010, 12:57 AM
Jonathan Nieder
 
Default Feature request: Reset configuration

Hi again,

Daniel Bock wrote:

> if there would be a command to also reinstall the configuration
> files installed by maintainer scripts

I completely missed this point before. Now I am convinced:

apt-get --reinstall --overwrite-conffiles install foo

seems more intuitive than

dpkg -x foo.deb /etc
dpkg-reconfigure foo

indeed.


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100629005720.GA1975@burratino">http://lists.debian.org/20100629005720.GA1975@burratino
 
Old 07-02-2010, 11:43 AM
Guillem Jover
 
Default Feature request: Reset configuration

Hi!

On Sun, 2010-06-27 at 19:58:01 +0200, Daniel Bock wrote:
> 2. Request replacements from dpkg.
> sudo dpkg -i --force-confmiss /path/to/samba-common.deb
>
> This tells dpkg to replace missing configuration files with those
> from the .deb. You might find the original package .deb in
> /var/cache/apt/archives, or you can use a fresh copy of the same
> version from your distribution's repositories.
>
> dpkg -i --force-confnew foo.deb
>
> That flag only forces dpkg to overwrite the config file if it would
> otherwise have asked for permission to do so. It does not make it
> magically recreate pristine config files from the package.

> It seems to be an important feature and I propose you to implement
> this option to magically make the configuration of an package
> pristine. Come on, everybody will be happy about such feature.

I might have missed something but isn't:

$ dpkg --force-confmiss --force-confnew -i foo.deb

what you are looking for (given the patch you've sent)?

(Regardless of the prospective dpkg-conffile support etc).

regards,
guillem


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 20100702114325.GA32127@gaara.hadrons.org">http://lists.debian.org/20100702114325.GA32127@gaara.hadrons.org
 
Old 07-02-2010, 12:42 PM
Daniel Bock
 
Default Feature request: Reset configuration

Am 02.07.2010 13:43, schrieb Guillem Jover:

Hi!

On Sun, 2010-06-27 at 19:58:01 +0200, Daniel Bock wrote:


2. Request replacements from dpkg.
sudo dpkg -i --force-confmiss /path/to/samba-common.deb

This tells dpkg to replace missing configuration files with those
from the .deb. You might find the original package .deb in
/var/cache/apt/archives, or you can use a fresh copy of the same
version from your distribution's repositories.

dpkg -i --force-confnew foo.deb

That flag only forces dpkg to overwrite the config file if it would
otherwise have asked for permission to do so. It does not make it
magically recreate pristine config files from the package.



It seems to be an important feature and I propose you to implement
this option to magically make the configuration of an package
pristine. Come on, everybody will be happy about such feature.


I might have missed something but isn't:

$ dpkg --force-confmiss --force-confnew -i foo.deb

what you are looking for (given the patch you've sent)?

(Regardless of the prospective dpkg-conffile support etc).

regards,
guillem


Hi,

No, it's definitely not.

--force-confmiss --force-confnew

are just for file conflicts, which are not handled automatically.

Edit your

/etc/dhcp3/dhclient.conf

and try your command. It won't be replaced.

Regards,
Daniel Bock


--
To UNSUBSCRIBE, email to debian-dpkg-REQUEST@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
Archive: 4C2DDEC4.7000904@web.de">http://lists.debian.org/4C2DDEC4.7000904@web.de
 

Thread Tools




All times are GMT. The time now is 04:43 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org