apt get command not found что делать
Ошибка apt-get command not found
В этой статье мы рассмотрим почему возникает такая ошибка, как это вообще может быть и как исправить apt get команда не найдена.
Что значит apt get команда не найдена?
Фактически это сообщение об ошибке означает как раз то, что оно нам сообщает, команда, которую вы пытаетесь выполнить не найдена в системе. Она либо еще не была установлена, либо была удалена. Но все это звучит очень странно в отношении к менеджеру пакетов. Рассмотрим основные причины возникновения ошибки:
Теперь рассмотрим как решить проблему. Это очень просто.
Как исправить apt get команда не найдена?
Поскольку вторая причина предполагает меньше действий, нам нужно сначала проверить ее. Обычно исполняемые файлы apt находятся в каталоге /usr/bin. Сначала посмотрим есть ли такой файл в той папке:
Если файл есть, то вы увидите что-то похожее как на снимке выше. Также обратите внимания на права. Для пользователя, группы и остальных должен быть выставлен флаг «x» означающий исполнение. Если же его нет, то apt придется переустановить. Если права отличаются от приведенных выше, а именно «-rwxr-xr-x», то их тоже нужно исправить, добавим для всех категорий флаг исполняемости:
chmod +x /usr/bin/apt-get
Если предыдущие варианты не сработали проверим содержимое переменной среды PATH:
Вы должны увидеть в ней ссылку на /usr/bin. Если такой строчки нет, то проблема была здесь, а строчку нужно добавить в конец:
Если вы вносили изменения в файл /etc/profile, и переменная PATH сломалась из-за этого, то нужно внести исправления и в этот файл.
Последний вариант, если ничего не помогло, это переустановить утилиту. Мы просто скачаем ее из официального сайта и установим в систему. Только нужно выбирать версию для своей операционной системы. Вы можете скачать пакет с помощью браузера или таких команд:
Для Ubuntu Yakkety:
Теперь осталось установить загруженный пакет:
Готово, после этого ошибка apt get command not found должна исчезнуть и вы сможете нормально работать со своими пакетами.
Выводы
В этой статье мы рассмотрели почему не работает apt get, из-за чего возникает ошибка apt get команда не найдена, а также как ее решить. Надеюсь, приведенная здесь информация была полезной для вас.
apt-get command not found in Linux
The APT (Advanced Package Tools) is a package manager used for managing packages of Debian-based operating systems and its derivatives, such as Ubuntu. APT can be used to install, update the OS and remove applications. While working with APT a common error that is encountered is “apt-get command not found”.
This error occurs when you are trying to install other operating systems that do not support APT. Using the command with the appropriate operating systems will solve the issue.
In this article, we will delve into the details of this error and its solutions.
What is the apt-get command?
The apt-get is a command-line tool used for installing, upgrading, and deleting a Linux package. It fetches information about the packages from authenticated sources to install or remove them, along with their dependencies.
The most common commands under apt-get are as follows –
Here, sudo is used for providing you with the security privileges of a superuser.
What is the apt-get command not found?
As mentioned earlier, when you try to install or modify a package on Linux with the apt-get command, you might receive this error. It may look something like this –
Let us see the reasons behind this problem.
Operating System Not Supportive
The apt-get command only works on Debian, Ubuntu, and its derivatives. If you are trying to install rpm-based operating systems such as Fedora, RHEL and CentOS, the command will not work. As a result, you will receive the error.
Distributions that support apt-get
To find out the Linux distribution name, type in the following command –
Package Not Available
If you are using an operating system that is compatible with the apt-get command, then check the availability of the APT. Type in the command locate apt-get to check whether it is installed in your system. The command must return the following output –
If no output is returned, it means that the APT package is not installed. You have to manually install it to get things working for you.
How to solve the apt-get command not found an error?
This apt-get command not found error using the following method:
1) Using the Correct Package Manager
Distributions such as Fedora, CentOS, and RHEL use Yum as their default package manager. Type in the following command to install them using Yum –
macOS X uses Homebrew as their default package manager. You can use it by running the command below –
For Arch Linux, you have to use the Pacman package manager like this –
2) Downloading the Latest APT Package
3) Reinstalling the OS
After installing the APT package, check the /usr/bin/ directory to ensure if it had properly installed. If the file is empty, then run the locate apt-get command again. If no result is shown, there is no alternative but to reinstall the operating system. This might fix the problem.
Make sure all the commands are properly using the sudo access keyword. The apt-get error may arise if the system administrator is not letting you execute the apt-get command on your system.
Amazon Linux: apt-get: command not found
I’m trying to install an apache server on my AWS instance, however, it seems that it doesn’t have the apt package installed.
I googled and all I found was some broken links to this package. I am using Putty on a windows machine if that information helps.
I currently have low to none experience in linux enviroments.
I am running the following version of Linux
Can anyone help with that?
12 Answers 12
Try to install your application by using yum command yum install application_name
Check the Linux distribution, apt-get works in Debian based distro whereas yum works in Fedora based distro.
It is also possible your system administrator does not permit you (or did not put you in the group of users who have sudo permissions) to execute apt-get but if you have sudo access try to execute with sudo apt-get
if debian or yum install
I faced the same issue regarding apt-get: command not found here are the steps how I resolved it on ubuntu xenial
Search the appropriate version of apt from here ( apt_1.6.13_amd64.deb for ubuntu xenial)
Download the apt.deb
Now we can easily run
sudo apt-get install htop
For Debian based Linux distributions:
Try to use sudo apt install
instead of the usual sudo apt-get install
apt provides a high-level commandline interface for the package management system. It is intended as an end user interface and enables some options better suited for interactive usage by default compared to more specialized APT tools like apt-get(8) and apt-cache(8).
This answer is for complete AWS beginners:
I had this issue but it was because I was trying to run a command from a tutorial inside my Mac computer. What I actually needed to do was SSH into my AWS machine, and then run the same command there. Ta Da, it worked:
Click this button in your EC2 instance, to be able to copy the SSH command. setup your SSH keys https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-key-pairs.html and then you can SSH into your machine
Once here, you can run your sudo apt-get command.
Why is the «apt» command not found?
What does this error mean? The apt command is not working, and I’ve lost the Software Center.
4 Answers 4
APT is a suite of utilities, including a database of information about what packages are available from where.
APT is not a single command. Rather, it provides several commands.
To update information about what packages are available and from where (which you should do before attempting to upgrade or install any packages with apt-get ), run:
To upgrade packages (i.e., «update your system»), run:
To upgrade packages, including packages that require uninstalled packages to be installed, or installed packages to be removed, run this (but be careful—it’s best to pay attention to what will be added or removed):
To remove one or more packages (i.e., to uninstall it), run:
To remove a package and also remove its systemwide configuration files (but not its per-user configuration files, which reside in users’ home directories), run:
To remove packages that were installed automatically because other packages needed them, but which now are no longer needed, run:
To do that, and also remove their global configuration files»
To reinstall a package, run:
To reinstall a package and delete its systemwide configuration files while doing so:
To deleted cached package installer files, but only for packages that are unlikely to be needed again (i.e., those that are so old they’ve been removed from the servers, as of last time sudo apt-get update was run):
You can learn more by reading the apt-get and apt manual pages.
Comments
bubthegreat commented Oct 6, 2020 •
Environment
$ cat /proc/version Linux version 4.19.128-microsoft-standard (oe-user@oe-host) (gcc version 8.2.0 (GCC)) #1 SMP Tue Jun 23 12:58:10 UTC 2020 «>
Steps to reproduce
$ sudo apt-get update [sudo] password for bub: Hit:1 http://archive.ubuntu.com/ubuntu focal InRelease Get:2 http://security.ubuntu.com/ubuntu focal-security InRelease [107 kB] Get:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease [111 kB] Get:4 http://archive.ubuntu.com/ubuntu focal-backports InRelease [98.3 kB] Get:5 http://security.ubuntu.com/ubuntu focal-security/main amd64 Packages [295 kB] Get:6 http://archive.ubuntu.com/ubuntu focal/universe amd64 Packages [8628 kB] Get:7 http://security.ubuntu.com/ubuntu focal-security/main Translation-en [70.0 kB] Get:8 http://security.ubuntu.com/ubuntu focal-security/main amd64 c-n-f Metadata [4696 B] Get:9 http://security.ubuntu.com/ubuntu focal-security/restricted amd64 Packages [59.2 kB] Get:10 http://security.ubuntu.com/ubuntu focal-security/restricted Translation-en [9856 B] Get:11 http://security.ubuntu.com/ubuntu focal-security/universe amd64 Packages [93.8 kB] Get:12 http://security.ubuntu.com/ubuntu focal-security/universe Translation-en [35.5 kB] Get:13 http://security.ubuntu.com/ubuntu focal-security/universe amd64 c-n-f Metadata [3004 B] Get:14 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 Packages [1252 B] Get:15 http://security.ubuntu.com/ubuntu focal-security/multiverse Translation-en [540 B] Get:16 http://security.ubuntu.com/ubuntu focal-security/multiverse amd64 c-n-f Metadata [116 B] Get:17 http://archive.ubuntu.com/ubuntu focal/universe Translation-en [5124 kB] Get:18 http://archive.ubuntu.com/ubuntu focal/universe amd64 c-n-f Metadata [265 kB] Get:19 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 Packages [144 kB] Get:20 http://archive.ubuntu.com/ubuntu focal/multiverse Translation-en [104 kB] Get:21 http://archive.ubuntu.com/ubuntu focal/multiverse amd64 c-n-f Metadata [9136 B] Get:22 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages [558 kB] Get:23 http://archive.ubuntu.com/ubuntu focal-updates/main Translation-en [144 kB] Get:24 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 c-n-f Metadata [9960 B] Get:25 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 Packages [67.1 kB] Get:26 http://archive.ubuntu.com/ubuntu focal-updates/restricted Translation-en [10.8 kB] Get:27 http://archive.ubuntu.com/ubuntu focal-updates/restricted amd64 c-n-f Metadata [352 B] Get:28 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 Packages [245 kB] Get:29 http://archive.ubuntu.com/ubuntu focal-updates/universe Translation-en [94.5 kB] Get:30 http://archive.ubuntu.com/ubuntu focal-updates/universe amd64 c-n-f Metadata [6236 B] Get:31 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 Packages [15.1 kB] Get:32 http://archive.ubuntu.com/ubuntu focal-updates/multiverse Translation-en [3892 B] Get:33 http://archive.ubuntu.com/ubuntu focal-updates/multiverse amd64 c-n-f Metadata [480 B] Get:34 http://archive.ubuntu.com/ubuntu focal-backports/main amd64 c-n-f Metadata [112 B] Get:35 http://archive.ubuntu.com/ubuntu focal-backports/restricted amd64 c-n-f Metadata [116 B] Get:36 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 Packages [4012 B] Get:37 http://archive.ubuntu.com/ubuntu focal-backports/universe Translation-en [1448 B] Get:38 http://archive.ubuntu.com/ubuntu focal-backports/universe amd64 c-n-f Metadata [224 B] Get:39 http://archive.ubuntu.com/ubuntu focal-backports/multiverse amd64 c-n-f Metadata [116 B] Fetched 16.3 MB in 4s (4229 kB/s) Reading package lists. Done bub@bubs-surface-book-2:
When looking at the paths for the default users, they don’t share the same filesystem:
When looking for the commands in /usr/bin, they are not found in the bash shell from powershell: