On Thu 15 Jun 2017 at 10:16:45 (-0400), Dan Ritter wrote: > On Wed, Jun 14, 2017 at 09:57:50PM +0200, tuxderlinuxfuch...@gmail.com wrote: > > The shown way is not very comfortable. > > > > 1. it is annoying having to remember IP addresses > > 2. sed command is error prone (consider typos, etc.) > > 3. copying around backup files is time consuming having to type in all > > the paths > > 4. typing in sed command or searching it in bash history for re-using is > > time consuming, too. > > > > Simple workaround for now: > > /etc/apt/sources.list: > ---- > deb http://site1.ip.address/debian jessie-backports main > #deb http://site2.ip.address/debian jessie-backports main > ---- > > Now just change the comment from one to the other, run apt-get > update and go. > > Second workaround, if you have lots of entries to be switched: > create two sources.list files, named home.list and uni.list. > > When you move from place to place, copy the appropriate one > in to /etc/apt/sources.list and run apt-get update.
Another workaround is to use bash functions, say upgrade-work and upgrade-home, to wrap some rather long command lines like: apt-get -o Acquire::http::Proxy="http://192.168.1.19:3142/" update && apt-get -d -o Acquire::http::Proxy="http://192.168.1.19:3142/" upgrade ; apt-get upgrade Now you may well ask why I use such a crazy command line. Answer, I run apt-cacher-ng on my wheezy server, BUT proxying the actual upgrade step fails because wheezy can't handle apt-listbugs, so I do that step directly. The long command line saves messing with apt.conf or sources.list. Cheers, David.