Git Product home page Git Product logo

cpm's Introduction

Cactus Package Manager

A wrapper for package managers to make them consistent for those of us who are lazy. It's more like a package manager manager.

Usage

$ cpm [i|r|l|u|U|s|S|I|F|f|c|h] [pkg]...
-> i|install install one or more packages
-> r|remove  remove one or more packages
-> l|list    list installed packages
-> C|count   count installed packages
-> u|update  update package lists
-> U|upgrade update package lists and upgrade all packages
-> s|search  search for a package
-> S|show    show information about a package
-> I|info    same as show
-> F|files   show file list of package
-> f|from    show package which owns a file
-> c|clean   clean up leftover files/caches/orphans
-> h|help    show this message

Installation

git clone https://github.com/willeccles/cpm.git
cd cpm
sudo make install

Supported package managers

  • apk (Alpine/AdΓ©lie)
  • apt (Debian/Ubuntu)
  • pkgutils (CRUX)
  • emerge (Gentoo)
  • dnf (Fedora)
  • guix (non-system-wide Guix)
  • Homebrew
  • lunar (Lunar)
  • MacPorts (macOS)
  • pacman (Arch)
  • pkg (FreeBSD and OpenBSD)
  • rpm-ostree (Fedora Silverblue)
  • slackpkg (Slackware)
  • sorcery (Source Mage)
  • urpmi (Mageia)
  • xbps (Void)
  • zypper (OpenSUSE)

Explicitly unsupported package managers

  • Cargo
  • Flatpak
  • Nix
  • NPM
  • Pip
  • Snap
  • Yarn

My package manager isn't supported!!1!!11!1

See CONTRIBUTING.md.

cpm's People

Contributors

atillart-one avatar eepykate avatar foxsouns avatar kotonbads avatar mininmobile avatar swindlesmccoop avatar thatonecalculator avatar willeccles avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

cpm's Issues

a list of known, but unimplemented, PM's

i figured there should maybe be a list made for known but yet unimplemented PM's.
logically, i've omitted pm's that are unmaintained.
if you are working on implementing one of these, let me know and i'll put your username next to the respective PM.

