Check for issues on package commands (Linux)

Prev Next

Available in VPC

This page describes how to inspect when a specific package command doesn't work properly when using a Linux server.

Caution
  • NAVER Cloud Platform doesn't support checking whether the settings in the server or the packages are normal after the server is created.
  • We recommend referring to the latest official documentation about the Linux release version in use.

To compare normal commands, build a new server with the same OS version, run the commands, and compare the results. This guide describes using the awk command as an example.

NAVIX, CentOS, Rocky Linux

  1. Remotely access the server where the command execution issue occurs and the new server.

  2. Compare and check the location of the corresponding command and the information on the installed package.

    [root@rockylinux9 ~]# which awk
    /usr/bin/awk
    
    [root@rockylinux9 ~]# ls -l /usr/bin/awk
    lrwxrwxrwx. 1 root root 4 May 13  2022 /usr/bin/awk -> gawk
    
    [root@rockylinux9 ~]# ls -l /usr/bin/gawk
    -rwxr-xr-x. 1 root root 714968 May 13  2022 /usr/bin/gawk
    
    [root@rockylinux9 ~]# rpm -qf /usr/bin/gawk
    gawk-5.1.0-6.el9.x86_64
    
  3. Check the changes after the package is installed using the rpm -V or rpm --verify command.
    If it is normal, no output occurs as a result of running the command.

    [root@rockylinux9 ~]# rpm -V gawk-5.1.0-6.el9.x86_64
    [root@rockylinux9 ~]#  
    

    When there are problems, you can check the following output results.

       S file Size differs
       M Mode differs (includes permissions and file type)
       5 digest (formerly MD5 sum) differs
       D Device major/minor number mismatch
       L readLink(2) path mismatch
       U User ownership differs
       G Group ownership differs
       T mTime differs
       P caPabilities differ
    

    Each item indicates changes, and you can see these outputs and check the changes to the package to resolve the issue.
    The following example shows the changes to the package by changing the permissions of the /usr/bin/gawk file:

    [root@rockylinux9 ~]# ls -l /usr/bin/gawk
    -rwxr-xr-x. 1 root root 714968 May 13  2022 /usr/bin/gawk
    
    [root@rockylinux9 ~]# chmod o-x /usr/bin/gawk
    
    [root@rockylinux9 ~]# ls -l /usr/bin/gawk
    -rwxr-xr--. 1 root root 714968 May 13  2022 /usr/bin/gawk
    
    [root@rockylinux9 ~]# rpm -V gawk-5.1.0-6.el9.x86_64 
    .M.......    /usr/bin/gawk
    

    In the output results, .M....... indicates Mode differs.
    This allows you to check that the package is changed because the permissions upon initial installation and the current permissions are different.

  4. To compare the library that the command of a specific package refers to, use the ldd command to check the library of the command.

    [root@rockylinux9 ~]# ldd /usr/bin/gawk
        linux-vdso.so.1 (0x00007ffcb51b0000)
        libsigsegv.so.2 => /lib64/libsigsegv.so.2 (0x00007f677502f000)
        libreadline.so.8 => /lib64/libreadline.so.8 (0x00007f6774fd7000)
        libmpfr.so.6 => /lib64/libmpfr.so.6 (0x00007f6774f27000)
        libgmp.so.10 => /lib64/libgmp.so.10 (0x00007f6774e82000)
        libm.so.6 => /lib64/libm.so.6 (0x00007f6774da7000)
        libc.so.6 => /lib64/libc.so.6 (0x00007f6774a00000)
        libtinfo.so.6 => /lib64/libtinfo.so.6 (0x00007f6774d75000)
        /lib64/ld-linux-x86-64.so.2 (0x00007f67750f3000)
    
  5. If you can't find the cause of the error, install the corresponding package.

    Note

    When you reinstall the package, check whether it is the same version of the existing package.

    The following example shows the procedure for deleting a specific file of httpd (apache web server), re-installing, and recovering the package.

    [root@rockylinux9 ~]# rpm -qa | grep httpd
    httpd-tools-2.4.62-4.el9.x86_64
    httpd-filesystem-2.4.62-4.el9.noarch
    httpd-core-2.4.62-4.el9.x86_64
    rocky-logos-httpd-90.16-1.el9.noarch
    httpd-2.4.62-4.el9.x86_64
    
    [root@rockylinux9 ~]# rm -i /usr/share/man/man8/apachectl.8.gz
    rm: remove regular file '/usr/share/man/man8/apachectl.8.gz'? y
    
    [root@rockylinux9 ~]# rpm -V httpd
    missing   d /usr/share/man/man8/apachectl.8.gz
    
    [root@rockylinux9 ~]# dnf reinstall httpd
    Last metadata expiration check: 0:12:37 ago on Fri 04 Jul 2025 03:31:40 PM KST.
    Dependencies resolved.
    ===========================================================================================
    Package           Architecture       Version                  Repository             Size
    ===========================================================================================
    Reinstalling:
    httpd             x86_64             2.4.62-7.el9             appstream              44 k
    
    Transaction Summary
    ===========================================================================================
    Total download size: 45 k
     Installed size: 59 k
     Is this ok [y/N]: y
    ... Omitted ...
     Reinstalled:
      httpd-2.4.62-7.el9.x86_64
    
    Complete!
    
    [root@rockylinux9 ~]# rpm -V httpd
    [root@rockylinux9 ~]#
    

