LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 01-19-2017, 05:07 PM   #1
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Rep: Reputation: 56
Debian / Ubuntu: How to mark dpkg package like it was never installed before?


I have had problems in the past with reinstalling packages, trying to get the default config files reinstalled.
What I learned was, that Debian notes if config files get erased (my attempt to get them pulled from the package default) and that information even gets remembered when deinstalling and purging the package.

Now my question: How can I tell the apt / dpkg database that package xzy is wiped off the system and should not be remembered, that it was ever installed, so that when I install it, the system feels that it is the first time ever and the default config files get properly created?

I have been in the absurd situation where I erased a config file and then Debian refused to ever create it again.
This hinders the situation where after an dist-upgrade (or several) I want to reset a package to factory defaults, so all old leftovers are properly removed.
 
Old 01-19-2017, 05:14 PM   #2
dlb101010
Member
 
Registered: Dec 2016
Posts: 61

Rep: Reputation: 18
Hey,

Here's a link I believe answers your question.

HTH,
Dave
 
Old 01-20-2017, 06:22 PM   #3
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Thanks for the link, I found another link that let's reset a package likeit was never installed, which is the easiest way without having to specify tons of options. Is there a dpkg command that lets the database forget that a package was ever installed, instead of having to edit the database by hand, which is very ugly?

Last edited by browny_amiga; 01-20-2017 at 06:24 PM.
 
Old 01-21-2017, 04:01 AM   #4
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
your registered date instils some respect, nevertheless i have to ask:

- how are you editing which database manually?
- did you read 'man dpkg'?
- are you sure dpkg actually "remembers" packages after they have been purged? show us?
- how are you un/installing?
 
Old 01-21-2017, 06:21 PM   #5
Brains
Senior Member
 
Registered: Apr 2009
Distribution: All OS except Apple
Posts: 1,591

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
I've had scripts in a live system that would pump the contents of all packages required to support hardware features found early in the boot process based on vendor and hardware ids present. As it was a live system, hardware varies, and by pumping the contents of all packages needed for proprietary Nvidia support for example, during the boot process would give a desktop with full proprietary support.

With the exception of the kernel module and xorg.conf file which had to be pre-built, all other configuration files, libraries, etc. were extracted from the packages. When you open the package with an archiver you will find the files that would be installed in a directory tree equal to root directory so you know exactly where the file belongs.

Just a "hack" method of installing default files.
 
Old 01-21-2017, 08:02 PM   #6
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
I'm aware that I can take the config files directly from the package, I chose not to, as I want to use dpkg to do it. I want a systematic scalable way to do this in the future.

What my aim is to remove a package 100%, like it was never installed in the first place. That dpkg thinks that this is a fresh system, where package xzy was never before installed. The dpkg man file does not say anything about that, reseting and making dpkg forget that a package was ever installed. Once I had it installed, it is no longer fully deinstallable by dpkg itself. I have no idea where and how the dpkg database works, I have interfaced with it via apt and dpkg so far and cannot find any documentation about the workings and file structure of the db. At this point, I would assume that /var/lib/dpkg/status is a flat file that is called database, but I have to do more testing.
How I know that dpkg remembers a deinstalled file?
Well, I have tried this some years back, trying to reset a package to its fully uninstalled state, so that a new install will create the standard default config files, but I could not make this happen. dpkg did not want to recreate the config files, even after purging the package with apt. I then erased one config file when the package was installed, which caused the consecutive purge to also remember that I erased that file and assumed, that this was intentional on my side and from then on never again replaced the missing file with the default config file.

Here is a description of what dpkg does, that it remembers when you erase files, even when purging and then never recreates them again when reinstalling.
http://superuser.com/questions/10387...eleted/1038734

I might have to completely erase an entry of the package in /var/lib/dpkg/status by hand so that a fresh clean reinstall is possible. I wish a dpkg command could do that, ask dpkg to completely forget about the history of a package.
 
Old 01-22-2017, 03:21 AM   #7
ondoho
LQ Addict
 
Registered: Dec 2013
Posts: 19,872
Blog Entries: 12

