To install Bootstrap 5 with Webpacker in a Ruby on Rails 6 application on Ubuntu, follow these steps:1. Open the terminal2. Add Bootstrap using the command 'yarn add bootstrap'3. Check Bootstrap's installation using the command 'yarn info bootstrap version'4. Add Popper.js using the command 'yarn add @popperjs/core'