pkgin, un administrador de paquetes para NetBSD

pkgin es una herramienta similar a apt/yum/dnf que permite administrar paquetes binarios permite la instalación, eliminación y actualización de paquetes y dependencias asociadas, utilizando un repositorio remoto.

Instalar

Podemos ejecutar los siguientes comandos para instalar pkgin en NetBSD, puede encontrar la guía oficial en install binary packages (NetBSD)

# PKG_PATH="http://cdn.NetBSD.org/pub/pkgsrc/packages/NetBSD/$(uname -p)/$(uname -r|cut -f '1 2' -d.)/All/"
# export PKG_PATH
# pkg_add pkgin

Inicializar/actualizar repositorio

EL siguiente comando permite inicializar o actualizar la base de datos que contiene la definición e información de los paquetes disponibles.

# pkgin update

Es recomendable ejecutar el comando anterior con cierta regularidad para mantener el sistema operativo actualizado.

Ejemplos

Listar paquetes disponibles

# pkgin avail
0verkill-0.16nb1     0verkill is bloody 2D action deathmatch-like game in ASCII-ART
2048-cli-0.9.1       The game 2048 for your Unix terminal
2bwm-0.3             Fast floating WM written over the XCB library and derived from mcwm
2fa-1.1.0nb18        Command-line client for two-factor authentication
2vcard-0.6nb1        Convert an addressbook to the popular VCARD file format
3ddesktop-0.2.9nb13  3D Virtual Desktop Switcher
3proxy-0.8.11        Multi-protocol proxy
4stAttack-2.1.4nb20  Game in which you have to try to out-smart your opponent
6tunnel-0.13         Tunnelling for applications that don't speak IPv6
7kaa-2.15.4p1nb1     Seven Kingdoms: Ancient Adversaries
...

Listar paquetes instalados

# pkgin list
pkgin list 
pkg_install-20210308 Package management and administration tools for pkgsrc
pkgin-20.12.1        Apt / yum like tool for managing pkgsrc binary packages
vim-8.2.2557         Vim editor (vi clone) without GUI
vim-share-8.2.2557   Data files for the vim editor (vi clone)

Buscar un paquete

# pkgin search nginx
nginx-1.19.6         Lightweight HTTP server and mail proxy server
nginx-1.18.0nb8      Lightweight HTTP server and mail proxy server
....

Buscar un paquete usando expresiones regulares

# pkgin search '^apache\-[[:digit:]]' 
apache-2.4.46nb2     Apache HTTP (Web) server, version 2.4

Instalar/actualizar un paquete y sus dependencias

Puede usar el subcomando install para instalar o actualizar paquetes.

# pkgin install nginx
calculating dependencies...done.

2 packages to install:
  nginx-1.19.6 pcre-8.44

0 to refresh, 0 to upgrade, 2 to install
944K to download, 4698K to install

proceed ? [Y/n]

También es posible instalar varios paquetes a la vez separando los paquete con un espacio en blanco.

Desinstalar un paquete y sus dependencias.

# pkgin remove curl   
5 packages to delete: 
  cmake-3.19.2 git-2.29.2 git-base-2.29.2 git-contrib-2.29.2 curl-7.74.0

Eliminar dependencias huérfanas

# pkgin autoremove

Mostrar información/descripción de un paquete.

# pkgin pkg-descr nginx 
Information for https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/9.0/All/nginx-1.19.6.tgz:
Description:
Nginx (pronounced engine-x) is a free, open-source, high-performance HTTP
server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev
started development of Nginx in 2002, with the first public release in 2004.
Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains.
Nginx is known for its high performance, stability, rich feature set, simple
configuration, and low resource consumption.
Nginx is one of a handful of servers written to address the C10K problem.
Unlike traditional servers, Nginx doesn't rely on threads to handle requests.
Instead it uses a much more scalable event-driven (asynchronous) architecture.
This architecture uses small, but more importantly, predictable amounts of
memory under load.
Even if you don't expect to handle thousands of simultaneous requests, you can
still benefit from Nginx's high-performance and small memory footprint.
Nginx scales in all directions: from the smallest VPS all the way up to
clusters of servers.
Nginx powers several high-visibility sites, such as Netflix, Hulu, Pinterest,
CloudFlare, Airbnb, WordPress.com, GitHub, SoundCloud, Zynga, Eventbrite,
Zappos, Media Temple, Heroku, RightScale, Engine Yard and NetDNA.
Homepage:
https://nginx.org/

