LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 03-17-2021, 05:18 PM   #1
coralfang
Member
 
Registered: Nov 2010
Location: Bristol, UK
Distribution: Slackware, FreeBSD
Posts: 836
Blog Entries: 3

Rep: Reputation: 297Reputation: 297Reputation: 297
slackpkg, download upgradeable packages without installing?


Hi. Is there a simple way to download any upgradable packages without installing them? (for example, when the system is in use, so that it can all be upgraded later offline).

There is this for downloading a package (or list of them)
Code:
slackpkg download <package name>
But ideally i would like to do it for the list of packages that pop up in the menu for:
Code:
slackpkg upgrade-all
My first thought was whether you could combine the two commands, but doesn't seem capable of doing that:
Code:
slackpkg upgrade-all download 

upgrade-all: Ignoring extra arguments: download
 
Old 03-17-2021, 05:34 PM   #2
slac
Member
 
Registered: May 2019
Posts: 265

Rep: Reputation: Disabled
Yes. You can download the Slackware Tree you need (download the packages) and then make slackpkg point to that local tree and apply upgrades or make custom ISO however you want to.

Just use rsync, ie:

rsync -aHhv --progress --stats --delete rsync://slackware.uk/slackware/slackware64-current/ /path-to-wherever-you-want-to-save-the-tree

... And execute that command every time you want to download new packages if there is any (check ChangeLog.txt). The --delete flag will delete previous versions of the packages so you only will have the newest packages but if you need to save the previous packages just remove that flag when executing the command.

After downloading the Slackware Tree, just tell slackpkg to apply upgrades from that local tree by modifying /etc/slackpkg/mirrors to point to the folder where you saved the tree to. Then normally do the routine whenever you want to: slackpkg upgrade gpg; update; install-new; upgrade-all; clean-system.
 
2 members found this post helpful.
Old 03-18-2021, 02:21 AM   #3
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware64-15.0
Posts: 6,377

Rep: Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757Reputation: 2757
An alternative solution is to create a custom 'cleanup' function for slackpkg to capture the contents of the $LIST variable created when 'slackpkg install-new' or 'slackpkg upgrade-all' are run.
So, in /usr/libexec/slackpkg/functions.d create a file xx_cleanup.sh containing:
Code:
No packages selected for download, exiting.

root@Eagle:~# cat /usr/libexec/slackpkg/functions.d/xx_cleanup.sh

#========================================================================
#
# PROGRAM FUNCTIONS
#

# Clean-up tmp and lock files
#
function cleanup() {
	local retval=0
	[ "$SPINNING" = "off" ] || tput cnorm
	if [ -e $TMPDIR/error.log ]; then
		retval=1
	        echo -e "         
\n==============================================================================
WARNING!        WARNING!        WARNING!        WARNING!        WARNING!
==============================================================================
One or more errors occurred while slackpkg was running:                       
"
		cat $TMPDIR/error.log
		echo -e "
=============================================================================="
	fi    
	echo
	if [ "$DELALL" = "on" ] && [ "$NAMEPKG" != "" ]; then
		rm $CACHEPATH/$NAMEPKG &>/dev/null
	fi		
	rm -f /var/lock/slackpkg.$$
# The next line captures the list from install-new or upgrade-all suitable for use by download
	echo "${LIST//.t[blxg]z}" > /tmp/mylist
	rm -rf $TMPDIR
	exit ${retval}
}
This file needs to be set executable with 'chmod +x /usr/libexec/slackpkg/functions.d/xx_cleanup.sh'.

With this in place you can run 'slackpkg upgrade-all' to see the list, then hit Cancel, so that slackpkg exits dropping the /tmp/mylist file.
To download the files,
Code:
slackpkg download $(tr '\n' ' ' < /tmp/mylist)
 
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
LXer: Raspberry Pi 4 Compatible Kit Offers Upgradeable Open Computer LXer Syndicated Linux News 0 12-09-2020 04:42 PM
[SOLVED] Upgradeable packages have vanished from Synaptic lucmove Linux - Software 8 10-08-2018 04:53 AM
is my galaxy 5 (i5503) getting/upgradeable to froyo 2.2?im in the Philippines. nicoteves Linux - Mobile 1 11-27-2010 01:05 AM
Which distros are easily upgradeable from version to version Jongi Linux - General 7 10-04-2008 10:54 AM
Is my CPU replaceable/upgradeable (not Linux-specific) nickj6282 General 2 05-08-2006 06:16 AM

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

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