Debian Scripting para remover o registro durante o apt-get install

0

Estou tentando remover o log que o debian coloca depois que você instala o apt-get

Ign http://ftp.uk.debian.org jessie InRelease
Hit http://ftp.uk.debian.org jessie-updates InRelease
Get:1 http://security.debian.org jessie/updates InRelease [63.1 kB]
Hit http://ftp.uk.debian.org jessie Release.gpg
Hit http://ftp.uk.debian.org jessie-updates/main Sources
Get:2 http://ftp.uk.debian.org jessie-updates/main amd64 Packages/DiffIndex [3,472 B]
Get:3 http://ftp.uk.debian.org jessie-updates/main Translation-en/DiffIndex [1,720 B]
Hit http://ftp.uk.debian.org jessie Release
Get:4 http://security.debian.org jessie/updates/main Sources [131 kB]
Hit http://ftp.uk.debian.org jessie/main Sources
Hit http://ftp.uk.debian.org jessie/main amd64 Packages
Hit http://ftp.uk.debian.org jessie/main Translation-en
Get:5 http://security.debian.org jessie/updates/main amd64 Packages [237 kB]
Get:6 http://security.debian.org jessie/updates/main Translation-en [129 kB]
Fetched 565 kB in 3s (158 kB/s)
Reading package lists... Done
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... The following package was automatically installed and is no longer required:
  libio-socket-ip-perl
Use 'apt-get autoremove' to remove it.
Done
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

Eu quero remover isso. Existe alguma maneira de parar isso, enquanto o script?

    
por Dectom 04.05.2016 / 22:08

1 resposta

2

Redirecione o stdout para /dev/null anexando > /dev/null a qualquer comando:

apt-get update > /dev/null

Para também redirecionar stderr para /dev/null append 2>&1 :

apt-get update > /dev/null 2>&1

Para atualizar ou instalar pacotes sem ser solicitado por [Y/n] add -y :

apt-get upgrade -y > /dev/null 2>&1
apt-get install <package> -y > /dev/null 2>&1

Você também pode enviá-lo para um arquivo de log:

apt-get upgrade -y > script.log 2>&1

Um único > sobrescreverá o arquivo, para registrar vários comandos, use dois >> , o que fará com que a saída seja anexada ao final do arquivo:

apt-get update >> script.log 2>&1
apt-get upgrade -y >> script.log 2>&1
    
por 04.05.2016 / 22:45