LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
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-21-2018, 03:08 PM   #1
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
Upgradepkg, installpkg and system integrity


I was installing Alien Bob's .txz of Chromium this evening [thanks Eric] and I noticed that the install instructions were to use upgradepkg. Now, when I compile something from SlackBuilds.org I always use installpkg.

From what I can see here, installpkg does not uninstall an old package version [not really a problem for me since my Slack install is rather new] but upgradepkg is recommended in most cases, esp for new users. I suppose in the future I should always use it? I'm just confused as to why anyone would use installpkg and want two versions of a package on their system.

My second question relates to file integrity. I've noticed that slackpkg upgrade-all will check this for you. I run Debian on my main box and I think it operates in a similar way to sudo apt update - checking ingrity and seeing if there are any updates to installed official packages. To what extent is this a fair comparison?
 
Old 01-21-2018, 03:19 PM   #2
GazL
LQ Veteran
 
Registered: May 2008
Posts: 6,897

Rep: Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019Reputation: 5019
Quote:
Originally Posted by Lysander666 View Post
I'm just confused as to why anyone would use installpkg and want two versions of a package on their system.
It can be useful when updating kernel packages as one might want to have the two different versions installed in parallel until the switch to the new kernel is complete, but for most other packages the general consensus amongst slackers is to always use 'upgradepkg --install-new' rather than 'installpkg' regardless of whether you're updating or installing.
 
4 members found this post helpful.
Old 01-22-2018, 01:38 AM   #3
bassmadrigal
LQ Guru
 
Registered: Nov 2003
Location: West Jordan, UT, USA
Distribution: Slackware
Posts: 8,792

Rep: Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656Reputation: 6656
Quote:
Originally Posted by Lysander666 View Post
From what I can see here, installpkg does not uninstall an old package version [not really a problem for me since my Slack install is rather new] but upgradepkg is recommended in most cases, esp for new users. I suppose in the future I should always use it? I'm just confused as to why anyone would use installpkg and want two versions of a package on their system.
Simply put, installpkg will install a package regardless if there's already one installed by the same name. This can be beneficial in some instances (my main usage is to allow me to have multiple kernels installed at once). But the vast majority of packages don't work that way and if you use installpkg on a newer version than the one you have, it will overwrite most (sometimes all) of the files of the original package. Then you'll end up with multiple entries of that package in pkgtool, but in reality, you're only able to run one of them.

upgradepkg is a bit fancier. Obviously, it is designed to upgrade an older package with a newer package. It can also be used to downgrade packages (upgradepkg doesn't pay attention to the version other than to verify it's different -- you can kinda think of it as "replacepkg"). With upgradepkg, if it doesn't find an existing package with the same name, it will error out and won't install the package. That is when the --install-new option is handy. This basically tells upgradepkg to upgrade the package if it already exists on the system, but if it doesn't to go ahead and install it. You can also use upgradepkg's --reinstall flag to have it reinstall a package that has the same version and build number.

Personally, if I know a package is new, I'll run installpkg since it is less typing than upgradepkg --install-new, but if I'm unsure whether I've already installed that package, upgradepkg --install-new is used to ensure it will install either way.

