Pkg - CLI package manager

Under development: PCMCIA, wireless, etc.
Post Reply
Message
Author
User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

Pkg - CLI package manager

#1 Post by sc0ttman »

Pkg - command line package manager

* Homepage: https://gitlab.com/sc0ttj/Pkg
* Issues: https://gitlab.com/sc0ttj/Pkg/issues
* Wiki: https://gitlab.com/sc0ttj/Pkg/wikis/home
* Project: https://gitlab.com/sc0ttj/Pkg/boards?=

Download latest: https://gitlab.com/sc0ttj/Pkg/-/archive ... ter.tar.gz
(extract then run 'installer.sh).

What is it?

A command line tool that can install, remove, update, compile packages.
A bit like apt-get but worse.

This lets you do advanced package management stuff without X.
All you need is a terminal.

Image


Dependencies

* Busybox (ash, wget, find, which, grep, sed, tar, du, sync, etc)
* coreutils (cp, mv, rm, wc, uniq, chmod, cut, cat, sort, etc)
* Puppy Package Manager (for `pkg repo-update` only)


Features:

- powerful command line interface, lots of options
- context-sensitive TAB completion of package, file, dir and repo names
- automatically find best matching packages or let the user choose
- search for packages in individual or all repos
- easily compile packages from source
- supports buildtools: petbuild, src2pkg, sbopkg, buildpet
- supports packages: .pet, tar.gz, .txz, .deb, .sfs, .rpm, more
- install/uninstall SFS files just like regular packages
- find out which package a file belongs to
- find out which repo a package belongs to
- combine packages and dependencies into SFS files
- convert packages between supported filetypes
- follows unix philosophy: you can pipe stuff to pkg like `echo "$foo" | pkg <command> -`
- compatible with Puppy Package Manager (petget)
- includes a console frontend (dialog) menu called Pkgdialog
- includes a Xdialog frontend menu called Xpkgdialog
- includes a GTK frontend (GTKdialog) called Gpkgdialog
- optional wrapper scripts that allow calling Pkg using various common apt-get or yum commands


Changelog

See Gitlab.com/sc0ttj/Pkg for latest info...

PET releases:

1.9.22
- lots and lots of fixes and improvements! (See commit history)

1.9.21
- ??? (dunno what happened there..)

1.9.20
- allow --ask and --force at end of pkg commands
- fix in listing pkg name only for liblzma5 (and others?)
- fixes in list_dependents() and pkg_uninstall()
- much faster to find dependants, prevents occasional (very) slow uninstalls
- exit if not root
- added post install fix for openclonk, updated 0ads
- update to `pkg show_config` output:
- show only installed fallback repos
- was previously showing all fallback repos, installed or not

1.9.19
- fixes in dep listing (should be very good now)
- fixes in updating menu

1.9.18
- fixes for Stretch and Xenial
- fixes in dep listing
- fixes for large pkg lists
- fixes for large *.files lists
- fixes for 'Argument list too long' errors
- many other fixes for non-slack pups


Help info:

Here are some of the command available:

Code: Select all

Usage: pkg [OPTION(S)] COMMAND SEARCH|PKGNAME|BUILDSCRIPT|FILE|-

OPTIONS:

These options can be used together and MUST precede all others:
  
 --ask|-a 			   ask before doing stuff (give as 1st option)
 --force |-f			 force downloading, installing and uninstalling
 --no-colour|-nc		disable ANSI colours in pkg output

COMMANDS:

The commands below can be used with the options above, but they can't be 
used with each other:
  
 get|g PKGNAME			    download & install matching package and deps
 download|d PKGNAME		  download a package from CURRENT repo
 install|i PKGNAME		   install a downloaded package
 update|pu [PKGNAME]		 update all matching installed packages

 deps|e PKGNAME			   install dependencies of matching package
 deps-download|ed          PKGNAME	only download dependencies, no install
 deps-check|ec			    prints message about missing dependencies 
 what-needs|wn PKGNAME     lists pkgs that depend on PKGNAME 

 uninstall|u PKGNAME		 uninstall a pet package
 delete|l PKGNAME		    delete a downloaded package
 clean [PKGNAME] 		    delete downloaded pkg files of installed pkgs
  
 list-downloaded|ld [PKG]  list downloaded packages, PKGNAME is a filter
 list-installed|li|LI [PKG] list installed packages, PKGNAME is a filter
 list-deps|le|LE PKGNAME   list the dependencies of PKGNAME

 build|pb PKG			     build a PET package from source and install it
 build-list|pbl [PKG]		list all build scripts, PKGNAME is optional 

 installed|pi PKG		     return true if package installed, false if not
 status|ps|PS PKG		     show package status (name, size, deps, etc)
 entry|pe PKG			      show package repo entry (if in current repo)
 contents|c PKG			    list the contents of a downloaded package
 which|w FILENAME		     find out which pkg FILENAME comes from
 which-repo|wr PKG	       find out which repo PKG comes from

 repack|pr PKG			     build a .pet package from an installed package
 pkg-combine|pc PKG		   build a new package containing PKGNAME + deps
 sfs-combine|sc PKG		   build a new SFS file containing PKGNAME + deps
 extract|unpack PKGFILE     extract package contents into folder

These commands cannot be used with any other options:
  
 names|n [PKG]			     list package name matches in the CURRENT repo
 names-all|na [PKG]		   list package name matches in ALL repos

 search|s [SEARCH]		    search all package info in CURRENT repo
 search-all|sa [SEARCH]     search all package info in ALL repos

 repo|r [REPONAME]		    set repo to use, show current repo if none given
 repo-info|ri REPONAME		display the name, and other info of CURRENT repo
 repo-list|rl			      list names of all available repositories 
 repo-update|ru [REPONAME]  update the current repo package list
 repo-convert|rc FILE		 convert repo files to pre/post Woof format

 add-source			        add new repo (needs repo file in ~/.packages/)
 update-sources			    update the list of available repos
 repo-pkg-scope one|all	  search pkgs in current repo (one), or all (all)
 repo-dep-scope one|all	  search deps in current repo (one), or all (all)
 bleeding-edge no|yes		 if yes, get latest pkg versions, from ANY repo
 recursive-dep-check no|yes get deps recursively (yes), or not (no)
  
 dir2pet DIR			      create a pet package from a directory
 dir2sfs DIR			      create an sfs package from a directory
 dir2tgz DIR			      create a tar.gz file from a directory
 deb2pet DEBFILE		     convert local deb file to a pet package
 pet2sfs PETFILE		     convert local pet file to an sfs package
 pet2tgz PETFILE		     convert local pet file to a tar.gz package
 pet2txz PETFILE		     convert local pet file to a tar.xz package
 sfs2pet SFSFILE		     convert local sfs file to a pet package
 tgz2pet TARFILE		     convert local tar.gz|tgz file to PET
 txz2pet TXZFILE		     convert local tar.xz|txz file to PET

 workdir			         set a new working directory. Default is ~/pkg/
 autoclean			       auto delete pkg files after download+install

 show-config		        show current config, repo and search settings
 func-list			       list all functions used in this program
 welcome			         print some useful cmds to help get started
 version|v			       show the version of this script

 examples|ex		        show example command line usage of pkg
 usage [CMD]		        show usage of CMD, or list available cmds
 help|h			          show this help information
 help-all|H			      show a full description, with added info

Known Issues

* dependency resolution can be slow

* No good preview of file sizes given before install

* Pkgdialog needs a re-write in places to make it faster after you chose multiple packages to install/remove/update/etc.

* others
Attachments
pkg-apt-wrapper-0.2-noarch.pet
added 'apt-add-repository' command
(1.19 KiB) Downloaded 355 times
pkg-1.9.22-noarch.pet
many, many fixes since last version
(160.41 KiB) Downloaded 995 times
pkg-yum-wrapper-0.1-noarch.pet
Wrapper for Pkg, supports yum commands/API (fixed and re-uploaded)
(808 Bytes) Downloaded 860 times
pkg-apt-wrapper-0.1-noarch.pet
Wrapper for Pkg, supports apt-get and apt-cache commands/API
(832 Bytes) Downloaded 1328 times
pkg-1.9.20alpha-noarch.pet
bug fixes for listing dependents, allow --ask and --force at end of cmd, other fixes
(154.98 KiB) Downloaded 850 times
pkg-1.9.19alpha-noarch.pet
fixes in recursive dep checks, fixes for menu updating
(154.56 KiB) Downloaded 807 times
pkg-1.9.18alpha-noarch.pet
(154.38 KiB) Downloaded 797 times
Last edited by sc0ttman on Tue 31 Dec 2019, 15:43, edited 31 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#2 Post by sc0ttman »

FAQ

** What Puppy versions does this support?

Tested as working in some of the latest 32-bit Puppies (Slacko 6.9.x, Stretch 7.5, Xenial 7.5)
Also tested in Slacko 5.9, Tahr 6.0.2.

On those pups, I was able to install the following packages without any major issues:

Kodi, Opera, Qupzilla, Gimp, VLC, FreeCiv, Nexuiz, Blender, PrBoom-Plus, Amarok, Apache2, Nginx, Nodejs, 0ad, TORCs, Alien Arena, Midori, many more...


** Why should I use this?

This might be useful to you if:
- you want an easy way to manage packages without X
- you want to programatically manage packages (write your own package installers/removers, etc)
- you want to remotely remaster/customise an ISO or SFS without booting it or manually hacking at the filesystem
- you want to make build script and easily compile re-producible PETs.
- you want to use SSH, Vagrant or similar to auto build a custom Puppy.
- you'd rather use a command line package manager than PetGet

** How is this different from PetGet?

- PetGet is a little faster and more reliable.
- PetGet can do things Pkg cant and vice versa.
- Pkg uses PetGet to update the repo files
- Pkg can compile packages from source, PetGet can't
- Pkg can convert PET to SFS, DEB to PET, etc
- Pkg can be used in your own scripts to automate stuff
- Pkg provides many ways of examining packages that PetGet doesn't
- PetGet basically doesn't work without X, except some very basic stuff
- Pkg has 3 GUIs, all of them are worse than PetGet
- It's easier to add new repos using Pkg


** Why won't TAB complete work for packages X, Y and Z?

Maybe the packages aren't in the current repo. Switch repo, or run `pkg which-repo <pkg-name>` to find out which repo the pkg is from.
Or, try running `pkg repo-pkg-scope all`. This will slow down TAB autocomplete, but will include all repos by default. To reset, do `pkg repo-pkg-scope one`.


** Do I have to type all those commands?

Not really. There are THREE different frontend UIs for Pkg. Type any of the following in the console to use them instead:

Code: Select all

pkgdialog
- ncurses dialog based frontend, works without X

Code: Select all

Xpkgdialog
- Xdialog based frontend, requires X

Code: Select all

Gpkgdialog
- GtkDialog based frontend, requires X


** Why can't I build packages?

You need the devx installed, and Pkg will auto-install petbuild for you.

Inside the RC file (/root/.pkg/pkgrc), you can change the BUILDTOOL variable:

Change BUILDTOOL to 'buildpet' to use that tool instead (it's very similar to petbuild, but older).
Change BUILDTOOL to 'sbopkg' to use that tool instead (sboPkg must be installed).
Change BUILDTOOL to 'src2pkg' to use that tool instead (src2pkg must be installed).
Last edited by sc0ttman on Sun 25 Mar 2018, 18:58, edited 8 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#3 Post by sc0ttman »

Programming with package

1. Use package in your own scripts. Here are some examples:

Code: Select all

# use pkg in your Xdialog/dialog/gtkdialog frontends :)

mypkgr(){
  # use pkg without colors, and without error output
  pkg --no-color --quiet "$@" 2>/dev/null
}
export mypkgr

pkg_one="supertuxkart"

# ... later on ...

mypkgr install $pkg_one >> /tmp/log &
Xdialog --tailbox "blah" /tmp/log

2. Another example, is using package in the terminal to do things quickly:

List all downloaded packages, get the packages starting with 'lib', then get the status of each of those:

Code: Select all

pkg -ld lib | pkg -ps -
(notice above, the dash as the final option!)



3. Uninstall VLC and all its listed dependencies

Code: Select all

pkg --force uninstall vlc_2.2.7 $(pkg list-deps vlc_2.2.7)


4. Passing a list of packages to Pkg is easy:

All of the below commands are equivalent, and return the same result (the status of each pkg given):

Code: Select all

pkg -PS geany vlc netsurf-3.3 avidemux	

pkg -PS geany,vlc,netsurf-3.3,avidemux	

pkg -PS "geany|vlc|netsurf-3.3|avidemux"	

echo geany vlc netsurf-3.3 avidemux | pkg -PS -	

echo "geany vlc-2.2.4-i686_s700 netsurf-3.3 avidemux" | pkg -PS -	

echo "geany,vlc,netsurf-3.3,avidemux" | pkg -PS -	

echo "geany|vlc|netsurf-3.3|avidemux" | pkg -PS -	

echo "geany-1.27
vlc-2
netsurf
avidemux" | pkg -PS -
Last edited by sc0ttman on Sun 08 Apr 2018, 23:40, edited 7 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#4 Post by sc0ttman »

Example usage:

1. Setting up the repos

* See current repo:

Code: Select all

pkg repo
* See available repos:

Code: Select all

pkg repo-list
* Set a new repo:

Code: Select all

pkg repo REPONAME

2. Searching for packages

* Search current repo (all fields) for 'media player':

Code: Select all

pkg search media player
* Search all repos (all fields) for 'vlc':

Code: Select all

pkg search-all vlc
* Search current repo for package names matching 'gimp':

Code: Select all

pkg names gimp
* Search all repos for package names matching 'moc':

Code: Select all

pkg names-all moc

3. Checking packages

* View package info

Code: Select all

pkg status gimp
* View its repo entry

Code: Select all

pkg entry gimp
* View package contents

Code: Select all

pkg contents gimp
* Get repo of package

Code: Select all

pkg which-repo gimp
* List all dependencies of the package

Code: Select all

pkg list-deps gimp
Find which package a file comes from:

Code: Select all

pkg which /path/to/file
Find which packages need the 'libsdl' package:

Code: Select all

pkg what-needs libsdl-mixer1.2

4. Adding/removing packages

Download and install 'gimp', and its dependencies

Code: Select all

pkg get gimp
Download 'gimp' on its own

Code: Select all

pkg download gimp
Install a local package file

Code: Select all

pkg install /path/to/pkgfile
Download and install the deps of 'gimp'

Code: Select all

pkg get-deps gimp

5. Build packages

Build 'galculator' from source (using a build script)

Code: Select all

pkg build galculator
See all build scripts available

Code: Select all

pkg build-list

6... and many, many more!

To see more examples, just run:

Code: Select all

pkg examples

Code: Select all

pkg usage

Code: Select all

pkg help

Code: Select all

pkg help-all
MORE EXAMPLE COMMANDS:

Code: Select all

pkg  # get a first run menu

pkg update-sources # setup your lit of avail repos

pkg repo-list # list all available repos

pkg repo REPONAME # switch to chosen repo

pkg n PKGNAME # search pkg names in current repo for PKGNAME (can also use `pkg --names` )

pkg na PKGNAME # search pkg names in ALL repos for pkgname (can also use `pkg --names-all`)

pkg s SEARCH # search all fields of repo

pkg sa SEARCH # search all fields of all repos

pkg ps PKGNAME # get pkg info (can also use `pkg --pkg-status`)

pkg PS PKGNAME # get extra info (which deps are installed/missing)

pkg g vlc # get (download+install) vlc and its deps (--get)

pkg d vlc # download vlc only (--download)

pkg i vlc-2.3.3-i586_s700  # install the vlc you downloaded (--install)

pkg e vlc  # get (download and install) only the deps of vlc (not vlc itself) (--deps)

pkg li # list user installed pkgs (--list-installed)

pkg ld # list downloaded pkgs (pkgs in $WORKDIR, which is ~/pkg/ by default)  (--list-downloaded)

pkg u PKGNAME # uninstall pkg  (--uninstall)

pkg c PKGNAME # list contents of PKGNAME (--contents) .. must be installed/downloaded/builtin to get contents

pkg w comm # find out which pkg the 'comm' cmd comes from (--which)

pkg w /path/to/file # find out which pkf that file comes from (--which)

pkg wr gimp-2 # find out which repo has gimp-2.*  (--which-repo)

# .. and with devx installed

pkg pbl # list all available package build scripts (can also use --pkg-build-list)

pkg pb PKGNAME # compile and package up a PET of PKGNAME (can also use --pkg-build) 


## more examples


pkg s SEARCH			  # list pkgs in current repo matching SEARCH

pkg sa SEARCH			# list pkgs in all repos matching SEARCH

pkg n SEARCH			  # search name only, list all matching pkgs

pkg g filezilla		# get & install filezilla and deps

pkg -a g filezilla	# ask to download filezilla and its deps

pkg -a la			    # ask to delete all downloaded packages

pkg -a e PKGNAME		# install deps of PKGNAME, ask each time

pkg go filezilla		# download filezilla & deps, don't install

pkg e PKGNAME			# install all deps of PKGNAME, dont ask

pkg d qupzilla-1.3.1		# download qupzilla-1.3.1 no questions

pkg l qupzilla-1.3.1		# delete the downloaded qupzilla-1.3.1

pkg pb jwm			# compile, build & install the 'jwm' package

pkg la				# delete all downloaded packages without asking!

pkg li vim | pkg -ps -		# Get info on all installed Vim pkgs

pkg li vim | pkg -wr -		# Get repo of an installed Vim pkg 

pkg li | pkg -a u -		  # Ask to uninstall installed pkgs one by one 

pkg dir2pet /path/to/dir/	# convert a local dir to a .pet package

pkg dir2sfs /path/to/dir/	# convert a local dir to a .sfs package

pkg i /path/to/file.pet	  # install PET, include the extension!

pkg tgz2pet /path/to/file	# convert a local .tar.gz file to PET

pkg unpack /path/to/file	  # extract the given pkg file contents
Last edited by sc0ttman on Thu 15 Mar 2018, 01:44, edited 3 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

Gpkgdialog screenshot

#5 Post by sc0ttman »

Screenshots

Gpkgdialog (one of the GUIs):

Image
Last edited by sc0ttman on Thu 15 Mar 2018, 00:35, edited 1 time in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

How to add more repos

#6 Post by sc0ttman »

To add more repos:

Put a valid puppy format repo file in ~/.packages/

Then open ~/.pkg/sources-all.

Look at the existing repo entries, then copy, paste & edit the existing entries as needed.

Then do `pkg --update-sources`

EXAMPLE REPO ENTRY in ~/.pkg/sources-all:

Code: Select all

puppy-tahr|pet|Packages-puppy-tahr-official|http://distro.ibiblio.org/puppylinux/pet_packages-tahr/||||noarch common trusty-main trusty-universe akita wary51x quirky
The format is

#repo_name|pkg_ext|repo_file|ur1lurl2|url3|url4|fallbacks

- The url1 field is required, other URL fields are optional mirrors..
- 'fallbacks' is the list of repo names (field 1) of other repos to fall back to

....Viola!

Run `pkg rl` (or `pkg repo-list`) to see your new repo in the list.

Run `pkg repo <your-repo>` to switch to your new repo :)
Last edited by sc0ttman on Tue 01 May 2018, 16:18, edited 1 time in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#7 Post by sc0ttman »

Cool ideas with Pkg

Change the default PET handler in ROX to `gpkgdialog` instead of `petget`.

This will enable dependency handling for local files! :)

