User avatar
Felim_Doyle
Posts: 9
Joined: Mon Oct 15, 2012 3:08 pm
Location: Aylesbury, Buckinghamshire, UK
Contact: ICQ Yahoo Messenger AOL

Re-applying a failed apt-get upgrade or dist-upgrade

Tue Nov 13, 2012 11:35 am

I've only had my Raspberry Pi for a few weeks, after a protracted wait for delivery, and have had limited time to experiment with it. I made an image backup copy of the supplied bootable 4GB SD card prior to using it but was mindful of the fact that, for serious use, I would require a larger card in order to install additional packages and upgrades as well as for general data storage. However, I continued with the 4GB SD card and added packages and performed upgrades as required, keeping an eye on free space at each stage.

Unfortunately, when performing one upgrade, I misread the storage requirements and set it going before I realised that it would not have space to complete. I was somewhat surprised that it attempted to continue despite not having enough room and watched in dismay as each stage failed! I managed to clear sufficient space using the apt-get clean command (was that wise?) and re-ran the apt-get upgrade command but the system seemed to think that the previous attempt had been successful and that there was nothing more to do.

A couple of weeks has passed and an attempt today at an apt-get upgrade and apt-get dist-upgrade states that there are upgrades to be applied but I am concerned that these will not include the previously failed ones so I have not proceeded. I could revert to the original backup copy and start over but I have added packages and made configuration changes which I would rather not have to repeat.

Is there a way that I can force apt-get to re-apply the failed upgrade? Is there a way to perform a catch-up upgrade which will include all previous ones?

Clearly I need to read up on the configuration and use of apt-get but, in the short term, I would appreciate any assistance. I would also be obliged if someone could elaborate on the purpose and appropriate use of the following apt-get commands, as the man pages are quite brief on the subject:-
  • update
    upgrade
    dist-upgrade
    clean
    autoclean
Thanks in advance.
Félim
Aylesbury, Buckinghamshire, UK

plugwash
Forum Moderator
Forum Moderator
Posts: 3463
Joined: Wed Dec 28, 2011 11:45 pm

Re: Re-applying a failed apt-get upgrade or dist-upgrade

Tue Nov 13, 2012 1:22 pm

Honestly unless you actually get errors I wouldn't worry too much about it if something goes really wrong apt will generally abort.

What you may have been seeing is it trying to regenerate the manpages database and failing. This part of the process runs as a normal user and because of the linux concept of reserving some space for root's use only the manpage regeneration hits out of disk space errors long before the rest of the upgrade process (which runs as root) does.

mdewey
Posts: 37
Joined: Wed Dec 07, 2011 10:47 am
Location: UK

Re: Re-applying a failed apt-get upgrade or dist-upgrade

Tue Nov 13, 2012 1:45 pm

Felim_Doyle wrote:I've only had my Raspberry Pi for a few weeks, after a protracted wait for delivery, and have had limited time to experiment with it. I made an image backup copy of the supplied bootable 4GB SD card prior to using it but was mindful of the fact that, for serious use, I would require a larger card in order to install additional packages and upgrades as well as for general data storage. However, I continued with the 4GB SD card and added packages and performed upgrades as required, keeping an eye on free space at each stage.

Unfortunately, when performing one upgrade, I misread the storage requirements and set it going before I realised that it would not have space to complete. I was somewhat surprised that it attempted to continue despite not having enough room and watched in dismay as each stage failed! I managed to clear sufficient space using the apt-get clean command (was that wise?) and re-ran the apt-get upgrade command but the system seemed to think that the previous attempt had been successful and that there was nothing more to do.

A couple of weeks has passed and an attempt today at an apt-get upgrade and apt-get dist-upgrade states that there are upgrades to be applied but I am concerned that these will not include the previously failed ones so I have not proceeded. I could revert to the original backup copy and start over but I have added packages and made configuration changes which I would rather not have to repeat.

Is there a way that I can force apt-get to re-apply the failed upgrade? Is there a way to perform a catch-up upgrade which will include all previous ones?

Clearly I need to read up on the configuration and use of apt-get but, in the short term, I would appreciate any assistance. I would also be obliged if someone could elaborate on the purpose and appropriate use of the following apt-get commands, as the man pages are quite brief on the subject:-
  • update
    upgrade
    dist-upgrade
    clean
    autoclean
Thanks in advance.
apt-get update makes sure your list of packages is up to date
apt-get upgrade actually upgrades any packages for which it can find a newer version
apt-get dist-upgrade is as upgrade but if necessary will add packages needed by the newer versions
apt-get clean cleans up your cache
apt-get autoclean is as clean but only cleans up packages which are obsolete

So what do you do?

Rule 1. Always run apt-get update first
Rule 2. Try apt-get upgrade
Rule 3. If apt-get upgrade told you it could not update something try dist-upgrade
Rule 4. If you are short of space run apt-get clean

If you are really nervous there is an option (I think -s) which tells you what apt-get is going to do but does not actually do it.

Good luck
Michael

User avatar
Felim_Doyle
Posts: 9
Joined: Mon Oct 15, 2012 3:08 pm
Location: Aylesbury, Buckinghamshire, UK
Contact: ICQ Yahoo Messenger AOL

Re: Re-applying a failed apt-get upgrade or dist-upgrade

Tue Nov 13, 2012 2:50 pm

Okay, thanks, that clarifies things a bit. I have used apt-get in the past on other systems but only for the most rudimentary of tasks such as installing a handful of packages.

Does apt-get keep a journal of operations it has performed? How does apt-get decide that something has been installed or upgraded? Can I force it to re-install or upgrade a package after a failed attempt such as mine due to lack of storage?
Félim
Aylesbury, Buckinghamshire, UK

User avatar
Felim_Doyle
Posts: 9
Joined: Mon Oct 15, 2012 3:08 pm
Location: Aylesbury, Buckinghamshire, UK
Contact: ICQ Yahoo Messenger AOL

Re: Re-applying a failed apt-get upgrade or dist-upgrade

Tue Nov 13, 2012 3:11 pm

plugwash wrote:Honestly unless you actually get errors I wouldn't worry too much about it if something goes really wrong apt will generally abort.

What you may have been seeing is it trying to regenerate the manpages database and failing. This part of the process runs as a normal user and because of the linux concept of reserving some space for root's use only the manpage regeneration hits out of disk space errors long before the rest of the upgrade process (which runs as root) does.
So everything may be up to date apart from the man pages database? Will this be rebuilt automatically the next time I perform an upgrade?

What if an apt-get process terminates prematurely, does it pick up where it left off the next time it is invoked?
Félim
Aylesbury, Buckinghamshire, UK

Return to “Raspbian”