Rep: Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053Reputation: 6053
interesting.
however, that superuser thread does NOT mention that "even purging" doesn't help here.
moreover, doesn't tell us where that crucial log file entry came from...


the bug report was closed because dpkg works as expected.

i still don't see anything that 'purge' wouldn't fix.

also, looking at 'man dpkg' and searching for 'status' there's quite a few interesting entries, pertaining to removing entries from /var/lib/dpkg/status and more.
are you sure you saw all that and tried all options available?
 
Old 01-22-2017, 10:08 AM   #8
Habitual
LQ Veteran
 
Registered: Jan 2011
Location: Abingdon, VA
Distribution: Catalina
Posts: 9,374
Blog Entries: 37

Rep: Reputation: Disabled
Quote:
Originally Posted by browny_amiga View Post
I erased a config file and then Debian refused to ever create it again.
Tell us about this.
 
Old 06-20-2017, 06:53 PM   #9
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
I have not had this problem for a while, but now it is back and I can talk in detail about it, it is on a raspberry Pi, using Raspian.
I'm having a problem with the network configuration and especially wpa_supplicant.
I wanted to do a complete reset of the config, so I erased the whole wpa_supplicant directory on /etc/.

Using the option force_confmiss, I'm trying to make dpkg regenerate the config files, it does work for some of the conf files, but not the most important one, wpa_supplicant.conf

dpkg -i --force-confmiss wpasupplicant_2.3-1+deb8u4_armhf.deb
(Reading database ... 123761 files and directories currently installed.)
Preparing to unpack wpasupplicant_2.3-1+deb8u4_armhf.deb ...
Unpacking wpasupplicant (2.3-1+deb8u4) over (2.3-1+deb8u4) ...
Setting up wpasupplicant (2.3-1+deb8u4) ...

Configuration file `/etc/wpa_supplicant/action_wpa.sh', does not exist on system.
Installing new config file as you requested.

Configuration file `/etc/wpa_supplicant/functions.sh', does not exist on system.
Installing new config file as you requested.

Configuration file `/etc/wpa_supplicant/ifupdown.sh', does not exist on system.
Installing new config file as you requested.

then,
ifup wlan0
wpa_supplicant: cannot read contents of /etc/wpa_supplicant/wpa_supplicant.conf
run-parts: /etc/network/if-pre-up.d/wpasupplicant exited with return code 1
Failed to bring up wlan0.


I'm grateful for any insights.
 
Old 06-20-2017, 07:23 PM   #10
hydrurga
LQ Guru
 
Registered: Nov 2008
Location: Pictland
Distribution: Linux Mint 21 MATE
Posts: 8,048
Blog Entries: 5

Rep: Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925Reputation: 2925
In the version of wpasupplicant you're trying to configure from (2.3-1+deb8u4), the conffile wpa_supplicant.conf is unpacked to /etc/dbus-1/system.d/, not /etc/wpa_supplicant/ where your copy of wpa_supplicant appears to be looking for it.
 
Old 06-20-2017, 08:56 PM   #11
browny_amiga
Member
 
Registered: Dec 2001
Location: /mnt/UNV/Mlkway/Earth/USA/California/Silicon Valley
Distribution: Kubuntu, Debian Buster Stable, Windoze 7
Posts: 684

Original Poster
Rep: Reputation: 56
Interesting, I followed the instructions for the raspberry Pi (Raspian) and they mentioned that it is supposed to be in /etc/wpa_supplicant

https://www.raspberrypi.org/document...ireless-cli.md

Might this be outdated them? It does not say that it is not current anymore.
Is systemd then managing the network?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I mark mplayer for non-installation w/ apt-get/ aptitude/ dpkg? NirvanaII Linux - General 5 04-10-2011 05:13 PM
LXer: To Mark Shuttleworth on Ubuntu / Debian LXer Syndicated Linux News 0 03-25-2010 04:20 PM
Debian package management - how are debconf and dpkg-deb related? austinium Debian 5 03-08-2010 05:25 AM
Using Java to install a package with dpkg in Debian basis1980 Linux - Newbie 4 12-06-2007 02:45 AM
LXer: Debian/Ubuntu Package management Using dpkg LXer Syndicated Linux News 0 04-19-2007 09:47 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 08:36 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration