Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

Let's say I want to install something big... (kde for example) but I'm doing it in a place with a very poor internet conection, so I want to stop it, and doing it later. But I don't want to start all over again. Can it be done?

share|improve this question

3 Answers 3

up vote 7 down vote accepted

Do apt-get install -d STUFF which will download everything to the cache but won't act on it.

Later when you have a better connection you can just drop the -d and apt will download the rest if needed and begin installing from the cache: /var/cache/apt/archives/

share|improve this answer

If you kill an apt-get while it's still in the stage of fetching packages then yes, it will resume fetching pretty much from where it left off - the archvies it has fetched so far will be kept in /var/cache/apt/archives.

This is the directory that gets cleaned up by apt-get clean, incidentally.

If you kill it after it's finished fetching and has started configuring/installing then you're in much deeper water and I wouldn't really want to try it ;)

share|improve this answer

Or, start the installation with GNU Screen. Just run screen by itself, and it will open a new window with a shell inside it. If you run commands here, then press Ctrl-d (^d), the window will "detach" from your current terminal, but it will stay running in the background: run screen -x to get back to it.

This also works for long-running command such as apt-get install [all of KDE]: just start the apt-get install command inside a screen window and press ^d. Then later, simply re-attach using screen -x and see if it's done.

Screen has much more options: ^a c will create new windows (use ^a 1 to go to the first one, ^a n to go to the one "to the right", etc). See http://www.gnu.org/software/screen/manual/ for the manual!

Edit: Of course, the computer running screen windows cannot be restarted, or the windows will be lost.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.