All Products
Search
Document Center

When security center fixes a vulnerability, it prompts "the APT configuration is incorrect. Check the APT configuration."

Last Updated: Dec 30, 2020

Problem description

The following error occurs when security center fixes the vulnerability.

The APT configuration is incorrect. Check the APT configuration.

Cause

If the component is upgraded by using the apt-get command, the related parameters are incorrect.

Solution

Alibaba Cloud reminds you that:

  • Before you perform operations that may cause risks, such as modifying instance configurations or data, we recommend that you check the disaster recovery and fault tolerance capabilities of the instances to ensure data security.
  • You can modify the configurations and data of instances including but not limited to Elastic Compute Service (ECS) and Relational Database Service (RDS) instances. Before the modification, we recommend that you create snapshots or enable RDS log backup.
  • If you have authorized or submitted sensitive information such as the logon account and password in the Alibaba Cloud Management Console, we recommend that you modify such information in a timely manner.

To fix vulnerabilities, you must run the commands provided by security center on the target server and correct them based on the errors reported after the commands are run. In this case study, in order to run the following command to obtained as shown in the figure of the error prompt " e:sub-process/usr/bin/dpkg returned an error code(1) " as an example

apt-get update && apt-get install libx11-6 --only-upgrade

Perform the following steps to fix the issue:

Note: the upgrading of the components is approaching a high-risk operation. To avoid any system damage, we recommend that you create a snapshot backup for the server where the vulnerability to be fixed before performing this operation.

  1. Run the following command to back up the source directory:
    mv /var/lib/dpkg/info /var/lib/dpkg/infobak
  2. Use the following command to create a new directory.
    mkdir /var/lib/dpkg/info
  3. Run the following command.
    apt-get update
  4. Run the following command to resolve the dependency issue.
    sudo apt-get -f install
  5. Run the following command to back up all files:
    mv /var/lib/dpkg/info/* /var/lib/dpkg/infobak
  6. Run the following command to delete the directory:
    rm -rf /var/lib/dpkg/info
  7. Run the following command to restore data to a backup directory:
    mv /var/lib/dpkg/infobak /var/lib/dpkg/info

Application scope

  • Security Center
  • Elastic Compute Service