# Upgrading TD Agent Upgrade Treasure Agent (`td-agent`) regularly to keep the daemon current. * [Prerequisites](/products/customer-data-platform/integration-hub/streaming/td-agent/upgrading-td-agent#prerequisites) * [Upgrade](/products/customer-data-platform/integration-hub/streaming/td-agent/upgrading-td-agent#upgrade) * [Considerations](/products/customer-data-platform/integration-hub/streaming/td-agent/upgrading-td-agent#considerations) # Prerequisites * Basic knowledge of Treasure Data. * Basic knowledge of td-agent. # Upgrade BugFix version upgrades are indicated in this format: Major.Minor.BugFix. For example 2.2.2 to 2.2.3. The last number is incremented. Use `apt` (Ubuntu) or `yum` (RHEL, CentOS) to upgrade the td-agent package. ```bash # Ubuntu $ apt-get update && apt-get install td-agent # Redhat $ yum update && yum install td-agent ``` Major and Minor version upgrades are indicated in this format: Major.Minor.BugFix, an example from 2.2.2 to 2.3.2 (the middle number is incremented to indicate Minor upgrade) or 2.2.2 to 3.2.2 (the first number is incremented to indicate Major upgrade): Access the appropriate operating system page: * [Upgrading to td-agent on RHEL and CentOS](/products/customer-data-platform/integration-hub/streaming/td-agent/installing-td-agent-on-rhel-and-centos) * [Upgrading td-agent on AWS Linux](/products/customer-data-platform/integration-hub/streaming/td-agent/installing-td-agent-on-aws-linux) * [Upgrading to td-agent-on-Ubuntu](/products/customer-data-platform/integration-hub/streaming/td-agent/installing-td-agent-on-ubuntu-and-debian) # Considerations When updating td-agent, you must restart the daemon. During this time, your application may post logs to `td-agent`. If you’re using [td-logger-ruby](https://api-docs.treasuredata.com/en/sdk/ruby-sdk/quickstart/) or [td-logger-java](https://api-docs.treasuredata.com/en/sdk/java-sdk/quickstart/), the logger library itself buffers the logged events up to a certain amount of data. When the daemon returns, the buffered events are flushed to td-agent. If you’re using other languages, no buffering mechanism is implemented. So if you don’t want to lose your logs, stop your applications first (by separating the app run from your load balancer or terminating the process, and so on) and then upgrade td-agent.