Actualizar todos los paquetes

Con el siguiente comando actualizamos todos los paquetes a sus versiones más recientes

# pkgin full-upgrade

Limpiar la cache

# pkgin clean

Mostrar las dependencias de un paquete

Ejecute los siguientes comandos para obtener todas las dependencias de un paquete

Dependencias directas

# pkgin show-deps curl     
direct dependencies for curl-7.74.0
        nghttp2>=1.40.0nb4
        libidn2>=2.0.0

Dependencias reversas

# pkgin show-rev-deps curl
local reverse dependency tree for curl
        git-2.29.2
        git-contrib-2.29.2
        git-base-2.29.2
        cmake-3.19.2

Todas las dependencias

# pkgin show-full-deps curl
full dependency tree for curl-7.74.0
        xmlcatmgr>=2.0beta1
        libuuid>=2.18
        libffi>=3.3nb1
        libunistring>=0.9.4
        python38>=3.8.0
        libxml2>=2.9.10nb3
        nghttp2>=1.40.0nb4
        libidn2>=2.0.0

Mostrar los requirimientos de un paquete

# pkgin requires curl       
Shared libraries required by curl-7.74.0:
        /usr/pkg/lib/libunistring.so.2
        /usr/pkg/lib/libnghttp2.so.14
        /usr/pkg/lib/libidn2.so.0
        /usr/lib/libz.so.1
        /usr/lib/libwind.so.1
        /usr/lib/libutil.so.7
        /usr/lib/libssl.so.14
        /usr/lib/libsqlite3.so.1
        /usr/lib/libroken.so.20
        /usr/lib/libpthread.so.1
        /usr/lib/libkrb5.so.27
        /usr/lib/libintl.so.1
        /usr/lib/libhx509.so.6
        /usr/lib/libheimntlm.so.5
        /usr/lib/libheimbase.so.2
        /usr/lib/libgssapi.so.11
        /usr/lib/libcrypto.so.14
        /usr/lib/libcom_err.so.8
        /usr/lib/libc.so.12
        /usr/lib/libasn1.so.10
        /lib/libcrypt.so.1

Mostrar librerías compartidas por un paquete

# pkgin provides curl
Shared libraries provided by curl-7.74.0:
        /usr/pkg/lib/libcurl.so.4.7.0
        /usr/pkg/lib/libcurl.so.4
        /usr/pkg/lib/libcurl.so

Mostrar los ficheros que incluye un paquete

# pkgin pkg-content nginx 
Information for https://cdn.netbsd.org/pub/pkgsrc/packages/NetBSD/x86_64/9.0/All/nginx-1.19.6.tgz:
Files:
/usr/pkg/man/man8/nginx.8
/usr/pkg/sbin/nginx
/usr/pkg/share/examples/nginx/conf/fastcgi.conf
/usr/pkg/share/examples/nginx/conf/fastcgi_params
/usr/pkg/share/examples/nginx/conf/koi-utf
/usr/pkg/share/examples/nginx/conf/koi-win
/usr/pkg/share/examples/nginx/conf/mime.types
/usr/pkg/share/examples/nginx/conf/nginx.conf
/usr/pkg/share/examples/nginx/conf/win-utf
/usr/pkg/share/examples/nginx/html/50x.html
/usr/pkg/share/examples/nginx/html/index.html
/usr/pkg/share/examples/rc.d/nginx

Mostrar a que categoría pertenece un paquete

# pkgin spc nginx
www          - nginx-1.19.6
www          - nginx-1.18.0nb8

Ayuda

  • man pkgin
  • pkgin -h

Enlaces de interés

YouTube Video

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

Este sitio usa Akismet para reducir el spam. Aprende cómo se procesan los datos de tus comentarios.