Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Sat 20 Oct 2018, 12:47
All times are UTC - 4
 Forum index » Advanced Topics » Cutting edge
Pkg - CLI package manager
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [40 Posts]   Goto page: 1, 2, 3 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 19:52    Post subject:  Pkg - CLI package manager
Subject description: contribute here, or at https://gitlab.com/sc0ttj/Pkg
 

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/master/Pkg-master.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.


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
- combine packages and dependencies into SFS files
- convert packages between supported filetypes
- find out which package a file belongs to
- find out which repo a package belongs to
- compatible with Puppy Package Manager (petget)
- includes a console frontend (dialog) menu called Pkgdialog
- includes a GTK frontend (GTKdialog) called Gpkgdialog
- optional wrapper scripts that allow calling Pkg using various common apt-get or yum commands


Changelog

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:
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

* No good preview of file sizes given before install

* The `--ask` command makes Pkg ask to install EACH dep... It should only ask at start of `pkg get <pkgname>`

* The `pkg pkg-combine <pkgname>` and `pkg sfs-combine <pkgname>` commands don't account for post install stuff like /DEBIAN

* Gpkgdialog doesn't hide installed packages well enough

* Uninstall doesn't remove *.so files properly

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

* Many others.
pkg-yum-wrapper-0.1-noarch.pet
Description  Wrapper for Pkg, supports yum commands/API (fixed and re-uploaded)
pet

 Download 
Filename  pkg-yum-wrapper-0.1-noarch.pet 
Filesize  808 Bytes 
Downloaded  125 Time(s) 
pkg-apt-wrapper-0.1-noarch.pet
Description  Wrapper for Pkg, supports apt-get and apt-cache commands/API
pet

 Download 
Filename  pkg-apt-wrapper-0.1-noarch.pet 
Filesize  832 Bytes 
Downloaded  201 Time(s) 
pkg-1.9.20alpha-noarch.pet
Description  bug fixes for listing dependents, allow --ask and --force at end of cmd, other fixes
pet

 Download 
Filename  pkg-1.9.20alpha-noarch.pet 
Filesize  154.98 KB 
Downloaded  168 Time(s) 
pkg-1.9.19alpha-noarch.pet
Description  fixes in recursive dep checks, fixes for menu updating
pet

 Download 
Filename  pkg-1.9.19alpha-noarch.pet 
Filesize  154.56 KB 
Downloaded  141 Time(s) 
pkg-1.9.18alpha-noarch.pet
Description 
pet

 Download 
Filename  pkg-1.9.18alpha-noarch.pet 
Filesize  154.38 KB 
Downloaded  127 Time(s) 

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Sat 15 Sep 2018, 12:07; edited 23 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 19:52    Post subject:  

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:
pkgdialog
- ncurses dialog based frontend, works without X
Code:
Xpkgdialog
- Xdialog based frontend, requires X
Code:
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).

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Sun 25 Mar 2018, 14:58; edited 8 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 19:52    Post subject:  

Programming with package

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

Code:

# 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:
pkg -ld lib | pkg -ps -

(notice above, the dash as the final option!)



3. Uninstall VLC and all its listed dependencies
Code:
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:
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 -

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Sun 08 Apr 2018, 19:40; edited 7 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 19:53    Post subject:  

Example usage:

1. Setting up the repos

* See current repo:
Code:
pkg repo


* See available repos:
Code:
pkg repo-list


* Set a new repo:
Code:
pkg repo REPONAME



2. Searching for packages

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


* Search all repos (all fields) for 'vlc':
Code:
pkg search-all vlc


* Search current repo for package names matching 'gimp':
Code:
pkg names gimp


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



3. Checking packages

* View package info
Code:
pkg status gimp


* View its repo entry
Code:
pkg entry gimp


* View package contents
Code:
pkg contents gimp


* Get repo of package
Code:
pkg which-repo gimp


* List all dependencies of the package
Code:
pkg list-deps gimp


Find which package a file comes from:
Code:
pkg which /path/to/file


Find which packages need the 'libsdl' package:
Code:
pkg what-needs libsdl-mixer1.2



4. Adding/removing packages

Download and install 'gimp', and its dependencies
Code:
pkg get gimp


Download 'gimp' on its own
Code:
pkg download gimp


Install a local package file
Code:
pkg install /path/to/pkgfile


Download and install the deps of 'gimp'
Code:
pkg get-deps gimp



5. Build packages

Build 'galculator' from source (using a build script)
Code:
pkg build galculator


See all build scripts available
Code:
pkg build-list



6... and many, many more!

To see more examples, just run:

Code:
pkg examples

Code:
pkg usage

Code:
pkg help

Code:
pkg help-all


MORE EXAMPLE COMMANDS:
Code:

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

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Wed 14 Mar 2018, 21:44; edited 3 times in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 19:58    Post subject: Gpkgdialog screenshot  

Screenshots

Gpkgdialog (one of the GUIs):


_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Wed 14 Mar 2018, 20:35; edited 1 time in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 20:13    Post subject: How to add more repos  

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:
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 Smile

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Tue 01 May 2018, 12:18; edited 1 time in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 14 Mar 2018, 20:47    Post subject:  

Cool ideas with Pkg

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

This will enable dependency handling for local files! Smile

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 Cool



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!

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Thu 15 Mar 2018, 18:35    Post subject:  

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 Smile

I am gonna leave this at 1.9.19 for a while...

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Sun 25 Mar 2018, 14:50    Post subject:  

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.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Wed 28 Mar 2018, 17:10    Post subject:  

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:
# 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:
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/${DBIN_ARCH}/${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:
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.

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
battleshooter


Joined: 14 May 2008
Posts: 1381
Location: Australia

PostPosted: Wed 28 Mar 2018, 22:41    Post subject:  

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 Very Happy

_________________
LMMS 1.0.2, Ardour 3.5.389, Kdenlive 0.9.8
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Sat 31 Mar 2018, 13:23    Post subject:  

Thanks very much Smile 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:
# 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:
# 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:
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) Smile


2. Use `pkg --ask` by default, and remove --ask if the -y option was given to the apt wrappers

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search

Last edited by sc0ttman on Sun 01 Apr 2018, 07:15; edited 1 time in total
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2603
Location: UK

PostPosted: Sun 01 Apr 2018, 06:59    Post subject:  

Added a yum wrapper PET to main post.

Yum commands supported:

Code:
# 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 Smile

EDIT: Uploaded a fixed yum wrapper, the 2 people who downloaded should re-download Wink (sorry)

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
wiak

Joined: 11 Dec 2007
Posts: 957
Location: not Bulgaria

PostPosted: Mon 02 Apr 2018, 00:36    Post subject:  

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
Back to top
View user's profile Send private message 
666philb


Joined: 07 Feb 2010
Posts: 3200
Location: wales

PostPosted: Mon 02 Apr 2018, 06:41    Post subject:  

Hi sc0ttman,

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

i do have some requests Very Happy ....

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/woof-CE/commit/75df83233f5d92215c96a6fcf0081d9fd3b299ed

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

good work!!!

_________________
Tahrpup, built with trusty tahr packages http://murga-linux.com/puppy/viewtopic.php?t=96178
Xenialpup64, built with xenial xerus packages http://murga-linux.com/puppy/viewtopic.php?t=107331
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [40 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Cutting edge
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1031s ][ Queries: 12 (0.0064s) ][ GZIP on ]