[LINUX] Troubleshooting apt install

environment

Vagrant + Ubuntu 16.04.5 LTS

Introduction

Troubleshooting errors that occur when trying to install ntpdate with apt.

reference https://kaworu.jpn.org/ubuntu/Ubuntu%E3%81%AE%E4%B8%8D%E8%A6%81%E3%81%AA%E3%83%91%E3%83%83%E3%82%B1%E3%83%BC%E3%82%B8%E3%82%92%E5%89%8A%E9%99%A4%E3%81%99%E3%82%8B

procedure

I installed ntpdate with apt.

$ sudo apt install ntpdate

Then, such an error comes out.

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:

・ ・ ・ ・ (Unnecessary packages are displayed in a staggered manner)

Use 'sudo apt autoremove' to remove them.

It seems that you will see a message like this during installation if there are packages that are not needed. If you leave unnecessary packages indefinitely, it will not be good for security and it will take up disk space, so you have to delete it. It says that you should read the error message carefully to find out how to remove it.

Unnecessary packages will be deleted in bulk.

$ sudo apt autoremove

Try installing again.

$ sudo apt install ntpdate

The first error is gone, but there are other errors.

The following NEW packages will be installed:
  ntpdate
0 upgraded, 1 newly installed, 0 to remove and 88 not upgraded.
Need to get 48.6 kB of archives.
After this operation, 173 kB of additional disk space will be used.
Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 ntpdate amd64 1:4.2.8p4+dfsg-3ubuntu5.9
  404  Not Found [IP: 91.189.88.152 80]
Err:1 http://security.ubuntu.com/ubuntu xenial-security/main amd64 ntpdate amd64 1:4.2.8p4+dfsg-3ubuntu5.9
  404  Not Found [IP: 91.189.88.152 80]
E: Failed to fetch http://security.ubuntu.com/ubuntu/pool/main/n/ntp/ntpdate_4.2.8p4+dfsg-3ubuntu5.9_amd64.deb  404  Not Found [IP: 91.189.88.152 80]

E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?

It says either ** apt-get update ** or ** apt-get --fix-missing **. How is it different?

apt-get update Update the index file in the local environment. If the index file in the local environment is older than the index file on the server, the installation will not be successful, so update the index file in the local environment.

apt-get --fix-missing Even if the index file in the local environment is older than the index file on the server, it seems to ignore it and continue processing until the end.

Probably, I decided that it is safer to select apt-get update.

apt-get update

Third honesty

$ sudo apt install ntpdate

It seems to have worked.

Note: Even if I get an error, the message that ntpdate is installed was displayed, but it was not actually installed.

Recommended Posts

Troubleshooting apt install
Install pytorch
Install Activiti 6
emacs-jedi install
ArcoLinux install
install python
Install mojimoji
Install Scipy
Install Qiskit
Install Ansible
install keras
Install Mu
Install skt-war-result
Install Django
Install PyTorch
install pillow
ArchmanLinux Install
GeoDjango troubleshooting