Ubuntu – Is it possible to set proxy for APT while using graphical Ubiquity-based desktop ISO installer

networkingPROXYsystem-installationubiquityubuntu-mate

For some of the Ubuntu installations I use netboot mini.iso from http://cdimage.ubuntu.com/netboot/ . This installation method includes the step of configuring proxy. It is very useful for me as I have Squid-Deb-Proxy configured in my network, so I can lower traffic usage by using it.

But I do not see such an option in Ubuntu Desktop graphical installers, for example for Ubuntu MATE. They use Ubiquity as a common. Is it possible to set APT proxy during installation for such installers?

Best Answer

According to the source code of Ubiquity it obtains the proxy settings from two sources:

  1. installer preseed file (not our case)
  2. proxy configuration of current user (namely GSettings path org.gnome.system.proxy)

For Ubuntu MATE desktop installer one can use the following method:

  1. Boot system in Try Ubuntu MATE without installation
  2. Launch Network Proxy application from dash or by using mate-network-properties
  3. Specify needed HTTP proxy:

    [o] Manual proxy configuration
    HTTP proxy: [192.168.12.34] Port: [8000]

    and click Close.

    Note: this step may be done from terminal by using the following commands

    gsettings set org.gnome.system.proxy mode "'manual'"
    gsettings set org.gnome.system.proxy.http host "192.168.12.34"
    gsettings set org.gnome.system.proxy.http port "8000"
    
  4. Launch Ubiquity installer by clicking on its Install Ubuntu MATE ... icon on desktop.

  5. Proceed with installation as usual and wait to finish.

As the result you will get this proxy saved in /etc/apt/apt.conf as mini.iso does:

$ cat /etc/apt/apt.conf
Acquire::http::Proxy "http://192.168.12.34:8000";

For the more universal solution it is recommended to remove this file and use special avahi-based package sudo apt-get install squid-deb-proxy-client to access it by hostname.


Note: this method may be adapted for other Ubuntu flavors, but I did not tested them.