Quote:
Originally Posted by Lysander666 View Post
My second question relates to file integrity. I've noticed that slackpkg upgrade-all will check this for you. I run Debian on my main box and I think it operates in a similar way to sudo apt update - checking ingrity and seeing if there are any updates to installed official packages. To what extent is this a fair comparison?
I'm not familiar with Debian's upgrade process, so I can't really provide a comparison... but slackpkg's upgrade-all (as well as install, install-new, reinstall, and any other option I might've forgotten that downloads a package) will verify the package's integrity using an asc file located on the server after you've imported the gpg key (by running slackpkg update-gpg when you first use that server). This should help ensure that slackpkg is installing an unmodified package.
 
5 members found this post helpful.
Old 01-22-2018, 03:06 AM   #4
enorbet
Senior Member
 
Registered: Jun 2003
Location: Virginia
Distribution: Slackware = Main OpSys
Posts: 4,784

Rep: Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434Reputation: 4434
Quote:
Originally Posted by Lysander666 View Post
My second question relates to file integrity. I've noticed that slackpkg upgrade-all will check this for you. I run Debian on my main box and I think it operates in a similar way to sudo apt update - checking ingrity and seeing if there are any updates to installed official packages. To what extent is this a fair comparison?
I'm actually not a fan of slackpkg and especially when used with upgrade-all but there are still considerable differences to apt upgrade-all, since that will rewrite one's bootloader if a new kernel is installed, but you said "apt update" and that seems to me very different. AFAIK "apt update" doesn't check integrity beyond checking version number matches with whatever "/etc/apt/sources.list" contains and it upgrades nothing unless followed by "install" or "upgrade".
 
Old 01-22-2018, 07:14 AM   #5
Lysander666
Senior Member
 
Registered: Apr 2017
Location: The Underearth
Distribution: Ubuntu, Debian, Slackware
Posts: 2,178

Original Poster
Blog Entries: 6

Rep: Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470Reputation: 2470
Quote:
Originally Posted by bassmadrigal View Post
<snip>
Yes, very helplful, bass. Looking at pkgs.org I can see the instruction is not solely upgradepkg but

Code:
upgradepkg --install-new chromium-63.0.3239.132-i586-1alien.txz
So I think this upgradepkg --install-new would be the safest bet in many cases.

When I was replacing lxsession x64 with lxsession x86 I used upgradepkg --reinstall, which worked perfectly.

So it seems like the options are

installpkg - installs another instance of a package
upgradepkg - upgrades or replaces currently installed packages [name, version, arch {not build}]
upgradepkg --install-new - installs new packages in addition to upgrading any existing ones - apparently this is the best all-round option
upgradepkg --reinstall - reinstalls all packages even if the same version already exists

http://man.docs.sk/8/upgradepkg.html

Yesterday I used upgradepkg --install-new --reinstall on a package just in case. It seemed to work. I don't know if that's a good habit though.

Quote:
Originally Posted by enorbet View Post
AFAIK "apt update" doesn't check integrity beyond checking version number matches with whatever "/etc/apt/sources.list" contains and it upgrades nothing unless followed by "install" or "upgrade".
You are correct, sudo apt update does not upgrade anything for you, it tells you what upgrades are available. You have to run sudo apt full-upgrade to do so, so there is a difference between sudo apt update and slackpkg upgrade-all.

Last edited by Lysander666; 01-22-2018 at 07:39 AM.
 
Old 01-22-2018, 10:42 AM   #6
orbea
Senior Member
 
Registered: Feb 2015
Distribution: Slackware64-current
Posts: 1,950

Rep: Reputation: Disabled
Quote:
Originally Posted by Lysander666 View Post
I'm just confused as to why anyone would use installpkg and want two versions of a package on their system.
Here is an example use case. The r8169 ethernet driver in the kernel does not work with my hardware so I use the r8168 driver that not included in the kernel. Since its a kernel driver it needs to be built against the specific kernel version in use, but since I have several kernels installed in case some do not work I need it installed for every kernel version. If I used 'upgradepkg' it would remove all the old r8168 packages which would break ethernet in my older kernels so I use 'installpkg' instead so that it only installs a new package without removing the old ones. The SlackBuild will append the kernel version where necessary so that it will never conflict with other r8168 packages. Lastly in the event that I remove an older kernel I can just use 'removepkg' to remove the corresponding r8168 package.

However most packages do not work like this and you do not want to install multiple versions of the same package which could break the program with conflicting files. In short if its installed already, you usually want 'upgradepkg' and if its not currently installed you want 'installpkg'. In the event you accidentally use 'installpkg' instead of 'upgradepkg' you could just remove the two conflicting packages and then reinstall the correct one.
 
1 members found this post helpful.
Old 01-22-2018, 04:33 PM   #7
upnort
Senior Member
 
Registered: Oct 2014
Distribution: Slackware
Posts: 1,893

Rep: Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161Reputation: 1161
apt upgrade always performs a full package replacement. There is no distinction like between installpkg and upgradepkg. One exception is apt upgrade will install new kernels through a configurable policy such that existing kernels are not replaced. A difference between Slackware and Debian with kernel updates is the apt method is automated. The apt kernel upgrade scripts generate a new initrd, adds the new kernel to GRUB, and the user ends up with multiple kernels as a fallback should the new kernel cause problems -- pretty much the same reason many Slackers use installpkg to install new kernels rather than upgradepkg or slackpkg.
 
1 members found this post helpful.
Old 01-26-2018, 01:29 AM   #8
bormant
Member
 
Registered: Jan 2008
Posts: 426

Rep: Reputation: 240Reputation: 240Reputation: 240
Lysander666,
Some words from Captain Obvious follows.

Slackware package file name has 4 fields separated by "-" counting right to left and .suffix about compression, for ex.:
some-package-name-version-arch-build_and_tag.txz
.txz -- package compressed with xz compressor (others are .tgz - gzip, tbz - bzip2, tlz - lzip);
build_and_tag -- build number and tag;
arch -- architecture, for ex. i686, i486, x86_64, ... and noarch
version -- package version
some-package-name -- the generic name of the package

Because fields delimited right to left and "-" used as delimiter, so only generic package name can use "-" inside.

When you install the package the package manager creates file
/var/log/packages/some-package-name-version-arch-build_and_tag
and writes package's install/doinst.sh into
/var/log/scripts/some-package-name-version-arch-build_and_tag

Now for chromium-63.0.3239.132-i586-1alien.txz:
generic name: chromium
version: 63.0.3239.132
architecture: i586
build_and_tag: 1alien

When you launch
upgradepkg chromium-63.0.3239.132-i586-1alien.txz
or
upgradepkg /path/to/chromium-63.0.3239.132-i586-1alien.txz
1) it checks full name without suffix in /var/log/packages:
/var/log/packages/chromium-63.0.3239.132-i586-1alien
if this file exists (the same package installed) then
..if --reinstall option is given then reinstall the package
..else says "The same package is installed" and exit
else (2)
2) it gets generic name from package name: chromium
3) it checks in /var/log/packages/ file with generic name "chromium"
if this file is not exists then
..if --install-new option is given then install the package
..else says "The package doesn't installed" end exit
else (another version of package installed) upgrade already installed version of chromium with another package chromium-63.0.3239.132-i586-1alien.txz.

Sincerely yours, C.O.

Last edited by bormant; 01-26-2018 at 05:19 AM.
 
2 members found this post helpful.
  


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



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Slackware Current - kernel_headers -- installpkg or upgradepkg kjhambrick Slackware 4 03-06-2016 06:15 PM
slackpkg installpkg upgradepkg not working very new to slackware lexish Slackware 5 11-05-2012 11:22 AM
Accidentally used installpkg instead of upgradepkg; any recourse? Gault LaRue Slackware 4 11-28-2009 11:43 PM
help intergrity check of installed rpms vinnie_vinodh Fedora 2 04-04-2009 12:22 PM
bzip2: i got twice data intergrity error kpachopoulos Linux - General 3 11-30-2005 09:52 PM

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

All times are GMT -5. The time now is 12: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