Common Operations
Total Page:16
File Type:pdf, Size:1020Kb
Kunpeng Porting Advisor 2.3.T10 Common Operations Date 2021-06-30 Kunpeng Porting Advisor Common Operations Contents Contents 1 Configuring the Installation Environment........................................................................ 1 1.1 Configuring the OS Yum, APT, or Zypper Source......................................................................................................... 1 1.2 Upgrading Dependency Components of an Earlier OS..............................................................................................4 2 Importing the Root Certificate for Kunpeng Porting Advisor...................................... 8 3 Disabling SELinux.................................................................................................................. 14 4 Common Container Operations......................................................................................... 15 5 Changing the IP Address and Port Number of the Kunpeng Porting Advisor........17 6 Starting, Stopping, or Restarting Services...................................................................... 19 7 Exception Scenarios and Common Syntax Errors in Inline Assembly....................... 20 7.1 Exception Scenarios..............................................................................................................................................................20 7.2 Common Syntax Errors....................................................................................................................................................... 22 8 Identifying Compile Commands Using the Build Tool Configuration File...............24 9 Querying OS Version Information.....................................................................................26 2021-06-30 ii Kunpeng Porting Advisor Common Operations 1 Configuring the Installation Environment 1 Configuring the Installation Environment 1.1 Configuring the OS Yum, APT, or Zypper Source 1.2 Upgrading Dependency Components of an Earlier OS 1.1 Configuring the OS Yum, APT, or Zypper Source NO TICE If the OS environment can access the Internet and the default Yum, APT, or Zypper source of the OS is available, skip this section. Configuring the OS Yum Source (for CentOS/EulerOS/openEuler/RHEL/ NeoKylin/Kylin) The following describes how to configure the Yum source on CentOS 7.6. The configuration procedure is the same for other OSs. Step 1 Download the CentOS image file CentOS-7-x86_64-Everything-1810.iso from the official CentOS website. Step 2 Use an SSH remote login tool to upload the CentOS 7.6 image to the /root directory. Step 3 Use the SSH remote login tool to log in to the CentOS CLI. Step 4 Run the following command to mount the CentOS 7.6 ISO image to a local directory: mount /root/CentOS-7-x86_64-Everything-1810.iso /media -o loop NO TICE If the OS is restarted, you need to mount the image file again. 2021-06-30 1 Kunpeng Porting Advisor Common Operations 1 Configuring the Installation Environment Step 5 Run the following commands to back up the original Yum source. In the mv command, path indicates the backup directory. Replace it with the actual backup directory. cd /etc/yum.repos.d/ //Go to the Yum source configuration directory. mv ./* path //Back up the original Yum source configuration. Step 6 Configure the Yum source. 1. Run the following command to open the media.repo file. vi /etc/yum.repos.d/media.repo 2. Press i to make the media.repo file editable and add the following information to the file: [InstallMedia] name=CentOS7.6 metadata_expire=-1 gpgcheck=0 cost=500 baseurl=file:///media enabled=1 3. Press Esc, type :wq and press Enter to save the settings and exit. Step 7 Update the local cache information of the Yum source. yum clean all yum makecache ----End Configuring the APT Source (for Ubuntu/Debian/Deepin/Linx/UOS) The following describes how to configure the APT source on Ubuntu 18.04.1. The configuration procedure is the same for other OSs. Step 1 Download the Ubuntu image file ubuntu-18.04.1-server-amd64.iso from the Ubuntu official website. Step 2 Use the SSH remote login tool to upload the Ubuntu 18.04.1 image to the /root directory. Step 3 Use the SSH remote login tool to log in to the Ubuntu CLI. Step 4 Run the following command to mount the Ubuntu 18.04.1 ISO image file to a local directory: mount /root/ubuntu-18.04.1-server-amd64.iso /media -o loop NO TICE ● If the OS is restarted, you need to mount the image file again. ● Some installation packages are missing in the local image sources of Debian OSs. Download the required installation packages from the Internet or using a proxy. The dependencies are listed as follows: expect GCC make zlib1g zlib1g-dev libpcre3 libpcre3-dev OpenSSL libssl-dev If the OS cannot access the Internet or have a proxy configured, check, download, and install the dependencies manually. You can run the following commands to query and install dependency packages: dpkg -l Installation package name dpkg -i Installation package name 2021-06-30 2 Kunpeng Porting Advisor Common Operations 1 Configuring the Installation Environment Step 5 Back up the original APT source: cd /etc/apt //Go to the APT source configuration directory. mv -v sources.list{,.bak} //Back up the original APT source configuration. Step 6 Configure the APT source. 1. Run the following command to open the source.list file. vim sources.list 2. Add the following information to the source.list file: deb file:///media wheezy main NO TE In the preceding command, wheezy main is the directory in which Packages is located. Replace it with the actual directory. 3. Press Esc, type :wq, and press Enter to save the settings and exit. Step 7 Update the local cache information of the APT source. apt update ----End Configuring the Zypper Source (for SUSE) Step 1 Download the SUSE image file SLE-15-SP1-Packages-x86_64-GM-DVD1.iso from the SUSE official website. Step 2 Use an SSH remote login tool to upload the SUSE image to the /root directory. Step 3 Use the SSH remote login tool to log in to the SUSE CLI. Step 4 Run the following command to mount the SUSE ISO image file to a local directory: mount /root/SLE-15-SP1-Packages-x86_64-GM-DVD1.iso /media -o loop NO TICE If the OS is restarted, you need to mount the image file again. Step 5 Run the following command to add the local Zypper source ("local" is the local source name in the following example): zypper ar file:///media/ local Step 6 Check whether the local source is configured successfully: zypper lr If command output is displayed, the local source is configured successfully. Repository priorities are without effect. All enabled repositories share the same priority. # | Alias | Name | Enabled | GPG Check | Refresh --+-------+-------+---------+-----------+-------- 1 | local | local | Yes | ( p) Yes | No Step 7 Clear the local cache and refresh the image source. zypper clean zypper ref ----End 2021-06-30 3 Kunpeng Porting Advisor Common Operations 1 Configuring the Installation Environment 1.2 Upgrading Dependency Components of an Earlier OS Upgrading glibc This procedure applies to the following OSs: ● CentOS 6.5/6.9/6.10 ● RHEL 6.5/6.9/6.10 ● Deepin 15.2 x86 Step 1 Download the following glibc-related RPM packages: ● glibc-common-2.17-55.el6.x86_64.rpm ● glibc-utils-2.17-55.el6.x86_64.rpm ● glibc-headers-2.17-55.el6.x86_64.rpm ● glibc-static-2.17-55.el6.x86_64.rpm ● glibc-devel-2.17-55.el6.x86_64.rpm ● glibc-2.17-55.el6.x86_64.rpm ● nscd-2.17-55.el6.x86_64.rpm URL: https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/ epel-6-x86_64/glibc-2.17-55.fc20/ Step 2 Upload the related RPM packages to a directory on the server and run the cd command to switch to the directory. Step 3 Run the following commands to install glibc: rpm -ivh glibc-common-2.17-55.el6.x86_64.rpm rpm -ivh glibc-utils-2.17-55.el6.x86_64.rpm rpm -ivh glibc-headers-2.17-55.el6.x86_64.rpm rpm -ivh glibc-static-2.17-55.el6.x86_64.rpm rpm -ivh glibc-devel-2.17-55.el6.x86_64.rpm rpm -ivh glibc-2.17-55.el6.x86_64.rpm rpm -ivh nscd-2.17-55.el6.x86_64.rpm NO TE If dependencies need to be installed, run the following command to install dependencies first: yum install After the dependencies are installed, run the following commands to install glibc: rpm -ivh glibc-common-2.17-55.el6.x86_64.rpm --force --nodeps rpm -ivh glibc-utils-2.17-55.el6.x86_64.rpm --force --nodeps rpm -ivh glibc-headers-2.17-55.el6.x86_64.rpm --force --nodeps rpm -ivh glibc-static-2.17-55.el6.x86_64.rpm --force --nodeps rpm -ivh glibc-devel-2.17-55.el6.x86_64.rpm --force --nodeps rpm -ivh glibc-2.17-55.el6.x86_64.rpm --force --nodeps rpm -ivh nscd-2.17-55.el6.x86_64.rpm --force --nodeps Step 4 After the installation is complete, run the following command to check the glibc version: ldd --version 2021-06-30 4 Kunpeng Porting Advisor Common Operations 1 Configuring the Installation Environment If the displayed version is the same as the version you installed, glibc is upgraded successfully. ----End Upgrading glibcxx This procedure applies to the following OSs: ● CentOS 6.5/6.9/6.10 ● RHEL 6.5/6.9/6.10 ● Deepin 15.2 x86 Step 1 Download the following RPM packages related to glibcxx: ● libstdc++-4.8.2-16.3.el6.x86_64.rpm ● libstdc++-devel-4.8.2-16.3.el6.x86_64.rpm ● libstdc++-static-4.8.2-16.3.el6.x86_64.rpm URL: https://copr-be.cloud.fedoraproject.org/results/mosquito/myrepo-el6/ epel-6-x86_64/glibc-2.17-55.fc20/ Step 2 Upload the related RPM packages to a directory on the server and run the cd command to switch to the directory. Step 3 Run the following commands to install glibcxx: