如何修复 apt-get:在 Ubuntu 18.10 中未找到命令?

如何修复 apt-get:在 Ubuntu 18.10 中未找到命令?

我尝试使用sudo apt-get命令在 Ubuntu 18.10 中安装软件,但它给出了错误 – apt-get: command not found。我使用locate apt-get并发现 apt-get 位于/usr/bin,它在 中$PATH。它仍然给了我错误。我该怎么办?

$ sudo apt-get
sudo: apt-get: command not found
$ locate apt-get
/snap/core/5662/usr/local/bin/apt-get
/snap/core/5662/usr/share/bash-completion/completions/apt-get
/snap/core/5662/usr/share/bash-completion/completions/slapt-get
/snap/core/5897/usr/local/bin/apt-get
/snap/core/5897/usr/share/bash-completion/completions/apt-get
/snap/core/5897/usr/share/bash-completion/completions/slapt-get
/snap/core/6130/usr/local/bin/apt-get
/snap/core/6130/usr/share/bash-completion/completions/apt-get
/snap/core/6130/usr/share/bash-completion/completions/slapt-get
/usr/local/bin/apt-get
/usr/share/bash-completion/completions/apt-get
/usr/share/bash-completion/completions/slapt-get
/usr/share/man/de/man8/apt-get.8.gz
/usr/share/man/fr/man8/apt-get.8.gz
/usr/share/man/it/man8/apt-get.8.gz
/usr/share/man/ja/man8/apt-get.8.gz
/usr/share/man/man8/apt-get.8.gz
/usr/share/man/nl/man8/apt-get.8.gz
$ echo $PATH
/home/guan/anaconda3/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin
:/bin:/usr/games:/usr/local/games:/snap/bin

相关内容