LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 01-11-2009, 09:36 PM   #1
rvo
Member
 
Registered: Sep 2008
Location: Paraguay
Distribution: Slackware
Posts: 31

Rep: Reputation: 15
removepkg behavior


Hi, I'm trying to setup a small 12.2 server, with openssh, samba, sendmail, etc. I want a small system, with just the necessary tools to do the job (without X, java, ...)

I've installed all the programs in the a ap d l n and then after the first boot I've removed unnecessary packages with pkgtool.

The problem is that removepkg doesn't remove *all* files in a package, and seeing stales files on my system annoys me.

For example, I've removed hal -- but /etc/rc.d/rc.hald is still there. Why is that?

After a little debugging I have noticed that removepkg doesn't remove .new files -- what are those files? And how can I totally clean my system?

Here is the output of 'removepkg -warn hal | grep -i skipping':
Quote:
--> /etc/dbus-1/system.d/hal.conf.new no longer exists. Skipping.
--> /etc/rc.d/rc.hald.new no longer exists. Skipping.
Thank you.
 
Old 01-12-2009, 12:11 AM   #2
MS3FGX
Guru
 
Registered: Jan 2004
Location: NJ, USA
Distribution: Slackware, Debian
Posts: 5,852

Rep: Reputation: 351Reputation: 351Reputation: 351Reputation: 351
The .new files are used to prevent overwriting the existing configuration files (which the user presumably has customized in some way and doesn't want to lose). When you upgrade a package, any configuration files under /etc will be preserved, and the updated configuration file will be placed in the filesystem with the .new extension so you can review it and see if you want to use it or not.

In the case that there is no configuration file currently, the install script will then simply remove the .new extension. The problem is, the file appears as .new inside of the package itself. When removepkg goes through all the files installed and tries to remove them, it won't recognize the renamed files since they weren't in the original package.

To be perfectly honest, I am not sure why it is done this way. Logically it seems to make more sense that the install script would add the .new extension if it sees existing configuration files, rather than remove the extension if it doesn't. That way it would be less likely a stale file got left behind (though if you didn't do anything with the .new, that would still remain).

Perhaps somebody else knows why this is, I would be interested in hearing the rationale.

Last edited by MS3FGX; 01-12-2009 at 12:14 AM.
 
Old 01-12-2009, 01:12 AM   #3
rvo
Member
 
Registered: Sep 2008
Location: Paraguay
Distribution: Slackware
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks MS3FGX, now I know what those files are.

Quote:
Logically it seems to make more sense that the install script would add the .new extension if it sees existing configuration files, rather than remove the extension if it doesn't. That way it would be less likely a stale file got left behind (though if you didn't do anything with the .new, that would still remain).
I agree.

In the meanwhile I will have to remove the files by hand
 
Old 01-12-2009, 02:14 AM   #4
mRgOBLIN
Slackware Contributor
 
Registered: Jun 2002
Location: New Zealand
Distribution: Slackware
Posts: 999

Rep: Reputation: 227Reputation: 227Reputation: 227
you can use slackpkg for upgrading which will look for and help you to deal with the .new files as you install the packages. You can also look for these with `slackpkg new-config`.
 
Old 01-12-2009, 03:02 AM   #5
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,752

Rep: Reputation: 462Reputation: 462Reputation: 462Reputation: 462Reputation: 462
The install script is run *after* the package is already de-compressed on your system, so it can't rename the files at that point. Most packages which install a conf file under /etc use a small routine (the config() function) which handles the installation and ovweriting of conf files. The files are inside the package with the *.new suffix. when you first install the package and there is no conf file without the .new suffix, the config routine renames the file to drop the .new suffix. If you don't make any changes to the conf file and there are no changes to the conf file in a later version of the package, when you upgrade the package the *.new file will be discarded. But, if you have made any changes to the file or the file in the newer package is not the same as the old one, then the file with the .new suffix will be preserved and not overwrite the existing file.
Since the files comes in the packages with the .new suffix, removepkg will only remove them if they still have that suffix. This means that the files with the suffix do not get removed by removepkg.