below are all the linux's i know of, and are still maintained:

  • Sorcery (from Source Mage) - @foxsouns Implemented.
  • lunar (from Lunar Linux) - @foxsouns Implemented
  • tce (from Tiny Core Linux)
  • Tazpkg (from SliTaz GNU/Linux)
  • pkgutils (from CRUX Linux) - @foxsouns Implemented.
  • qi (from Dragora GNU/Linux-Libre)
  • swupd (from Clear Linux OS)
  • Compile (from GoboLinux)
  • Upkg (from paldo GNU/Linux)
  • eopkg (from Solus)
  • opkg (used by OpenWRT, OpenEmbedded, Onion.io stuff, KOAN)
  • Entropy (Sabayon Linux)
  • netpkg (Zenwalk)
  • openpkg (aims to work on any unix, similar to guix)
  • puppy package manager (puppy linux: may or may not still be used?)
  • pkgsrc (a lot, including non-linux's. see this)
  • apt-rpm (used rarely, needs investigation, might work under normal apt)
  • 0install (seems like a sort of .appimage distributing thing? claims to work on top of other pms, like guix.)

bsd's

  • freebsd ports: pkg (from FreeBSD, DragonflyBSD, GhostBSD) @swindlesmccoop Implimented.
  • openbsd ports: pkg (openbsd) @swindlesmccoop Implimented.
  • pkgsrc (NetBSD & others)
  • openpkg (see linux)

illumos'

  • IPS (used on multiple illumos forks, including OmniOS and OpenIndiana)
  • pkgsrc (on at least OpenIndiana, SmartOS)
  • apt/IPS (used by DilOS, seems to meld IPS into apt and update apt? needs investigation to see if it's compatible with our already used apt)
  • zap (used by Tribblix)
  • opencsw
  • openpkg

mac

  • fink (seems to be apt?)
  • pkgsrc (same as the one used above)

other unixs

  • pkgutils (Redox)
  • pkgin (MINIX)

others that seem likely candidates to work:

  • ToaruOS

if anybody else knows of a PM i've missed (and @willeccles: if you have an objection against any of these), please let me know, and i'll update the list.
this wikipedia entry on unix-like os' might be useful.
this wikipedia entry on package managers, generally is probably moreso

Homebrew support?

image

This is not really user-freedom respecting decision, care to provide a context?

Multiple package managers on the same machine

Hi, nice work done here. I didn't make a PR as I thought it would be better to discuss it first.

The first thing that came to my mind when I saw this is AUR. It would be pretty simple to add a wrapper over yay for example and put it before pacman so that it picks it up whenever it finds it. But, this wouldn't be always what the user wants. For example, I usually do -Syu from pacman. For AUR I update only specific packages from time to time.

Other stuff that came to my mind, things like pip, npm, or even go get. Also, for some users they might want flatpak or snap. I made something similar for my dotfiles here but it wasn't meant to be a package manager. Only an installer for my dots.

The point is, should we have a way to manually select the actual package manager here or that would be too much?

Idea: help menu cacti

Do you think it would be a good idea to replace the help menu arrows (->) with the cactus emoji? Might be fun.

~ cpm h
cpm [i|r|l|C|u|U|s|S|I|c|h] [pkg]...
🌡 i | install install one or more packages
🌡 r | remove  remove one or more packages
🌡 l | list    list installed packages
🌡 C | count   count installed packages
🌡 u | update  update package lists
🌡 U | upgrade upgrade all packages
🌡 s | search  search for a package
🌡 S | show    show information about a package
🌡 I | info    same as show
🌡 c | clean   clean up leftover files/caches/orphans
🌡 h | help    show this message

Impossible to implement removing in tce

Hi willecles! I want to contribute this package manager and add tce support, but tce require more than one command to remove extenstion.

  1. remove it from /tce/onboot.list
  2. reboot
  3. remove extenstion from /tce/optional

Use the resolve() function for more package managers

At the moment, only xbps uses this, but presumably this would be useful for any other PM with a from command.

The function:

cpm/cpm

Lines 151 to 156 in 68ff9eb

# resolve symlinks in path to file (may or may not work for a directory, but
# I doubt there's a need for that anyway)
resolve() {
cd -P "${1%/*}" 2>/dev/null || PWD="${1%/*}"
printf '%s\n' "${PWD}/${1##*/}"
}

The usage:

cpm/cpm

Line 316 in 68ff9eb

from) xbps-query -o "$(resolve "$1")";;

This is adjacent to #51, which should be an addition to the resolve() function.

Fedora 36: update and upgrade do the same thing

Hi, there.

Thanks for creating and maintaining cpm, it is a nice and useful tool!

On Fedora 36, the result of cpm update and cpm upgrade are the same. I use zsh with oh-my-zshell, and it shows a red prompt when the previous command resulted in an error (and green if everything is fine), and it seems that dnf check-update exits with some error code when there are updates available, so the second part of cpm upgrade after the && will not run:

cpm/cpm

Line 252 in 40a9fbe

upgrade) $SUDO dnf check-update && $SUDO dnf distro-sync;;

Regards

Combine update and upgrade

As noted in #38, XBPS upgrade does both update and upgrade, while everywhere else only an upgrade is performed. We probably want to combine these two into one, since partial upgrades are cursed and you rarely want to do an upgrade without an update.

slackware; no valid package manager

So i installed this as a way to debloat my install of Slackware 15.0 cause im running it off a 16gb hdd however even after copying it to usr/bin it gives me the message no valid package manager detected even though i obivously have slackpkg installed.

Support more package manager features

Some useful ones I use and always forget

  • List files in package
    • Debian: dpkg -L <pkg>
    • Arch: pacman -Ql <pkg>
  • Show package which owns a file
    • Debian: dpkg -S /path/to/file
    • Arch: pacman -Qo /path/to/file

apk is using the wrong operator for the count function.

apk has tot setup wrong. It's using apk -vv info || tot;;, which includes ||, the OR operator, when it should be |, the pipe operator. I would do this myself, and probably will, but the current PR is supposed to drop soon and I don't want to cause any complications.

(Also: why is AdΓ©lie listed in the comments of cpm, but not on the README next to Alpine? lol)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.