Jaime Frutos Morales's blog

24/06/2010

How to install and configure Apt-Cacher NG on Ubuntu Server 10.04

Filed under: Linux, SysAdmin, Ubuntu — acidborg @ 13:34

Description: Apt-Cacher NG is a caching proxy specialized for package files from GNU/Linux distributors, primarily for Debian and Debian based distributions (like Ubuntu). This means that if you have many Debian/Ubuntu machines on your network, you just have to download the deb packages (new software, updates, distro upgrades, etc) from the internet once and the rest of the Debian/Ubuntu machines get them from Apt-Cacher NG cache, saving time and internet bandwidth. To install it, follow these simple steps:

Steps:

  1. Installation: apt-get install apt-cacher-ng
  2. Configuration: Edit /etc/apt-cacher-ng/acng.conf with the following content:
    CacheDir: /var/cache/apt-cacher-ng
    LogDir: /var/log/apt-cacher-ng
    Port:3142
    BindAddress: 0.0.0.0
    Remap-debrep: file:deb_mirror*.gz /debian ; file:backends_debian
    Remap-uburep: file:ubuntu_mirrors /ubuntu ; file:backends_ubuntu
    PidFile: /var/run/apt-cacher-ng/pid
    ExTreshold: 4
  3. Restart Apt-Cacher NG: /etc/init.d/apt-cacher-ng restart
  4. Create on the rest of the Debian/Ubuntu machines on the network the file /etc/apt/apt.conf.d/02proxy with the following content:
    Acquire::http { Proxy "http://your-apt-cacher-ng-server:3142"; };

Next time any of your machines needs a deb package, it will ask Apt-Cacher NG for it. If this package was asked previously by any of the other machines, Apt-Cacher will have a copy and will deliver it. Otherwise, it will fetch it from the internet repositories, keep a local copy and deliver it.

Advertisements

02/06/2010

How to lock a RPM package installed on Red Hat 5

Filed under: Linux, SysAdmin — acidborg @ 13:17

Description: if you have a RPM package installed and you want to lock its version (you don’t want to update it even if a newer version is available), there is a yum plugin which can do this for you: yum-versionlock

Steps:

  1. Install the plugin: yum install yum-versionlock
  2. Enable it: make sure enabled = 1 appears in /etc/yum/pluginconf.d/versionlock.conf
  3. Add the packages you want to lock to /etc/yum/pluginconf.d/versionlock.list , including version and architecture. For example: nagios-plugins-1.4.11-1.el5.rf.x86_64
  4. Test it by trying to update a locked package: yum update nagios-plugins

Blog at WordPress.com.