HOW?

Change the word 'petget' to 'gpkgdialog' in /root/Choices/MIME-types/application_pet

After this change, you can click on PETs in ROX and a popup will appear asking you to install the PET, but it will ALSO list other options and can install dependencies, if needed 8)

Image

In image above, I clicked on the local PET file, and Gpkgdialog will handle the install :wink: ....

After the puptv PET is installed, so are all the deps!
Image
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#8 Post by sc0ttman »

Updated to 1.9.19

* better dep checking (goes 4 levels deep, better filtering out of builtin/devx/uneeded pkgs)
* fixes in updating the menu
* fixes resolving deps for 'quake2' in Stretch (includes python3.5-minimal)
* fixes resolving deps for 'freeciv in Stretch (no useless icon pkgs)

I tested this further by installing Flightgear, Wesnoth, Nexuiz, Kodi, Gimp and Snappy in Xenial 7.5...
All installed fine :)

I am gonna leave this at 1.9.19 for a while...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#9 Post by sc0ttman »

Updated to 1.9.20

* allow --ask and --force at end of pkg commands (`pkg get vlc --ask` now valid)
* fix in listing pkg name only for liblzma5 (and others?)
* fixes in list_dependents() and pkg_uninstall():
- much faster to find dependants, prevents occasional (very) slow uninstalls
* exit if not root
* added post install fix for openclonk, updated 0ads
* update to `pkg show_config` output:
- show only installed fallback repos
- was previously showing all fallback repos, installed or not

