Faster Updates

I use Slackware on all of my computers, but there is no puritanism here. I also have Ubuntu MATE and CentOS running.

My HP desktop runs Ubuntu MATE. I seldom use that computer. The system is connected to a VLAN and is isolated from the house LAN. That means updates are an isolated event too.

I maintain a 32-bit and 64-bit Ubuntu MATE partitions on my office system. I maintain those partitions as images for future installations. I run those two systems using a virtual machine (VM) and raw disk access. The VirtualBox network interface is bridge mode, connecting to the house LAN. Running in this manner means the updates are isolated events.

I run a CentOS 7 VM on the office desktop and my Thinkpad T400 laptop. I use these VMs for work related events. The VMs isolate my work related usage.

I face local data caps. Even if I didn’t, I nonetheless prefer to work efficiently when that makes sense. I wanted to reduce the bandwidth used to support updates. I also want faster updates.

I had an Ubuntu Server virtual machine (VM) running on the LAN server. The VM uses apt-cacher-ng and is a proxy caching server for updates. I stopped using the caching server some time ago when I performed my last big purge. The VM had been sitting unused since.

Resurrecting the proxy caching server was easy enough. I then had to direct all of these non Slackware systems to use the proxy.

Despite being a Debian based package, the apt-cacher-ng software supports some non Debian systems, including CentOS. I found an excellent tutorial online to help me configure that support. The VirtualBox network interface is NAT, but I configure the host on both systems to act as DNS resolvers.

For the two Ubuntu MATE images on my office desktop, I needed only add an apt.conf.d config file.

    /etc/apt/apt.conf.d/02proxy
    Acquire::http { Proxy "http://xxx.xxx.xxx.xxx:3142"; };
    

Where xxx.xxx.xxx.xxx is the IP address of the Ubuntu proxy.

Being isolated on a VLAN, the HP presented a challenge. After letting this challenge fester in my mind for a while, I conjured up a simple solution. I grabbed two additional CAT 5e cables and a coupler. I connected the HP cable to the coupler and ran the cable from the coupler to the VLAN port on the router. At that point nothing had actually changed with respect to the VLAN isolation.

In the office I maintain an open cable connected to the main 1 Gbps network switch. I use that cable to connect the laptop when I want to perform a lot of maintenance. To place the HP on the LAN I need only swap the coupler from one cable to the other.

I needed a way to reconfigure NetworkManager. The VLAN uses DHCP but everything on the house LAN uses static IP addresses. I logged in as root and configured a new NetworkManager connection point. To only allow root to use the new connection, I disabled the option that allows all users.

I logged in as normal user and verified the new connection point did not appear in the NetworkManager dialogs.

I removed the Ubuntu update notifier package.

Now when I want to update Ubuntu MATE on the HP, I swap the network cable and log in as root. If necessary I toggle NetworkManager to use the static connection. I open a terminal to update the system. When the updates complete I log out, swap the network cables, and log in as normal user.

If I am feeling super security conscious, I do not login through the login manager but toggle to a console and use nmcli to change the network connection.

To further reduce bandwidth I disabled translations support in apt.

    /etc/apt/apt.conf.d/99translations
    Acquire::Languages { none; };
    

Other than the physical cable swapping and NetworkManager toggling, the proxy caching is working great. I plan to use the same approach at work.

Posted: Category: Tutorial, Usability Tagged: General

Next: Creating a Guest Account

Previous: Firefox Welcome Pages