Ubuntu apt

From Lolly's Wiki
Revision as of 16:44, 23 March 2017 by Lollypop (talk | contribs)
Jump to navigationJump to search

apt

Get all non LTS packages

# dpkg --list | awk '/^ii/ {print $2}' | xargs apt-cache show | awk '
BEGIN{
  support="none";
}
/^Package:/,/^$/{
  if(/^Package:/){ pkg=$2; }
  if(/^Supported:/){ support=$2; }
  if(/^$/ && support != "5y"){ printf "%s:\t%s\n", pkg, support; }
}
/^$/ {
  support="none";
}'

Configuring a proxy for apt

Put this into your /etc/apt/apt.conf.d/00proxy :

// Options for the downloading routines
Acquire
{
  Queue-Mode "host";       // host|access
  Retries "0";
  Source-Symlinks "true";

  // HTTP method configuration
  http
  {
    //Proxy::http.us.debian.org "DIRECT";  // Specific per-host setting
    Proxy "http://<user>:<password>@<proxy-host>:<proxy-port>";
    Timeout "120";
    Pipeline-Depth "5";

    // Cache Control. Note these do not work with Squid 2.0.2
    No-Cache "false";
    Max-Age "86400";     // 1 Day age on index files
    No-Store "false";    // Prevent the cache from storing archives
  };

  ftp
  {
    Proxy "http://<user>:<password>@<proxy-host>:<proxy-port>";
    //Proxy::http.us.debian.org "DIRECT"; // Specific per-host setting

    Timeout "120";

    /* Passive mode control, proxy, non-proxy and per-host. Pasv mode
       is prefered if possible */
    Passive "true";
    Proxy::Passive "true";
    Passive::http.us.debian.org "true"; // Specific per-host setting
  };

  cdrom
  {
    mount "/cdrom";

    // You need the trailing slash!
    "/cdrom"
    {
       Mount "sleep 1000";
       UMount "sleep 500";
    }
  };
};