Navigation

Users Online

· Guests Online: 1

· Members Online: 0

· Total Members: 98
· Newest Member: Jasedelfv

Login

Username

Password



Not a member yet?
Click here to register.

Forgotten your password?
Request a new one here.

Howto Section


Ecol Strip

Ecol Strip

pkgwatch A Package Management Wrapper

Linux

Introduction

the past I was trying many different linux distros. Each has its own package management systems: debian has apt, mandrake has urpmi, yellowdog has an apt front-end for rpm, suse has yast... While they all are quite similar and not difficult to use, I found that I often made mistakes because I often forgot which system I was using and the exact commands on that system. Another issue is that I wish I could keep track how I installed/removed those packages. So I wrote a simple wrapper for various package management systems. It serves two purposes:

  1. to free me from remembering the exact commands for different systems
  2. to help me keep track of what packages I installed

For example, when I need to install e.g. vim, I always say pkg-install vim, and the wrapper would invoke aptitude, apt-get or yum depending on the current system.

 

Installation

  • edit /etc/pkgwatchrc to fit your system. You must set PWTOOL and PWDIR:
    • PWTOOL is the name of the package management system on your system. It must be one of the following:

      aptitude-deb
      apt-deb
      urpm
      yast-rpm
      yum-rpm
      fink-deb
      macports-port

    • PWDIR is a directory to keep track of package installation/removal.
  • since I use mostly debian-based systems, I set default as follows:
    PWTOOL=aptitude-deb
    PWDIR=/root/config/pkgwatch

 

Usage examples

Instead of listing all the details, I describe the commands I use most frequently and the effect of each command.

pkg-update

Update the package management:

  • on an apt-based system this is similar to apt-get update
  • on an yum system this is similar to yum update
  • on macports (macosx) this is similar to port selfupdate

pkg-install vim

Install package vim. The details of this command will be explained later.

pkg-remove vim

Remove package vim.

pkg-list

List all installed packages on my system:

  • on deb-based system this is similar to dpkg --get-selections
  • on rpm-based system this is similar to rpm -qa

pkg-file vim

List all files belonging to package vim.

  • on deb-based system this is similar to dpkg -L vim
  • on rpm-based system this is similar to rpm -ql vim

pkg-own /usr/bin/vim

source

 

Comments

No Comments have been Posted.

Post Comment

Please Login to Post a Comment.

Ratings

Rating is available to Members only.

Please login or register to vote.

No Ratings have been Posted.
Render time: 0.01 seconds
699,889 unique visits