Download in first post.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#10 Post by sc0ttman »

Adding a new repo

If people use this in Artful or some other pup, but Pkg doesn't have the repos listed, I would appreciate if users could help me support those repo too..

If anyone could create repo entries for Artful etc (see tahr example a few posts above) that would be great...

To make Pkg support more repos:

1. Put your repo file in /root/.packages/ (if not there already)

2. Add your repo entry to /root/.pkg/sources-all and run `pkg --update-sources` ...

Or .... just run this command:

Code: Select all

# pkg --add-source 'RepoName|PkgExt|RepoFile|URL1|URL2|URL3|URL4|FallbackList'
Usage:

pkg --add-source 'RepoName|PkgExt|RepoFile|URL1|URL2|URL3|URL4|FallbackList'

- Name: the name of the repo.
- PkgExt: the file extension of the packages in the repo.
- RepoFile: the repo database file, must be in /root/.packages/[your-repo-file]
- URL1-4: the repo URLs, only URL1 is required.
- FallbackList: the order in which other repos are to be searched.

Here is an example:

Code: Select all

pkg --add-source 'slacko14.2|pet|Packages-puppy-slacko14.2-official|http://distro.ibiblio.org/puppylinux/pet_packages-slacko14.2/|http://ftp.nluug.nl/os/Linux/distr/puppylinux/pet_packages-slacko14.2/|||slackware14.2 slackware14.2-extra noarch common'
For some repos, you may need to replace one or more values in the URLs
with some (or all) the following variables:

