Installing, Upgrading, and Uninstalling the CANN Package (.deb)

The .deb format can be operated only with the root permission. Non-root users need to use the privilege escalation command and obtain the required sudo permission. After using the command, cancel the permission for high-risk commands. Otherwise, sudo privilege escalation may occur.

Installation and Upgrade

The installation and upgrade processes are the same for xxx.deb package. The procedure is as follows:
  1. Log in to the server as the installation user.
  2. Install the .deb package. (Replace xxx.deb with the actual full name of the software package.)
    • If you install the package as the root user, run the following command:
      1
      dpkg -i xxx.deb
      
    • If you install the package as a non-root user, run the following command:
      1
      sudo -E dpkg -i xxx.deb
      

      After the preceding command is executed, enter Y or y to agree to the Huawei Enterprise End User License Agreement (EULA) to continue the installation.

    • The CANN package in .deb format complies with the common DEB rules. After the package has been installed, other users can use it. If --install-for-all is not carried during driver installation and the CANN package running user is not root, the group of the CANN package running user must be the same as that of the driver running user. If they are different, add the CANN package running user to the group of the driver running user.
    • After the installation is complete, run the apt list | grep nnrt command to query the software package installation information. The following uses the NNRT software package as an example.
    • The CANN package in .deb format can be installed only in the default path /usr/local/Ascend.

Uninstallation

To uninstall the NNRT software (xxx.deb package), run the following command.
  • dpkg mode:
    • root user:
      1
      dpkg -P ascend-cann-nnrt
      
    • Non-root user (obtain the required sudo permission):
      1
      sudo -E dpkg -P ascend-cann-nnrt
      
  • apt mode:
    • root user:
      1
      apt remove ascend-cann-nnrt
      
    • Non-root user (obtain the required sudo permission):
      1
      sudo -E apt remove ascend-cann-nnrt