个人工具

“UbuntuHelp:Configuration”的版本间的差异

来自Ubuntu中文

跳转至: 导航, 搜索
(新页面: {{From|https://help.ubuntu.com/community/Configuration}} {{Languages|UbuntuHelp:Configuration}} A way to detect new and old configuration files related to a new installation is to use <...)
 
第3行: 第3行:
 
A way to detect new and old configuration files related to a new installation  is to use  
 
A way to detect new and old configuration files related to a new installation  is to use  
 
<pre><nowiki>
 
<pre><nowiki>
locate dpkg-new
+
locate dpkg-dist
 
locate dpkg-old
 
locate dpkg-old
 
</nowiki></pre>
 
</nowiki></pre>
 
This should suffice after the locate database was updated. Otherwise, use  
 
This should suffice after the locate database was updated. Otherwise, use  
 
<pre><nowiki>
 
<pre><nowiki>
sudo find / -name "*.dpkg-old"
+
sudo find /etc -name "*.dpkg-old"
sudo find / -name "*.dpkg-new"
+
sudo find /etc -name "*.dpkg-dist"
 
</nowiki></pre>
 
</nowiki></pre>
 
'''Note:''' if you navigate to menu "Places" > "Search for files ...", you can use a graphical search tool that has equivalent functionality to the aforementioned command lines.
 
'''Note:''' if you navigate to menu "Places" > "Search for files ...", you can use a graphical search tool that has equivalent functionality to the aforementioned command lines.
 
"locate" is the traditional unix file lookup tool. It does not actually search the file system when you issue the command,  but checks a database that is updated in intervals. Therefore, it won't find newly created files. To learn more about it, read the man page (either "man locate" in a terminal, or System -> Help).
 
"locate" is the traditional unix file lookup tool. It does not actually search the file system when you issue the command,  but checks a database that is updated in intervals. Therefore, it won't find newly created files. To learn more about it, read the man page (either "man locate" in a terminal, or System -> Help).
dpkg-old and dpkg-new are filename extensions that are created when a package is upgraded and a conffile overwritten. <conffilename>.dpkg-old is created when the user has chosen to use the newly installed one. <conffilename>.dpkg-new is created when the user opted to keep the old one; it is the version from the newer package.
+
dpkg-old and dpkg-dist are filename extensions that are created when a package is upgraded and a conffile overwritten. <conffilename>.dpkg-old is created when the user has chosen to use the newly installed one. <conffilename>.dpkg-dist is created when the user opted to keep the old one; it is the version from the newer package.
Some more information on dpkg's configuration file handling can be found at the [http://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html Debian Policy Manual], Appendix E - Configuration file handling.
+
Some more information on dpkg's configuration file handling can be found at the [[http://www.debian.org/doc/debian-policy/ap-pkg-conffiles.html|Debian Policy Manual]], Appendix E - Configuration file handling.
 
E.g., this is what appears in one example computer
 
E.g., this is what appears in one example computer
 
<pre><nowiki>  
 
<pre><nowiki>  
第27行: 第27行:
 
</nowiki></pre>
 
</nowiki></pre>
 
"locate dpkg-old" simply finds files of this name pattern. Note that for each of those there exists the currently-used valid conffile without the extension.  
 
"locate dpkg-old" simply finds files of this name pattern. Note that for each of those there exists the currently-used valid conffile without the extension.  
 +
There is also dpkg's log file, /var/log/dpkg.log, which records changed conffiles, and the performed action (keep vs. install) . Here are the results from another example computer when searching for "conffile" (by using grep):
 +
<pre><nowiki>
 +
grep conffile /var/log/dpkg.log
 +
          2008-05-15 10:23:48 conffile /etc/X11/Xsession keep
 +
          2008-05-15 13:09:00 conffile /etc/mime.types install
 +
          2008-05-15 13:56:17 conffile /etc/cron.daily/apt install
 +
          2008-05-15 14:02:42 conffile /etc/cups/cupsd.conf install
 +
          2008-05-15 16:26:06 conffile /etc/gdm/gdm.conf install
 +
          2008-05-15 16:44:23 conffile /etc/network/if-up.d/mountnfs install
 +
          2008-05-15 20:24:54 conffile /etc/xmp/xmp.conf install
 +
          2008-05-15 20:26:27 conffile /etc/xmp/xmp-modules.conf install
 +
          2008-05-15 21:17:03 conffile /etc/sane.d/dll.conf install
 +
          2008-05-15 22:18:51 conffile /etc/ssh/ssh_config install
 +
          2008-05-16 06:56:06 conffile /etc/ntp.conf install
 +
          2008-05-16 07:53:55 conffile /etc/cron-apt/config install
 +
          2008-05-16 08:32:12 conffile /etc/openoffice/psprint.conf install
 +
</nowiki></pre>
 
----
 
----
 
[[category:CategoryPackageManagement]]
 
[[category:CategoryPackageManagement]]
  
 
[[category:UbuntuHelp]]
 
[[category:UbuntuHelp]]

2008年10月19日 (日) 04:40的版本

A way to detect new and old configuration files related to a new installation is to use

locate dpkg-dist
locate dpkg-old

This should suffice after the locate database was updated. Otherwise, use

sudo find /etc -name "*.dpkg-old"
sudo find /etc -name "*.dpkg-dist"

Note: if you navigate to menu "Places" > "Search for files ...", you can use a graphical search tool that has equivalent functionality to the aforementioned command lines. "locate" is the traditional unix file lookup tool. It does not actually search the file system when you issue the command, but checks a database that is updated in intervals. Therefore, it won't find newly created files. To learn more about it, read the man page (either "man locate" in a terminal, or System -> Help). dpkg-old and dpkg-dist are filename extensions that are created when a package is upgraded and a conffile overwritten. <conffilename>.dpkg-old is created when the user has chosen to use the newly installed one. <conffilename>.dpkg-dist is created when the user opted to keep the old one; it is the version from the newer package. Some more information on dpkg's configuration file handling can be found at the [Policy Manual], Appendix E - Configuration file handling. E.g., this is what appears in one example computer

 
locate dpkg-old
/etc/bash.bashrc.dpkg-old
/etc/ntp.conf.dpkg-old
/etc/apt/apt.conf.d/10periodic.dpkg-old
/etc/ati/control.dpkg-old
/etc/ati/signature.dpkg-old
/ec/event.d/rcS-sulogin.dpkg-old

"locate dpkg-old" simply finds files of this name pattern. Note that for each of those there exists the currently-used valid conffile without the extension. There is also dpkg's log file, /var/log/dpkg.log, which records changed conffiles, and the performed action (keep vs. install) . Here are the results from another example computer when searching for "conffile" (by using grep):

grep conffile /var/log/dpkg.log
           2008-05-15 10:23:48 conffile /etc/X11/Xsession keep
           2008-05-15 13:09:00 conffile /etc/mime.types install
           2008-05-15 13:56:17 conffile /etc/cron.daily/apt install
           2008-05-15 14:02:42 conffile /etc/cups/cupsd.conf install
           2008-05-15 16:26:06 conffile /etc/gdm/gdm.conf install
           2008-05-15 16:44:23 conffile /etc/network/if-up.d/mountnfs install
           2008-05-15 20:24:54 conffile /etc/xmp/xmp.conf install
           2008-05-15 20:26:27 conffile /etc/xmp/xmp-modules.conf install
           2008-05-15 21:17:03 conffile /etc/sane.d/dll.conf install
           2008-05-15 22:18:51 conffile /etc/ssh/ssh_config install
           2008-05-16 06:56:06 conffile /etc/ntp.conf install
           2008-05-16 07:53:55 conffile /etc/cron-apt/config install
           2008-05-16 08:32:12 conffile /etc/openoffice/psprint.conf install