Datasheet

93
Chapter 4 Software Management
Let’s take a working example, and reinstall vim. If you haven’t purged it already, do
so now with
aptitude purge vim. This will remove all its configuration files and
tell the packaging system that when the package is installed later, it should restore
the packaged configuration files. With
vim no longer installed on the system in any
way, create a fake
/etc/vim/vimrc and see what happens when you reinstall it:
hostname:~# mkdir /etc/vim
hostname:~# echo Testing > /etc/vim/vimrc
hostname:~# cat /etc/vim/vimrc
Testing
hostname:~# aptitude install vim
Reading Package Lists... Done
Building Dependency Tree
Reading extended state information... Done
The following NEW packages will be installed:
vim
0 packages upgraded, 1 newly installed, 0 to remove and 61 not upgraded.
Need to get 774kB of archives. After unpacking 1704kB will be used.
Writing extended state information... Done
Get:1 http://http.us.debian.org sid/main vim 1:6.2-426+1 [774kB]
Fetched 774kB in 11s (69.6kB/s)
Selecting previously deselected package vim.
(Reading database ... 17306 files and directories currently installed.)
Unpacking vim (from .../vim_1%3a6.2-426+1_i386.deb) ...
Setting up vim (6.2-426+1) ...
Configuration file `/etc/vim/vimrc’
==> File on system created by you or by a script.
==> File also in package provided by package maintainer.
What would you like to do about it ? Your options are:
Y or I : install the package maintainer’s version
N or O : keep your currently-installed version
D : show the differences between the versions
Z : background this process to examine the situation
The default action is to keep your current version.
*** vimrc (Y/I/N/O/D/Z) [default=N] ?
As you can see, it’s a somewhat ugly-looking prompt. It’s simple and gets the job
done, however. It tells us that there’s a configuration file of the same name in the
same directory in the package we’re installing, and that tells us which configuration
file it is talking about.
Your choices at this prompt are simple: Press the Y key and press Enter to have the
packaged configuration file overwrite your own. Press the N key if you know that the
file you have is good. You can press D to see the differences between the current file
and the new file; you’ll be returned to the prompt after you’ve finished reading the
differences. Lastly, if you choose the
Z option, you’re dropped into a shell where you
can manually poke about and perhaps merge the two configuration files by hand in a
text editor. When you exit the shell, you’re returned to the prompt.
09_576445 ch04.qxd 7/5/05 3:10 PM Page 93