For example, this URL:
http://ftp.site.org/slackware/i486/14.2/

Should become:
http://ftp.site.org/slackware/[b]${DBIN_ARCH}[/b]/${DISTRO_COMPAT_VERSION}/

If you're unsure, look at some existing sources and copy them.

After adding your new repo source, run this command to make your
new repo available:

Code: Select all

pkg --update-sources
To see all your AVAILABLE 'sources', open the file '/root/.pkg/sources'
in a text editor, or use 'cat /root/.pkg/sources' in a console.

To see all SUPPORTED 'sources', open '/root/.pkg/sources-all' in a
text editor, or use 'cat /root/.pkg/sources-all' in a console.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
battleshooter
Posts: 1378
Joined: Wed 14 May 2008, 05:10
Location: Australia

#11 Post by battleshooter »

Oh wow, this is so awesome Scott! Nice work man. I was just looking to install pkg for the features I've grown accustom to like installing from the command line or forcing a pet to install, but I see you've added a bunch of new awesome features too!

Really looking forward to exploring the new guis (and other features) you've added :D
[url=http://www.murga-linux.com/puppy/viewtopic.php?t=94580]LMMS 1.0.2[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94593]Ardour 3.5.389[/url], [url=http://www.murga-linux.com/puppy/viewtopic.php?t=94629]Kdenlive 0.9.8[/url]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#12 Post by sc0ttman »

Thanks very much :) Hope it works OK!

