Atualizações não assistidas

2

Existem dois arquivos com as mesmas configurações em autônoma upgrades /etc/apt/apt.conf.d :

20auto-upgrades e 10periodic .

APT::Periodic::Update-Package-Lists "1";
APT::Periodic::Download-Upgradeable-Packages "1";
APT::Periodic::AutocleanInterval "0";
APT::Periodic::Unattended-Upgrade "1";
  1. Qual é a diferença?

  2. Para que AutoCleanInterval funcione, preciso definir a seguinte opção em /etc/apt/apt.conf.d/50unattended-upgrades :

    Unattended-Upgrade::Remove-Unused-Dependencies "true";
    

Atualização: Não tenho certeza se as opções estão funcionando. No teste a seguir, o autônomo é muito rápido comparado ao apt update. Eu não sei porque:

abhishek ~ $ time sudo unattended-upgrade -v
[sudo] password for abhishek: 
Initial blacklisted packages: 
Initial whitelisted packages: 
Starting unattended upgrades script
Allowed origins are: ['o=Ubuntu,a=xenial-security', 'o=Ubuntu,a=xenial-updates', 'o=Ubuntu,a=xenial-proposed', 'o=Ubuntu,a=xenial-backports']
No packages found that can be upgraded unattended and no pending auto-removals

real    0m5.108s
user    0m2.840s
sys     0m0.040s

Atualização normal

abhishek ~ $ time sudo apt update
Hit:1 http://in.archive.ubuntu.com/ubuntu xenial InRelease
Hit:2 http://in.archive.ubuntu.com/ubuntu xenial-updates InRelease
Hit:3 http://in.archive.ubuntu.com/ubuntu xenial-backports InRelease
Err:4 https://tiliado.eu/nuvolaplayer/repository/deb xenial InRelease
  Could not resolve host: tiliado.eu
Hit:5 https://packagecloud.io/slacktechnologies/slack/debian jessie InRelease
Hit:6 http://archive.canonical.com/ubuntu xenial InRelease
Get:7 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Hit:8 http://ppa.launchpad.net/atareao/telegram/ubuntu xenial InRelease                                    
Hit:9 http://ppa.launchpad.net/costales/anoise/ubuntu xenial InRelease
Hit:10 http://ppa.launchpad.net/danielrichter2007/grub-customizer/ubuntu xenial InRelease
Hit:11 http://ppa.launchpad.net/gnumdk/lollypop/ubuntu xenial InRelease
Hit:12 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu xenial InRelease
Hit:13 http://ppa.launchpad.net/gwendal-lebihan-dev/hexchat-stable/ubuntu xenial InRelease
Hit:14 http://ppa.launchpad.net/hanipouspilot/rtlwifi/ubuntu xenial InRelease
Ign:15 http://toolbelt.heroku.com/ubuntu ./ InRelease 
Hit:16 http://ppa.launchpad.net/kivy-team/kivy/ubuntu xenial InRelease
Hit:17 http://ppa.launchpad.net/kubuntu-ppa/backports/ubuntu xenial InRelease
Hit:18 http://ppa.launchpad.net/mc3man/mpv-tests/ubuntu xenial InRelease
Hit:19 http://ppa.launchpad.net/mehanik/ksuperkey/ubuntu xenial InRelease
Hit:20 http://ppa.launchpad.net/nilarimogard/webupd8/ubuntu xenial InRelease
Hit:21 http://ppa.launchpad.net/noobslab/apps/ubuntu xenial InRelease
Hit:22 http://toolbelt.heroku.com/ubuntu ./ Release               
Hit:24 http://apt.nylas.com/ubuntu vivid InRelease
Hit:25 http://ppa.launchpad.net/peterlevi/ppa/ubuntu xenial InRelease
Hit:26 http://ppa.launchpad.net/qbittorrent-team/qbittorrent-stable/ubuntu xenial InRelease
Err:27 http://repository.spotify.com stable InRelease
  Temporary failure resolving 'repository.spotify.com' [IP: 54.235.176.26 80]
Err:28 http://ppa.launchpad.net/tuxonice/ppa/ubuntu xenial InRelease
  Unable to connect to ppa.launchpad.net:http: [IP: 54.235.176.26 80]
Err:29 http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu xenial InRelease
  Unable to connect to ppa.launchpad.net:http: [IP: 54.235.176.26 80]
Err:30 http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu xenial InRelease
  Unable to connect to ppa.launchpad.net:http: [IP: 54.235.176.26 80]
Fetched 94.5 kB in 3min 47s (415 B/s)
Reading package lists... Done
Building dependency tree       
Reading state information... Done
All packages are up to date.
W: Failed to fetch http://repository.spotify.com/dists/stable/InRelease  Temporary failure resolving 'repository.spotify.com' [IP: 54.235.176.26 80]
W: Failed to fetch https://tiliado.eu/nuvolaplayer/repository/deb/dists/xenial/InRelease  Could not resolve host: tiliado.eu
W: Failed to fetch http://ppa.launchpad.net/tuxonice/ppa/ubuntu/dists/xenial/InRelease  Unable to connect to ppa.launchpad.net:http: [IP: 54.235.176.26 80]
W: Failed to fetch http://ppa.launchpad.net/ubuntu-wine/ppa/ubuntu/dists/xenial/InRelease  Unable to connect to ppa.launchpad.net:http: [IP: 54.235.176.26 80]
W: Failed to fetch http://ppa.launchpad.net/webupd8team/sublime-text-3/ubuntu/dists/xenial/InRelease  Unable to connect to ppa.launchpad.net:http: [IP: 54.235.176.26 80]
W: Some index files failed to download. They have been ignored, or old ones used instead.

real    3m51.729s
user    0m4.140s
sys     0m0.764s
    
por Abhishek Bhatia 29.06.2016 / 05:20

1 resposta

1

Aqui você vai:

  • Nenhuma diferença entre o conteúdo, apenas que 10periodic será analisado antes de 20auto-upgrades devido ao comportamento de análise ascendente de apt . Se a mesma diretiva for mencionada em dois arquivos diferentes (ou mais), os anteriores serão substituídos pelo último.

  • Não.

    APT::Periodic::AutocleanInterval aceita um valor inteiro e define o intervalo para a remoção dos pacotes armazenados localmente em /var/cache/apt/archives e /var/cache/apt/archives/partial , portanto, é análogo a sudo apt-get clean .

    Por outro lado, Unattended-Upgrade::Remove-Unused-Dependencies considera booleano e é análogo ao comando sudo apt-get autoremove , ou seja, removerá todas as dependências que não estão sendo usadas por nenhum dos pacotes instalados.

Para ativar Unattended-Upgrade , você precisa ter a diretiva:

APT::Periodic::Unattended-Upgrade

definido em qualquer arquivo vem antes das definições de Unattened-Upgrade (por exemplo, definições geralmente colocadas em /etc/apt.conf.d/50unattended-upgrades ).

Os valores de exemplo são:

APT::Periodic::Unattended-Upgrade "1"; ## Runs "Unattened-Upgrade" daily
APT::Periodic::Unattended-Upgrade "7"; ## Runs weekly

Quanto a quando apt executa este (e outros), ele é executado diariamente e as operações são definidas no arquivo /etc/cron.daily/apt .

No meu sistema, os arquivos cron em /etc/cron.daily/ são iniciados às 06:26:

25 6    * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    
por heemayl 29.06.2016 / 05:42