LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 08-18-2006, 11:09 PM   #1
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Reinstalling Packages


I'm looking at the man page for the upgradepkg command and I notice the --reinstall option. I never have used that option. Sounds like that option allows a person to reinstall all currently installed packages. If I'm surmising and guessing correctly, this option instructs the upgradepkg command to look at the /var/log/packages list and then reinstall only those packages.

1. Do I understand this --reinstall option correctly?

2. If yes, does the reinstall overwrite all files in the package or is the script "intelligent" and overwrites files only if different?

Thanks.
 
Old 08-19-2006, 12:46 AM   #2
zhangmaike
Member
 
Registered: Oct 2004
Distribution: Slackware
Posts: 376

Rep: Reputation: 31
No.

From the man page:
Code:
--reinstall
       Upgradepkg usually skips packages  if  the  exact  same  package
       (matching  name,  version,  arch,  and  build number) is already
       installed on the system.  Use the --reinstall option if you want
       to  upgrade  all  packages  even  if the same version is already
       installed.
When download a package, and you tell upgradepkg to upgrade the currently installed package with the newly downloaded one, it checks the version number and skips the upgrade if they're the same.

--reinstall forces upgradepkg to upgrade regardless.

As for your second question, here's another excerpt from the manpage:
Code:
DESCRIPTION
       upgradepkg upgrades a Slackware .tgz package from an older version to a
       newer one.  It does this by INSTALLING the new package onto the system,
       and then REMOVING any files from the old package that aren't in the new
       package. ...
 
Old 08-19-2006, 06:16 PM   #3
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Original Poster
Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
The snippet from the man page partially affirms what I posted in my question. That is, upgradepkg will not update an existing package unless forced with the --reinstall option. That much I knew from personal experience. The upgradpkg command won't do anything without the --reinstall option if a package is reported as being installed in the /var/log/packages list.

A day after posting my question I realize I was trying to think globally about this option. That is, using that option applies only to each package as the package is updated. I got confused because in a basic update of Slackware, one uses the upgradepkg */*.tgz option to update the packages.

Realizing this now helped me answer my first question. That is, when I want to reinstall several packages, using the upgradepkg */*.tgz option won't install new packages unless the --install-new option is used. These are two different issues.

My second question was whether using the --reinstall option will cause upgradepkg to overwrite existing files.

After I posted I recalled that the pkgtool commands are scripts. Wonderfully written, but still scripts. So I browsed the upgradpkg script hoping for some clues. I can write basic scripts, but nothing as involved as these package tool scripts. Nonetheless, I was able to discover two things:

1. When using the --reinstall option upgradepkg calls the installpkg tool.
2. installpkg uses tar to unpack the tgz files and install.

Essentially then, running upgradpkg --reinstall is the same as merely running installpkg.

I looked at the tar options used in the installpkg script: tar -xzlUpvf.

The x option is to extract the files.
The z option is to extract through the gzip utility.
The l option is to stay in the local file system (unsure what this accomplishes)
The p option is to preserve file permissions.
The v option is for verbose mode.
The f option means use the archived file.

I'm no tar or script expert, but after reviewing these options I am inclined to think that when using the --reinstall option, or simply running installpkg, that files are overwritten. There is no update option being used when extracting the files from the tgz package. I'd appreciate confirmation from somebody more knowledgeable about these packages.

Thanks.
 
  


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
how to save a list of installed packages and install these packages later mandavi Ubuntu 5 09-07-2009 12:36 PM
Reinstalling Debian Packages Neko|Con Debian 5 10-25-2005 12:35 PM
Mandrake Update/Install Packages/Remove Packages wslyhbb Mandriva 2 03-15-2004 10:43 AM
Reinstalling Lilo using Knoppix CD without reinstalling Knoppix? squall14716 Linux - General 10 11-02-2003 10:46 AM
creating packages (.tgz/.deb/.rpm) How from the source packages? l_9_l Linux - General 1 03-06-2002 07:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:57 AM.

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