...

Faking Apt-get with Pkg:

Many Ubuntu and Debian users will be familiar with using apt-get and apt-cache.

So, I just added a new PET to the first post, pkg-apt-get-wrapper-0.1-noarch.pet

After installing this PET, you can use the following apt-get commands:

Code: Select all

# install a pkg (if given, -f must be at the end!)
apt-get install <pkg-name> [-f]

# uninstall a pkg
apt-get remove <pkg-name>

# update your repos and pkg lists
apt-get upgrade

# update a pkg to latest version available in the repo(s)
apt-get update <pkg-name>

# check a pkg for missing deps
apt-get check <pkg-name>

# deletes .deb/.pet/etc files of pkg already installed
apt-get clean

Also some apt-cache commands as well:

Code: Select all

# search repos (all fields)
apt-cache search <search term>

# search pkg names
apt-cache pkgnames <pkg-name>

# get pkg info and status
apt-cache showpkg <pkg-name>

# see which other pkgs need <pkg-name>
apt-cache rdepends <pkg-name>

# see the dependencies of give npkg
apt-cache depends <pkg-name>

# show stats about current repo/settings/etc
apt-cache stats

# auto delete pkg files (debs/pets,etc) after successful installation (or not)
apt-cache autoclean [yes|no]

These commands will call Pkg in the background...


