As announced in Percona’s Important Update, effective July 1st, the percona/original and tools repositories will no longer be updated. This means that users need to check their systems and ensure that the necessary repositories are enabled to maintain the security and reliability of their installations.
Challenges of manual checking
When managing a complex system, ensuring that the software packages are installed from the correct repositories is essential. This helps in maintaining security, receiving timely updates, and ensuring compatibility. However, manually checking the repository sources for your installed packages can be daunting due to several reasons:
- Time-consuming: Manually checking each package individually is extremely time-consuming, especially on systems with a large number of installed packages.
- Prone to human error: The manual process is susceptible to mistakes, such as overlooking certain packages or misinterpreting repository information.
- Lack of comprehensive overview: Manual checking does not provide a comprehensive report of all packages and their repositories, making it difficult to get an overall picture of the system’s package sources.
Given the recent changes announced by Percona, it is crucial to ensure that all necessary repositories are enabled and that packages are installed from the correct sources so that no one ever misses an important update from us. Performing these checks manually can be both daunting and error-prone.
Manual check on RPM-based systems
For RPM-based systems like CentOS, Red Hat, and Fedora, you can manually check which packages are installed from Percona or Tools repositories by using the yum or dnf package manager.
List all installed packages:
1 |
yum list installed |
or
1 |
dnf list installed |
Check the repository for a specific package:
1 |
yum info <package_name> |
or
1 |
dnf info <package_name> |
Look for the From repo field in the output to identify the repository.
For example, to check the percona-toolkit package:
1 |
yum info percona-toolkit |
The output should include a line like:
1 |
From repo : percona-release |
List all packages installed from a specific repository:
1 |
yum list installed | grep @<repository_name> |
or
1 |
dnf list installed | grep @<repository_name> |
For example, to list all packages installed from the percona-release repository:
1 |
yum list installed | grep @percona-release |
Manual check on Debian-based systems
For Debian-based systems like Debian and Ubuntu, you can use the dpkg-query and apt-cache tools.
List all installed packages:
1 |
dpkg-query -W -f='${binary:Package}' |
Check the repository for a specific package:
1 |
apt-cache policy <package_name> |
Look for the http or https lines in the output to identify the repository URL.
For example, to check the percona-toolkit package:
1 |
apt-cache policy percona-toolkit |
The output should include lines like:
1 |
500 http://repo.percona.com/percona/apt focal/main amd64 Packages |
Benefits of running the automated script
At Percona, we care deeply about our users and strive to make their experience seamless. To help our users navigate these changes effortlessly, we have prepared a script that automates checking installed packages and their repositories. This script works for both RPM-based and Debian-based systems. It will also suggest enabling the repositories that are needed automatically.
Key benefits:
- Time-saving: The script automatically checks all installed packages, significantly reducing the time required compared to manual checks.
- Accuracy: The script eliminates the risk of human error by automating the process, ensuring accurate and consistent results.
- Comprehensive reporting: The script provides a detailed report of packages installed from the correct repositories and those that should be installed from different repositories.
- Proactive management: By identifying packages from incorrect repositories, you can proactively manage and rectify the installations, maintaining system integrity and security.
Example output
Here are examples of the script’s output for RPM-based and Debian-based systems.
RPM-based systems
1 2 3 4 5 6 7 8 9 |
Checking installed packages and repositories for RPM-based system... Packages that should be installed from a different repository: - percona-toolkit Possible repositories: pt To enable the necessary repositories, run the following commands: sudo percona-release enable pt release Summary: - 1 packages should be installed from a different repository. - 1 repositories need to be enabled. |
Debian-based systems
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 |
Checking installed packages and repositories for Debian-based system... Packages installed from the correct repositories: - percona-xtrabackup-83 Packages that should be installed from a different repository: - percona-toolkit Possible repositories: pt - pmm2-client Possible repositories: pmm2-client To enable the necessary repositories, run the following commands: sudo percona-release enable pt release sudo percona-release enable pmm2-client release Summary: - 1 packages are installed from the correct repositories. - 2 packages should be installed from a different repository. - 2 repositories need to be enabled. |
Download the script
You can download the script here to automate the process of checking installed packages and their repositories here.
So once you download it, do the following:
1 2 |
chmod +x check_percona_packages.py python3 check_percona_packages.py |
By automating the process with this script, you ensure that your system remains secure and up-to-date with packages installed from the correct repositories, thus maintaining the integrity and reliability of your software environment.