🐧 Как ΠΎΡ‡ΠΈΡ‰Π°Ρ‚ΡŒ кэш APT послС ΠΊΠ°ΠΆΠ΄ΠΎΠΉ ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ

Π‘Ρ‚ΠΈΡ€Π°Π΅ΠΌ кэш apt Π½Π° Debian, Ubuntu, Linux Mint

by itisgood

Как автоматичСски ΠΎΡ‡ΠΈΡ‰Π°Ρ‚ΡŒ кэш APT послС ΠΊΠ°ΠΆΠ΄ΠΎΠΉ ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΈ.

Π£Π΄Π°Π»ΡΡ‚ΡŒ ΠΊΠ°ΠΆΠ΄Ρ‹ΠΉ Ρ„Π°ΠΉΠ» ΠΈΠ· кэша APT послС ΠΊΠ°ΠΆΠ΄ΠΎΠ³ΠΎ выполнСния dpkg.

$ sudo tee /etc/apt/apt.conf.d/00_disable-cache-directories << EOF
DPkg::Post-Invoke {"echo 'Purging APT cache'; find /var/cache/apt/archives/ -type f -delete"}
EOF
DPkg::Post-Invoke {"echo 'Purging APT cache'; find /var/cache/apt/archives/ -type f -delete"}

Π’Ρ‹ΠΏΠΎΠ»Π½ΠΈΡ‚Π΅ ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΡŽ установки apt.

$ sudo apt install packer
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  chromium-codecs-ffmpeg-extra gir1.2-gnomebluetooth-1.0 gstreamer1.0-vaapi libflashrom1 libftdi1-2 libgstreamer-plugins-bad1.0-0 libllvm13 ltrace
Use 'sudo apt autoremove' to remove them.
Suggested packages:
  ansible qemu-system
The following NEW packages will be installed:
  packer
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 17.4 MB of archives.
After this operation, 106 MB of additional disk space will be used.
Get:1 http://pl.archive.ubuntu.com/ubuntu jammy/universe amd64 packer amd64 1.6.6+ds1-4 [17.4 MB]
Fetched 17.4 MB in 1s (21.0 MB/s) 
Selecting previously unselected package packer.
(Reading database ... 210130 files and directories currently installed.)
Preparing to unpack .../packer_1.6.6+ds1-4_amd64.deb ...
Unpacking packer (1.6.6+ds1-4) ...
Setting up packer (1.6.6+ds1-4) ...
Processing triggers for man-db (2.10.2-1) ...
Purging APT cache

ΠžΠ±Ρ€Π°Ρ‚ΠΈΡ‚Π΅ Π²Π½ΠΈΠΌΠ°Π½ΠΈΠ΅, Ρ‡Ρ‚ΠΎ ΠΊΠΎΠΌΠ°Π½Π΄Ρ‹ apt, ΠΏΡ€ΠΈ ΠΊΠΎΡ‚ΠΎΡ€Ρ‹Ρ… Π½Π΅ выполняСтся dpkg, Π½Π΅ Π²Ρ‹Π·Ρ‹Π²Π°ΡŽΡ‚ Π΄ΠΎΠΏΠΎΠ»Π½ΠΈΡ‚Π΅Π»ΡŒΠ½Ρ‹Ρ… ΠΎΠΏΠ΅Ρ€Π°Ρ†ΠΈΠΉ.

$ sudo apt install kvmtool --download-only
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following packages were automatically installed and are no longer required:
  chromium-codecs-ffmpeg-extra gir1.2-gnomebluetooth-1.0 gstreamer1.0-vaapi libflashrom1 libftdi1-2 libgstreamer-plugins-bad1.0-0 libllvm13 ltrace
Use 'sudo apt autoremove' to remove them.
The following NEW packages will be installed:
  kvmtool
0 upgraded, 1 newly installed, 0 to remove and 14 not upgraded.
Need to get 89.4 kB of archives.
After this operation, 265 kB of additional disk space will be used.
Get:1 http://pl.archive.ubuntu.com/ubuntu jammy/universe amd64 kvmtool amd64 0.20170904-1.1 [89.4 kB]
Fetched 89.4 kB in 0s (672 kB/s)   
Download complete and in download only mode
$ sudo ls /var/cache/apt/archives/
kvmtool_0.20170904-1.1_amd64.deb  lock	partial

см. Ρ‚Π°ΠΊΠΆΠ΅:

 

 

You may also like

Leave a Comment