Use whichever works for you, this is just to show you the most common form. You use -u user and -K (ask for privilege escalation password). If you need a new version of a tool, or hear about a security update, that may speed up the timetable. This is an example of typical privilege escalation through Ansible. Updating Kali When should you update Kali If you have a default installation of Kali, you should be checking for updates every few weeks. Note that I am using -become and become: true. To do this as an ad-hoc command you can run: $ ansible all -m apt -a "upgrade=yes update_cache=yes cache_valid_time=86400" -becomeĪd-hoc commands are described in detail here So it's good to include if you don't want to update the cache when it has only recently been updated. It’s important to note that running the upgrade command may require a system reboot, significantly if the kernel is upgraded. Or using the newer method with full-upgrade command: sudo apt update sudo apt full-upgrade. Let us see what I mean in action by taking a look at the command line apt-get update. Otherwise use apt-get update followed by apt-get dist-upgrade (or aptitude full-upgrade ). In the apt command the update sub-command does the job of Building dependency tree while in the apt-get command this job is given to the upgrade sub-command. If youre just installing security updates and bug fixes, use apt-get update followed by apt-get upgrade (or aptitude safe-upgrade ). Update the apt cache if its older than the cache_valid_time. Here’s how you can do it: sudo apt-get update sudo apt-get dist-upgrade. In summary: If upgrading between Ubuntu releases, use do-release-upgrade. The cache_valid_time value can be omitted. In a playbook, you can update and upgrade like so: - name: Update and upgrade apt packages I wouldn't recommend using shell for this, as Ansible has the apt module designed for just this purpose.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |