How do I pause/resume download and install from terminal?

I mostly use terminal for installation of programs (as does mostly everybody). However, at times (particularly when I have low battery and no charger wire OR more importantly, when installer file is too big, installation is incomplete and I need to power down my system) I would like to pause the installation (while it is in downloading state) so that I won't loose already downloaded files.

How do I do this?

2

3 Answers

Ctrl+c cancels it but next time start from where you leftCtrl+z stops process but then you can't do another process as it remains locked to the first process

Using one of the above methods is generally better than just closing the terminal, but if you just close the terminal while it's downloading packages, it should start the download right where it stopped next time you run sudo apt-get upgrade

If you want to restart the download after using Ctrl+z:

  1. Check paused tasks by typing jobs in the terminal
  2. To resume a process, type fg
  3. If you have multiple tasks, then type fg 1, fg 2, etc…

Make sure, however, that you never stop it while it's installing the downloaded packages, since this will result in a lock on apt-get, which will require a computer restart or reconfiguration of apt, and you'll have to start at the beginning of the installation. So make sure to only "pause" (close) the terminal when it's downloading, not installing.

If you would like to start another apt-get process - after pausing the first process, run sudo rm /var/lib/dpkg/lock && sudo rm /var/cache/apt/archives/lock; it won't look like it did anything, but you should be able to start another apt-get process.

To kill a command that you've paused with Ctrl+z, enter kill -9 %x into the terminal, replacing x with the number that the paused process is (see jobs). The process will remain in the list, but it will say "killed" after it instead of "stopped", indicating it is no longer active.


Sources : [ubuntu] How to pause download operation in terminal
Accidently pressed Ctrl-Z in a Linux terminal in Ubuntu Intrepid Ipex. What do I do now?Starting, Stopping and Managing Jobs in the Ubuntu Terminal


8

Find the answer on how I solved it here. or follow this link . I run grep VERSION /etc/os-release VERSION="2019.1" VERSION_ID="2019.1" Linux psycho 4.18.0-kali3-amd64 #1 SMP Debian 4.18.20-2kali2 (2018-11-30) x86_64 GNU/Linux

0

If you want to pause the downloaded files from terminal, I hope you have downloading something url. Just copy it first. and enter this lines in that terminal

wget -m -P [download-url]

It can pulse the downloading files. Where as you want to resume to download or even after net is disconnected, want to resume the file. Simply run this in terminal:

wget -c -m -P [brokern url]

or

wget --continue [broken url]
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like