Installing packgaes in the background using yum

8,585

Solution 1

Use the -q flag for the background job to suppress output.

From the yum man pages:

-q, --quiet

Run without output. Note that you likely also want to use -y.

Solution 2

It appears yum is running in the background (evidenced by the [1] 26960 line in the output -- here, 26960 is the process id of the background'd yum), but it is still sending some output to the terminal. To get around this, add an output redirect for stdout and/or stderr as appropriate:

yum -y install ntp >/tmp/yum-out 2>&1 &

Here >/tmp/yum-out redirects the output (stdout) to the file /tmp/yum-out, and the 2>&1 makes error output (stderr) go to the same file. This way, if you want to go back and look at the output later (for example, if an error occured), it's all saved in the /tmp/yum-out file.

Share:
8,585

Related videos on Youtube

yael
Author by

yael

Updated on September 18, 2022

Comments

  • yael
    yael over 1 year

    I want to install packages by yum in the background as the following

    yum -y install ntp &
    

    but this example isn't working and yum installation not installing in the background. How to fix my command in order to enable yum to install the ntp in the background ?

    # yum -y install ntp &
    [1] 26960
    09:03:15 root@ereztest:~ # Loaded plugins: rhnplugin
    This system is receiving updates from RHN Classic or RHN Satellite.
    Setting up Install Process
    Resolving Dependencies
    --> Running transaction check
    ---> Package ntp.x86_64 0:4.2.6p5-10.el6.1 will be installed
    --> Finished Dependency Resolution
    
  • Pooping
    Pooping over 7 years
    If the update command is producing a similar situation, then yes. I added some info in the answer about how to tell that the command is put in the background.