This is all just a simple mechanism to avoid that the installation or upgrade of packages overwrites config file which you may have edited. Imagine how mad you'd be if you had worked some super-duper custom configs for a ceratin package and then your conf file got overwritten when you upgraded the package.

Another thing is, that the etc-.x.x.-noarch package which is on your system contains quite a few generic conf files for packages which may or may not be installed on your system. These conf files are nearly always very smal anyway, so it's not like you are wasting a bunch of space. There is one quite large conf file whcih gets installed and is not used by default -the /etc/termcap-BSD file is 690K. You can safely remove that and you will save more space thatn by removing all the small leftover ones from packages you have removed.

If, as you say, you simply want to eliminate *all* files which are unused, then you have quite a bit to do there in /etc -but you'll need to investigate them thoroughly to make sure you know what each one is for and whether or not it is being used.
 
Old 01-12-2009, 09:28 AM   #6
rvo
Member
 
Registered: Sep 2008
Location: Paraguay
Distribution: Slackware
Posts: 31

Original Poster
Rep: Reputation: 15
Thanks gnashley for a great answer. I can certainly live with the files laying around in /etc (which is about 10mb anyway), but it's just a little annoying :-)

Another "workaround" would be not to install the package in the first place, but that will make the installation a little more tedious.

And one more thing, I've always did a fresh install on every release, if I install my "minimal system" and if I upgrade to 13.0 in the future, can I just simple update the installed packages and do not install new packages? (with upgradepkg --install-new as noted in UPGRADE.TXT)
 
Old 01-12-2009, 04:58 PM   #7
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,441

Rep: Reputation: 70
Quote:
Originally Posted by rvo View Post
And one more thing, I've always did a fresh install on every release, if I install my "minimal system" and if I upgrade to 13.0 in the future, can I just simple update the installed packages and do not install new packages? (with upgradepkg --install-new as noted in UPGRADE.TXT)
Not likely. Sometimes "new" packages are even just older ones that got renamed in their update. Also, you might actually want some of the newer packages.

That being said, you won't have to install all of the newer packages and then go back to removing the ones you don't want. You will just have to pay a lot more attention to your upgrade process than others upgrading a full install. As you might already know, upgrading Slackware is never just simply updating the installed packages (see the HowTos in my signature).
 
Old 01-13-2009, 09:07 PM   #8
rvo
Member
 
Registered: Sep 2008
Location: Paraguay
Distribution: Slackware
Posts: 31

Original Poster
Rep: Reputation: 15
I see. I like Slackware too much to be upset about the update process and the files laying around in /etc, so I think I just have to live with it. One more question, if I install the a, ap, d, l, n series only, can I upgrade just that?
 
Old 01-15-2009, 03:19 PM   #9
shadowsnipes
Senior Member
 
Registered: Sep 2005
Distribution: Slackware
Posts: 1,441

Rep: Reputation: 70
If you have the Slackware sources mirrored (try Eric's mirror-slackware-current.sh tool - it works for more than just -current and you can select which folders to mirror) you could do something similar to this:

Code:
#!/bin/sh
    for dir in a ap d l n ; do
      ( cd $dir ; upgradepkg --install-new *.tgz )
    done
I believe slackpkg will let you upgrade only by series as well. I have not tried this, however.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
removepkg problem - cutoff folder names hellbillyJoker Slackware 5 01-11-2009 09:23 PM
Upgradet to 12, removepkg not working Tux-Slack Slackware 11 12-23-2007 11:18 AM
RemovePkg Recursively? Kenji Miyamoto Slackware 3 05-23-2005 08:33 AM
removepkg alternative props666999 Slackware 2 11-10-2004 12:10 AM
Package for 'installpkg,removepkg,makepkg," bongski55 Slackware 4 09-15-2003 07:00 AM


All times are GMT -5. The time now is 03:06 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration