SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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
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.
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".
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
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
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.
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.