Ubuntu

  1. Remotely access the server where the command execution issue occurs and the new server.
  2. Compare and check the location of the corresponding command and the information on the installed package.
    root@ubuntu2404:~# which awk
    /usr/bin/awk
    
    root@ubuntu2404:~# ls -l /usr/bin/awk
    lrwxrwxrwx 1 root root 21 Apr  9  2024 /usr/bin/awk -> /etc/alternatives/awk
    
    root@ubuntu2404:~# ls -l /etc/alternatives/awk
    lrwxrwxrwx 1 root root 13 Aug 27  2024 /etc/alternatives/awk -> /usr/bin/gawk
    
    root@ubuntu2404:~# ls -l /usr/bin/gawk
    -rwxr-xr-x 1 root root 739840 Mar 31  2024 /usr/bin/gawk
    
    root@ubuntu2404:~# dpkg -S /usr/bin/gawk
    gawk: /usr/bin/gawk
    
    root@ubuntu2404:~# dpkg -l gawk
    Desired=Unknown/Install/Remove/Purge/Hold
    | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
    |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
    ||/ Name           Version         Architecture Description
    +++-==============-===============-============-===================================================
    ii  gawk           1:5.2.1-2build3 amd64        GNU awk, a pattern scanning and processing language
    
  3. Check the changes after the package is installed using the dpkg -V or dpkg --verify command.
    If it is normal, no output occurs as a result of running the command.
    root@ubuntu2404:~# dpkg -V gawk
    root@ubuntu2404:~#
    
    When there are problems, you can check the following output results. For Ubuntu, you can currently check the changes only for the results of checking md5sum.
       5 digest (formerly MD5 sum) differs
    
    The following example describes the changes to the package by changing the content of the /usr/share/doc/gawk/README file.
    root@ubuntu2404:~# ls -l /usr/share/doc/gawk/README
    -rw-r--r-- 1 root root 3890 Aug 27  2024 /usr/share/doc/gawk/README
    
    root@ubuntu2404:~# sed -i '$a TEST...' /usr/share/doc/gawk/README
    
    root@ubuntu2404:~# ls -l /usr/share/doc/gawk/README
    -rw-r--r-- 1 root root 3898 Jul  4 15:36 /usr/share/doc/gawk/README
    
    root@ubuntu2404:~# dpkg -V gawk
    ??5??????   /usr/share/doc/gawk/README
    
    In the output results, ??5?????? indicates 5 digests. This allows you to check that the file has been changed from the initial installation because the result value of md5sum is different.
  4. To compare the library that the command of a specific package refers to, use the ldd command to check the library of the command.
    root@ubuntu2404:~# ldd /usr/bin/gawk
        linux-vdso.so.1 (0x00007ffc22590000)
        libsigsegv.so.2 => /lib/x86_64-linux-gnu/libsigsegv.so.2 (0x000077e75eb5a000)
        libreadline.so.8 => /lib/x86_64-linux-gnu/libreadline.so.8 (0x000077e75eb05000)
        libmpfr.so.6 => /lib/x86_64-linux-gnu/libmpfr.so.6 (0x000077e75ea4a000)
        libgmp.so.10 => /lib/x86_64-linux-gnu/libgmp.so.10 (0x000077e75e9c6000)
        libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x000077e75e8dd000)
        libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x000077e75e600000)
        libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6 (0x000077e75e8a7000)
        /lib64/ld-linux-x86-64.so.2 (0x000077e75eb68000)
    
  5. If you can't find the cause of the error, install the corresponding package.
    Note

    When you reinstall the package, check whether it is the same version of the existing package.

    The following example shows the procedure for deleting a specific file of httpd (apache web server), re-installing, and recovering the package.
    root@ubuntu2404:~# dpkg -l |grep apache2
    ii  apache2                              2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server
    ii  apache2-bin                          2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server (modules and other binary files)
    ii  apache2-data                         2.4.58-1ubuntu8.6                       all          Apache HTTP Server (common files)
    ii  apache2-utils                        2.4.58-1ubuntu8.6                       amd64        Apache HTTP Server (utility programs for web servers)
    
    root@ubuntu2404:~# rm -i /usr/share/man/man1/a2query.1.gz
    rm: remove regular file '/usr/share/man/man1/a2query.1.gz'? y
    
    root@ubuntu2404:~# dpkg -V apache2
    missing     /usr/share/man/man1/a2query.1.gz
    
    root@ubuntu2404:~# apt install --reinstall apache2
    Reading package lists... Done
    Building dependency tree... Done
    Reading state information... Done
    0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 228 not upgraded.
    Need to get 90.2 kB of archives.
    After this operation, 0 B of additional disk space will be used.
    Get:1 http://repo.ncloud.com/ubuntu noble-updates/main amd64 apache2 amd64 2.4.58-1ubuntu8.6 [90.2 kB]
    
    ... Omitted ...
    
    Preparing to unpack .../apache2_2.4.58-1ubuntu8.6_amd64.deb ...
    Unpacking apache2 (2.4.58-1ubuntu8.6) over (2.4.58-1ubuntu8.6) ...
    Setting up apache2 (2.4.58-1ubuntu8.6) ...
    Processing triggers for man-db (2.12.0-4build2) ...
    Processing triggers for ufw (0.36.2-6) ...
    Scanning processes...                                                                                                                                                 
    Scanning linux images...
    
    root@ubuntu2404:~# dpkg -V apache2
    root@ubuntu2404:~#