Another cause for trouble is the download directory. PPM insists on downloading to /root. Downloads to /root, even temporary ones, eat into the personal storage space (e.g. remaining space on pupsave file) and may freeze the system. Direct downloads to a destination outside of Puppy, e.g. /mnt/home, would alleviate the problem.
The following solutions can solve both problems.
Solution 1
Extremely simple, keeps downloaded pets, prevents automatic installation, works even in very old Puppy versions
Necessary actions:
- Step 1: Open editor and create new document
Step 2: Add line dir_prefix = /mnt/home/downloads <= adapt path. No quotation marks!
Step 3: Save as /root/.wgetrc
Pushing the "Install" or the "Download-only" button in PPM will save packages directly to the defined directory.
PPM doesn't like that and responds with funny messages: "Error, failed to download XXX.pet", followed by an equally phony "Finished. The packages have been downloaded to /root". Ignore them. Tip: If you have a choice between an "Install" and a "Download-only" button, always push the "Install" button. This prevents the second message. In no case will packages be installed.
How it works
As many other programs, PPM "outsources" the downloading job to /usr/bin/wget, yet PPM blindly relies on wget's default behaviour. By default wget downloads to the current working directory, so PPM would set this directory with a "cd /root" command, and when it passes the package's URL to wget it would expect that wget saves the file to /root. PPM is not clever enough to check if the user has set a different default path in the .wgetrc config file and it also doesn't bother to add the target directory to the download parameters . When wget passes control back to PPM, PPM would search for the downloaded file in /root, can't find it and cries foul.
How to reset
Many options...
- Delete or rename .wgetrc
- Comment out the line (# dir_prefix = /mnt/home/downloads)
- If you feel nerdy, set it to default: dir_prefix = . (that's a single period, representing the current directory)
and of course you can scriptify any of those simple manual tasks
Solution 2
Some editing necessary, keeps PPM fully functional, works in all fairly new Puppies. Tested in Lucid 5.2.8
Necessary actions:
- Step 1: Open file /usr/local/petget/downloadpkgs.sh with an editor
Step 2: Find line cd /root and change to cd "/mnt/home" (or whatever download directory you prefer)
Step 3: Find lines- /usr/local/petget/verifypkg.sh /root/$DLPKG
else
/usr/local/petget/installpkg.sh /root/$DLPKG
- /usr/local/petget/verifypkg.sh $DLPKG
else
/usr/local/petget/installpkg.sh $DLPKG
<text><label>$(gettext 'Finished. The packages have been downloaded to') /root $(gettext 'directory.')</label></text>
Change to
<text><label>$(gettext 'Finished. The packages have been downloaded to') $PWD $(gettext 'directory.')</label></text>
- /usr/local/petget/verifypkg.sh /root/$DLPKG
Pushing the "Install" or the "Download-only" button in PPM will download packages directly to the defined directory. If the defined directory does not exist (unmounted, removed, misspelled etc.) the packages will be downloaded to /root. By default PPM will delete downloaded packages after installation. If you want to keep them, do this:
Optional actions (to prevent deletion of downloaded packages):
- Step 5: While still editing file downloadpkgs.sh find line
[ "$PASSEDPARAM" != "DOWNLOADONLY" ] && rm -f /root/$DLPKG 2>/dev/null
Comment it out by putting a # in front:
#[ "$PASSEDPARAM" != "DOWNLOADONLY" ] && rm -f /root/$DLPKG 2>/dev/null
Step 6: Save and close downloadpkgs.sh and open file /usr/local/petget/installpkg.sh
Step 7: Use the "Find" dialog of your editor and search for the string "rm -f $DLPKG"
Depending on PPM version this will find once or twice these 2 lines:- rm -f $DLPKG_BASE 2>/dev/null
rm -f $DLPKG_MAIN.tar.${EXT} 2>/dev/null
- #rm -f $DLPKG_BASE 2>/dev/null
#rm -f $DLPKG_MAIN.tar.${EXT} 2>/dev/null
- rm -f $DLPKG_BASE 2>/dev/null
After completing steps 1-7 you will have a PPM that
- Works as usual, but for downloads uses the path set in step 2
- Keeps the downloaded packages after install
- Handles inaccessible download directories gracefully, falls back to /root
Solution 3 (added 2014-12-17)
Here the pizza with everything. A pet with the features of solution 2. Does not work with Lucid, but should be OK with all recent Precise and Slacko variants. For users of Precise: The "Download-only" button is also inluded, so no need to apply a manual patch.
The pet is the result of following vivid discussions and put here for better accessibility.
Features:
- Option to keep or discard packages after installation
- Last selected download folder will be saved
- New folders will be created on-the-fly if they don't exist.
-----