这时候我们发现apt文件的归属不对,这里改一下,然后将其扔到/usr/local/bin/,然后查看有没有生效。
linuxidc@ubuntu:~$ sudo chown root:root apt [sudo] password for linuxidc: lwk@ubuntu:~$ ll total 44 drwxr-xr-x 4 linuxidc lwk 4096 Nov 23 00:48 ./ drwxr-xr-x 3 root root 4096 Nov 10 11:20 ../ -rwxr-xr-x 1 root root 6329 Nov 23 00:48 apt* -rw------- 1 linuxidc lwk 3479 Nov 23 00:03 .bash_history -rw-r--r-- 1 linuxidc lwk 220 Nov 10 11:20 .bash_logout -rw-r--r-- 1 linuxidc lwk 3771 Nov 10 11:20 .bashrc drwx------ 2 linuxidc lwk 4096 Nov 10 11:30 .cache/ -rw-r--r-- 1 linuxidc lwk 655 Nov 10 11:20 .profile drwx------ 2 linuxidc lwk 4096 Nov 10 11:42 .ssh/ -rw-r--r-- 1 linuxidc lwk 0 Nov 10 11:38 .sudo_as_admin_successful -rw------- 1 root root 3433 Nov 23 00:00 .viminfo linuxidc@ubuntu:~$ sudo mv apt /usr/local/bin/ linuxidc@ubuntu:~$ apt apt Usage: apt command [options] apt help command [options] Commands: add-repository - Add entries to apt sources.list autoclean - Erase old downloaded archive files autoremove - Remove automatically all unused packages build - Build binary or source packages from sources build-dep - Configure build-dependencies for source packages changelog - View a package's changelog check - Verify that there are no broken dependencies clean - Erase downloaded archive files contains - List packages containing a file content - List files contained in a package deb - Install a .deb package depends - Show raw dependency information for a package dist-upgrade - Upgrade the system by removing/installing/upgrading packages download - Download the .deb file for a package edit-sources - Edit /etc/apt/sources.list with your preferred text editor dselect-upgrade - Follow dselect selections full-upgrade - Same as 'dist-upgrade' held - List all held packages help - Show help for a command hold - Hold a package install - Install/upgrade packages list - List packages based on package names policy - Show policy settings purge - Remove packages and their configuration files recommends - List missing recommended packages for a particular package rdepends - Show reverse dependency information for a package reinstall - Download and (possibly) reinstall a currently installed package remove - Remove packages search - Search for a package by name and/or expression show - Display detailed information about a package showhold - Same as 'held' source - Download source archives sources - Same as 'edit-sources' unhold - Unhold a package update - Download lists of new/upgradable packages upgrade - Perform a safe upgrade version - Show the installed version of a package linuxidc@ubuntu:~$至此,我们发现已经将Linux Mint 18.2 Sonya系统中的apt命令成功迁移到了Ubuntu Server 16.04.3 LT系统。