[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: When to sudo apt clean?



Max Nikulin wrote:

>> sudo apt autoremove -y && sudo apt update && sudo apt
>> upgrade -y
>
> Almost from the start of this thread I am curious if there
> is a reason to not run autoremove immediately after upgrade.
> What is the purpose of retaining unnecessary packages till
> next upgrade?

Indeed, it makes sense to do cleanup after, but it also makes
sense to upgrade from a clean state.

> I usually add --purge to apt autoremove to avoid remnants of
> deleted kernel packages. On the other hand I am not brave
> enough to use -y.
>
> This thread started from a question concerning
> /var/cache/apt/archives. I do not remember if somebody
> already mentioned that "apt upgrade" by default removes
> downloaded .deb files in the case of success, however
> "apt-get upgrade" does no do it.

Good ideas, made 2 changes below accordingly.

a1 () {
    sudo apt-get -qq check
    sudo apt-get -qq update
    sudo apt-get -qq --purge -y autoremove
    sudo aptitude -q=99 autoclean
    apt -a list --upgradable
}

a2 () {
    a1
    sudo apt -qq upgrade
    sudo apt dist-upgrade
}

-- 
underground experts united
https://dataswamp.org/~incal


Reply to: