Pkg-Cli 'Apt-get' like Package Manager for Puppys

Moderator: Forum moderators

Post Reply
User avatar
mikeslr
Posts: 2791
Joined: Mon Jul 13, 2020 11:08 pm
Has thanked: 173 times
Been thanked: 837 times

Pkg-Cli 'Apt-get' like Package Manager for Puppys

Post by mikeslr »

@ rockedge, wasn't sure if this should be here or under Utilities or somewhere else. Feel free to move it.

Pkg-cli package manager was developed by sc0ttman and published on the 'old-forum'. https://oldforum.puppylinux.com/viewtop ... cf#p985531

Pkg-cli package manager has been built into some of the newer Puppys. If it's not in yours, you can obtain and deploy it from the above post. AFAICT, it's is 'no-arch': will run under any Puppy, both 64-and-32 bit. See this post about 'How to install it", viewtopic.php?t=717

In operating it functions similar to apt-get: "A command line tool that can install, remove, update, compile packages." Unlike Puppy Package Manager, it is also easy to add sources of applications other than those your Puppy was constructed to access.
For those of us not familiar with apt-get and reluctant to learn terminal commands and syntax, it provides two GUI's and an extensive help file when using the terminal. The above linked thread is very informative.

User avatar
rockedge
Site Admin
Posts: 5714
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1994 times
Been thanked: 2097 times
Contact:

Re: Pkg-Cli 'Apt-get' like Package Manager for Puppys

Post by rockedge »

Pkg is a powerful tool built in most Puppy distros after Xenial. Nice thing is I think if installed on Xenial it still will work fine.

Here are 2 example scripts using Pkg to install a web server and Zoneminder on upup32, Bionic64, Fosspup64 to exemplify what using pkg-cli looks like on a complicated package installation.
01-install-maria.sh

Code: Select all

#!/bin/sh
# 01-install-maria.sh
#

# create the user for the mysql server
adduser mysql -D

#update repos
pkg repo-update

# install the mysql server and intialize it
pkg add mariadb mariadb-server

# create run time directories and set the correct permissions and ownership
[ ! -d  /var/run/mysqld ]  && mkdir /var/run/mysqld
[ ! -d  /var/run/mysqld ]  && mkdir /var/log/mysql
chown -R mysql /var/run/mysqld
chown -R mysql /var/log/mysql
mysql_install_db
sleep 2
mysqld  &
sleep 2
 
 echo "Make sure that NOBODY can access the server without a password"
 
# Make sure that NOBODY can access the server without a password
#mysql -e "UPDATE mysql.user SET Password = PASSWORD('admin') WHERE User = 'root'"
mysql -e "ALTER USER 'root'@'localhost' IDENTIFIED BY 'admin'"

# Kill the anonymous users
mysql -e "DROP USER ''@'localhost'"

# Because our hostname varies we'll use some Bash magic here.
mysql -e "DROP USER ''@'$(hostname)'"

# Make our changes take effect
mysql -e "FLUSH PRIVILEGES"

echo "Finished stage 1. mariadb is installed"
01-install-maria.sh.gz
(962 Bytes) Downloaded 79 times
02-install-zm.sh.gz
(76.45 KiB) Downloaded 67 times
User avatar
rockedge
Site Admin
Posts: 5714
Joined: Mon Dec 02, 2019 1:38 am
Location: Connecticut,U.S.A.
Has thanked: 1994 times
Been thanked: 2097 times
Contact:

Re: Pkg-Cli 'Apt-get' like Package Manager for Puppys

Post by rockedge »

@mikeslr I am going to make more of an effort documenting here more examples of using pkg

As an exercise to create and SFS file from a downloaded package, here is a simple example:
using the basic default values for the repos.

Code: Select all

cd ~/pkg
pkg go screeny
pkg extract screeny-0.7-noarch.pet
pkg dir2sfs screeny-0.7-noarch
Screenshot.jpg
Screenshot.jpg (44.85 KiB) Viewed 1457 times
  1. enter the ~/pkg directory

  2. pkg goes and gets the screeny package and downloads it to ~/pkg

  3. pkg extracts the screeny package

  4. pkg creates and SFS package from the extracted screeny directory

backi
Posts: 589
Joined: Thu Jul 23, 2020 2:28 pm
Has thanked: 71 times
Been thanked: 65 times

Re: Pkg-Cli 'Apt-get' like Package Manager for Puppys

Post by backi »

Hi @rockedge .Hi Guys !

Maybe it is helpful....maybe i repeat myself viewtopic.php?p=64599#p64599
........:

@mikeslr wrote (among other) here viewtopic.php?p=64599#p64599

5) I suggest adding two other: (5) Create SFS from packages and dependencies, and (6) Create AppImage from packages and dependencies.

Just want to mention here (in case there is no wider awareness about those mostly unrecognized cool/nifty little Tools/Apps/Guis for creating sfs (squashfs) Modules and portable-AppImages automatically ,that can be found in @fredx181 Ubuntu and Debian Dogs.

One is called "AptToSfs" the other is "Sfs-Portable" (for creating portable Sfs (Squashfs) Modules/Programs/Apps.

"AptToSfs" works with Synaptic/Apt but instead of installing the chosen Programs (or Debs) it automatically creates portable/loadable Sfs/Squashfs Modules from them instead,
I really love it .......Veeeery cool. :thumbup:

I prefer using AppImages or portable (sfs/sqashfs) Modules myself..... instead of Installing them........seems more secure and flexible to me.

Since i am not a Developer myself......maybe this Hint is useful for somebody more privy to this Kind of programming Stuff.
Maybe @fredx181 himself could comment more on this Kind of Topic.

Keep on rocking :thumbup2:

Post Reply

Return to “System”