What Should I Do If the swig Dependency Package Cannot Be Installed?

Symptom

If the swig dependency package fails to be installed during TF Serving build, the error message shown below is displayed:

E :The package ascend-cann-toolkit needs to be reinstalled, but I cant`t  find an archive for it.

Solutions

Perform the following steps to reinstall the swig dependency package:

  1. Back up /var/lib/dpkg/status.
    cp /var/lib/dpkg/status /{newfilepath}/status

    {newfilepath} indicates the path to be backed up. Set it based on the actual situation.

  2. Open the /var/lib/dpkg/status file, locate the record of the software package that fails to install, and remove the record. Figure 1 is an example of software package records.
    vim /var/lib/dpkg/status
    Figure 1 Software package record
  3. Reinstall swig.
    apt install swig