Why do this?

You can now copy and paste commands from Ubuntu and Debian forums and many websites, to easily install packages and follow the commands..

Further improvements:

1. Support the following command in an add-apt-repository wrapper:

Code: Select all

add-apt-repository ppa:[USERNAME]/[REPOSITORY NAME]
This would make it possible to convert the huge number of PPA repos available online into Pkg (and Puppy) compatible repos...

Then we could add those repos as usual, with `pkg --add-source <repo-db-entry>` (or whatever apt-* commands we can fake) :)


2. Use `pkg --ask` by default, and remove --ask if the -y option was given to the apt wrappers
Last edited by sc0ttman on Sun 01 Apr 2018, 11:15, edited 1 time in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#13 Post by sc0ttman »

Added a yum wrapper PET to main post.

Yum commands supported:

Code: Select all

# install a pkg  (-y must be at the end!)
yum install <pkgname> [-y]

# uninstall a pkg
yum remove <pkgname>

# update a pkg
yum update <pkgname>

# check which pkgs can be udpdated
yum check-update

# see which pkg provides <file>
yum provides <path-to-file>

# search all fields in all repos for <term>
yum search <search-term>

# list installed pkgs
yum list installed

# list all pkg names matching <pkgname>
yum list <pkgname>

# print pkg info
yum info <pkgname>

