Я хотел переустановить Инструмент APT, таким образом, я удалил его, и затем я понял, что, вероятно, будет лучше, если я просто удалил /etc/apt
каталог. Есть ли какой-либо способ, которым я могу зафиксировать свой провал?
Моя версия Ubuntu является 18.04.2 LTS и выводом ls /etc/apt
был
root@user-OptiPlex-755:~# ls /etc/apt
ls: cannot access '/etc/apt': No such file or directory
ОБНОВЛЕНИЕ: Я переустановил apt
, однако, это - мой вывод:
root@user-OptiPlex-755:~# sudo apt install --reinstall apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package update-manager is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
ubuntu-release-upgrader-core update-manager-core
Package update-notifier-common is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or is only available from another source
Package update-notifier is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
update-notifier-common
Package apt-utils is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
However the following packages replace it:
apt
Package ubuntu-release-upgrader-gtk is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'apt-utils' has no installation candidate
E: Unable to locate package ubuntu-minimal
E: Package 'ubuntu-release-upgrader-gtk' has no installation candidate
E: Unable to locate package ubuntu-desktop
E: Package 'update-manager' has no installation candidate
E: Package 'update-notifier' has no installation candidate
E: Package 'update-notifier-common' has no installation candidate`
Если вы удалите APT с помощью sudo apt remove apt
, при стандартной установке (по крайней мере, в bionic (18.04)) затронуты следующие пакеты:
apt apt-utils ubuntu-minimal ubuntu-release-upgrader-gtk ubuntu-desktop update-manager update-notifier update-notifier-common
Для переустановки APT :
Загрузите файл .deb APT.
wget http://mirrors.edge.kernel.org/ubuntu/pool/main/a/apt/apt_1.6.8_amd64.deb
Установить с помощью dpkg.
sudo dpkg -i apt_1.6.8_amd64.deb
Поскольку вы также удалили / etc / apt
, загрузите zip-архив для bionic с GitHub , извлеките его и скопируйте папку apt, используя:
sudo cp -r ~ / Загрузки / Bionic / apt / etc /
И запустите обновление:
sudo apt update
Установить удаленные пакеты еще раз.
sudo apt install apt-utils ubuntu-minimal ubuntu-release-upgradeder-gtk ubuntu-desktop update-manager update-notifier update-notifier-common
Также никогда не пытайтесь испортить системные файлы / пакеты, такие как Python, APT и т. Д., Которые очень важны для ОС. Они могут привести к поломке вашей системы. Если вам нужно переустановить пакет, запустите:
sudo apt install --reinstall <package>
ОБНОВЛЕНИЕ:Рядом со мной есть сервер Ubuntu, поэтому я объединил его / etc / apt
с этим Ubuntu, и проблема была решена. Спасибо за вашу помощь, и я почти уверен, что основная моя вторая проблема заключалась в том, что мне не хватало файла /etc/apt/sources.list
. Как только я скопировал эти файлы, я смог установить удаленные пакеты. Еще раз благодарим вас за вашу помощь!