• Skip to main content

Uly.me

cloud engineer

  • Home
  • About
  • Archives

updates

Ansible Run Updates

June 18, 2020

Here’s a simple adhoc to run updates on systems in Ansible.

ansible servers -m apt -a "upgrade=yes update_cache=yes" -b

ansible servers -m apt -a "upgrade=yes update_cache=yes" -b

Results:

server | SUCCESS => {
    "changed": false, 
    "msg": "Reading package lists...
     Building dependency tree...
     Reading state information...
     Calculating upgrade...
     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.", 
    "stderr": "", 
    "stderr_lines": [], 
    "stdout": "Reading package lists...
     Building dependency tree...
     Reading state information...
     Calculating upgrade...
     0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.", 
    "stdout_lines": [
        "Reading package lists...", 
        "Building dependency tree...", 
        "Reading state information...", 
        "Calculating upgrade...", 
        "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded."
    ]
}

server | SUCCESS => { "changed": false, "msg": "Reading package lists... Building dependency tree... Reading state information... Calculating upgrade... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.", "stderr": "", "stderr_lines": [], "stdout": "Reading package lists... Building dependency tree... Reading state information... Calculating upgrade... 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.", "stdout_lines": [ "Reading package lists...", "Building dependency tree...", "Reading state information...", "Calculating upgrade...", "0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded." ] }

If you want to reboot a remote server.

ansible servers -m "reboot" -b

ansible servers -m "reboot" -b

Filed Under: Cloud, Linux Tagged With: adhoc, ansible, reboot, updates, upgrades

Packages Have Been Kept Back

January 24, 2017

What do you do when you get this message “the following packages are being kept back.” And what exactly does it mean?

When performing updates in Ubuntu, you typically run these two commands from the command line.

$ sudo apt-get update
$ sudo apt-get upgrade

$ sudo apt-get update $ sudo apt-get upgrade

If there are updates, it will sometimes ask you to type “Y” or “yes.”

Sometimes you get this message.

$ sudo apt-get upgrade                                                                                                
Reading package lists... Done                                                                                                          
Building dependency tree                                                                                                               
Reading state information... Done                                                                                                      
The following packages have been kept back:                                                                                            
  linux-headers-server linux-image-server linux-server                                                                                 
0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

$ sudo apt-get upgrade Reading package lists... Done Building dependency tree Reading state information... Done The following packages have been kept back: linux-headers-server linux-image-server linux-server 0 upgraded, 0 newly installed, 0 to remove and 3 not upgraded.

This means that these packages were not installed or kept back because they have additional packages that are introduced, and the upgrades depend on them.

You can fix this by running:

$ sudo apt-get dist-upgrade

$ sudo apt-get dist-upgrade

Or you can individually install the packages you want instead of globally.

$ sudo apt-get install package-name

$ sudo apt-get install package-name

Filed Under: Linux Tagged With: updates

Linode Linux Package Mirrors

November 26, 2014

One way to speed up the Linux package updates is to use a package mirror made available by Linode. They are hosted in all six of their data centers. Just pick a data center where your data is Linode server is located by doing the following.

Edit your sources list

sudo nano /etc/apt/sources.list

sudo nano /etc/apt/sources.list

Search and replace

# Replace this address 
http://us.archive.ubuntu.com/ubuntu/ 
 
# with the new address 
http://fremont.mirrors.linode.com/ubuntu/
 
# you can also use this - returns round robin of all locations
http://mirrors.linode.com/ubuntu/

# Replace this address http://us.archive.ubuntu.com/ubuntu/ # with the new address http://fremont.mirrors.linode.com/ubuntu/ # you can also use this - returns round robin of all locations http://mirrors.linode.com/ubuntu/

The next time you run a Linux update, it will be significantly faster.

sudo apt-get update
sudo apt-get upgrade

sudo apt-get update sudo apt-get upgrade

Filed Under: Linux Tagged With: linode, packages, sources, updates

  • Home
  • About
  • Archives

Copyright © 2023