# list supported repos
yum repolist

# get full pkg name of pkg/dep (from partial name)
yum resolvedep <depname>

# clean installed pkg files
yum clean all

Users who install these apt and yum wrappers should be able to copy and paste many apt-get, apt-cache or yum commands online into their terminal and install stuff easily.

These wrappers are just toys, and buggy, but give an idea as to how easy it is to use Pkg as a backend to your own scripts :)

EDIT: Uploaded a fixed yum wrapper, the 2 people who downloaded should re-download ;) (sorry)
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#14 Post by wiak »

The apt and yum lookalike-frontends look great sc0ttman. Commandline package manager facilities like this is what will keep Puppy alive for many years to come (I'd say it is essential). Woof-CE itself is basically, currently, a build system whose useful purpose, it seems to me, is to provide a basic 'recipe' so that when new version of say Debian, or Ubuntu, or Slackware come around, it is much less work than the old days, for a developer to build a new Puppy iso (since just copy old recipe and tweak it a bit as required for new version). Once the new iso is produced, however, for the new flavour, personally I feel that (in current form) woof-CE has done its bit and tinkering with the new iso is a matter of re-mastering to produce 'flavours', which is the same as it always was.

I've been recently asked to add features to my makepup script (basically to make it more like mklive-Stretch of DDogs, but truth is debootstrap from Debian is a commandline build system, which woof-CE isn't, so the purpose is different and the frontend is for that different purpose.

It would be nice to see a new Puppy build system that works like debootstrap - then it would be easy for anyone to design/make/build their own isos with whatever desktop environments they want - but I really don't see the current woof-CE as being that kind of build system - it is for new one of creations and remastering is then expected in order to modify the new Puppy. Truth is, only one published iso is sufficient - then people can remaster after that. However, a powerful package manager, such as yours is the key to easy and reliable modification prior to remastering; having said that, it could I suppose be built into woof-CE build stages (allowing the mods to be made as part of woof-CE iso creation - then woof-CE would become more flexible and powerful, and then makepup could have buttons etc added to benefit from that addition.

So even if woof-CE is never re-written to become like a debootstrap for Puppy, the current one-off woof-CE build script system could become very powerful should it have a reliable dependency-resolving package manager built in for last stages of its iso production. Hoping that will happen one day, and I'd mod makepup to use such new facilities (or some other frontend could be supplied in woof-CE itself, which would be a better approach really, since easier to maintain and easier to code since woof-CE could be purposely made to work with it)..

Keep up the good work and I hope you are dabbling into woof-CE itself to see if you can integrate your package manager capabilities directly in there too.

wiak

User avatar
666philb
Posts: 3615
Joined: Sun 07 Feb 2010, 12:27
Location: wales ... by the sea

#15 Post by 666philb »

Hi sc0ttman,

I've been having a play and this is really amazing!

i do have some requests :D ....

the PPM appends installed packages to the end of /root/.packages/user-installed-packages where as pkg sorts 'user-installed-packages' into alphabetical order. Appending makes it easier to uninstall a group of packages & deps you don't want, as they will be grouped together in the list.

pkg contains it's own 'postinstall_hacks' where as it might be better to call the one in /usr/local/petget as some of the fixes are distro dependent

having successfully used pkg to install kodi & vlc i decided to give it something a bit more challenging 'kubuntu-full'. this actually works when installed from the PPM in bionic but failed with pkg. the PPM installs 380 packages were as pkg only pulls in 316 so it needs to go a bit deeper in grabbing dependencies.
mavrothal recently updated the PPM to search deeper https://github.com/puppylinux-woof-CE/w ... 9fd3b299ed

i like to add this to xenialpup if the user-installed-packages order can be sorted out.

good work!!!
Bionicpup64 built with bionic beaver packages http://murga-linux.com/puppy/viewtopic.php?t=114311
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#16 Post by sc0ttman »

I have moved Pkg to GitLab, people can contribute fixes here or there.

Thanks for the feedback ppl.. I have logged these issues on GitLab.

Issues: https://gitlab.com/sc0ttj/Pkg/issues


wiak:

As for better Woof integration, I think Pkg is a little rough around the edges yet, but yes, it's still my plan ;)

I have a fork of Woof locally, which I once customised a bit.. Can't remember what, but I will go back to it, keep at it, and hopefully re-write Woof to give it a CLI .. Then a dialog/ncurses frontend like buildroot, which uses Pkg/Pkgdialog as a backend ...

When I get time.... :roll:

EDIT: See example UI, with screenshot here: http://murga-linux.com/puppy/viewtopic. ... 466#987466


666philb:

Agreed on most points, have logged the issues in GitLab.. Would rather not rely on /usr/local/petget/postinstallhacks though, I want to remove Pkgs dependencies on PetGet where possible.

In fact, that just reminded me to log an Issue about updating the repos - Pkg currently calls /usr/local/petget/0setup to update the repos...
Last edited by sc0ttman on Mon 02 Apr 2018, 19:34, edited 5 times in total.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#17 Post by sc0ttman »

Bugger... Can't do GitHub.. Will move to GitLab.... EDIT: Done.
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#18 Post by wiak »

sc0ttman wrote:
EDIT: See example UI, with screenshot here: http://murga-linux.com/puppy/viewtopic. ... 466#987466
Yeah, that looks good - if all that will be incorporated in a new woof-CE that would be a big change in the Puppy world. A lot of work to implement all that functionality though - or have you made a start on that?

wiak

wiak
Posts: 2040
Joined: Tue 11 Dec 2007, 05:12
Location: not Bulgaria

#19 Post by wiak »

sc0ttman wrote:
EDIT: See example UI, with screenshot here: http://murga-linux.com/puppy/viewtopic. ... 466#987466
Yeah, that looks good - if all that will be incorporated in a new woof-CE that would be a big change in the Puppy world. A lot of work to implement all that functionality though - or have you made a start on that?

wiak

User avatar
sc0ttman
Posts: 2812
Joined: Wed 16 Sep 2009, 05:44
Location: UK

#20 Post by sc0ttman »

It's just a demo, but I wanted something (slightly) concrete that represents the end goal ...
[b][url=https://bit.ly/2KjtxoD]Pkg[/url], [url=https://bit.ly/2U6dzxV]mdsh[/url], [url=https://bit.ly/2G49OE8]Woofy[/url], [url=http://goo.gl/bzBU1]Akita[/url], [url=http://goo.gl/SO5ug]VLC-GTK[/url], [url=https://tiny.cc/c2hnfz]Search[/url][/b]

Post Reply