无法在 ubuntu 18.10 中安装 gcc

无法在 ubuntu 18.10 中安装 gcc

以下是终端的内容-

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  g++-8 libstdc++-8-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  cpp cpp-8 g++-8 gcc-8 gcc-8-base gcc-8-base:i386 libasan5 libatomic1
  libcc1-0 libgcc-8-dev libgcc1 libgcc1:i386 libgfortran5 libgomp1 libitm1
  liblsan0 libmpx2 libquadmath0 libstdc++-8-dev libstdc++6 libstdc++6:i386
  libtsan0 libubsan1
Suggested packages:
  cpp-doc gcc-8-locales g++-8-multilib gcc-8-doc libstdc++6-8-dbg gcc-multilib
  autoconf automake libtool flex bison gcc-doc gcc-8-multilib libgcc1-dbg
  libgomp1-dbg libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg
  libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg libstdc++-8-doc
The following NEW packages will be installed:
  gcc
The following packages will be upgraded:
  cpp cpp-8 g++-8 gcc-8 gcc-8-base gcc-8-base:i386 libasan5 libatomic1
  libcc1-0 libgcc-8-dev libgcc1 libgcc1:i386 libgfortran5 libgomp1 libitm1
  liblsan0 libmpx2 libquadmath0 libstdc++-8-dev libstdc++6 libstdc++6:i386
  libtsan0 libubsan1
23 upgraded, 1 newly installed, 0 to remove and 127 not upgraded.
Need to get 19.8 MB/35.4 MB of archives.
After this operation, 3,675 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Ign:1 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 g++-8 amd64 8.3.0-6ubuntu1~18.10.1
Ign:2 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 gcc-8 amd64 8.3.0-6ubuntu1~18.10.1
Err:1 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 g++-8 amd64 8.3.0-6ubuntu1~18.10.1
  Connection failed [IP: 91.189.91.26 80]
Err:2 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 gcc-8 amd64 8.3.0-6ubuntu1~18.10.1
  Connection failed [IP: 91.189.88.149 80]
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/g++-8_8.3.0-6ubuntu1~18.10.1_amd64.deb  Connection failed [IP: 91.189.91.26 80]
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/gcc-8_8.3.0-6ubuntu1~18.10.1_amd64.deb  Connection failed [IP: 91.189.88.149 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
achint@achint-Lenovo-G570:~$

使用 sudo apt-get update-

Ign:1 http://dl.google.com/linux/chrome/deb stable InRelease        
Hit:2 http://in.archive.ubuntu.com/ubuntu cosmic InRelease          
Hit:3 http://repo.steampowered.com/steam precise InRelease                                    
Hit:4 http://dl.google.com/linux/chrome/deb stable Release               
Get:6 http://in.archive.ubuntu.com/ubuntu cosmic-updates InRelease [88.7 kB]
Get:7 http://in.archive.ubuntu.com/ubuntu cosmic-backports InRelease [74.6 kB]
Get:8 http://in.archive.ubuntu.com/ubuntu cosmic-security InRelease [88.7 kB]
Get:9 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 DEP-11 Metadata [150 kB]
Get:10 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main DEP-11 48x48 Icons [34.7 kB]
Get:11 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main DEP-11 64x64 Icons [64.6 kB]
Get:12 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe amd64 DEP-11 Metadata [97.4 kB]
Get:13 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe DEP-11 48x48 Icons [40.1 kB]                                              
Get:14 http://in.archive.ubuntu.com/ubuntu cosmic-updates/universe DEP-11 64x64 Icons [126 kB]                                               
Get:15 http://in.archive.ubuntu.com/ubuntu cosmic-updates/multiverse amd64 DEP-11 Metadata [2,464 B]                                         
Get:16 http://in.archive.ubuntu.com/ubuntu cosmic-backports/universe amd64 DEP-11 Metadata [7,228 B]                                         
Get:17 http://in.archive.ubuntu.com/ubuntu cosmic-security/main amd64 DEP-11 Metadata [26.5 kB]                                              
Get:18 http://in.archive.ubuntu.com/ubuntu cosmic-security/main DEP-11 64x64 Icons [14.7 kB]                                                 
Get:19 http://in.archive.ubuntu.com/ubuntu cosmic-security/universe amd64 DEP-11 Metadata [31.4 kB]                                          
Get:20 http://in.archive.ubuntu.com/ubuntu cosmic-security/universe DEP-11 48x48 Icons [11.4 kB]                                             
Get:21 http://in.archive.ubuntu.com/ubuntu cosmic-security/universe DEP-11 64x64 Icons [76.9 kB]                                             
Get:22 http://in.archive.ubuntu.com/ubuntu cosmic-security/multiverse amd64 DEP-11 Metadata [2,464 B]                                        
Fetched 937 kB in 10s (91.5 kB/s)                                                                                                            
Reading package lists... Done
achint@achint-Lenovo-G570:~$

使用 --fix-missing-

Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following packages were automatically installed and are no longer required:
  g++-8 libstdc++-8-dev
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
  cpp cpp-8 g++-8 gcc-8 gcc-8-base gcc-8-base:i386 libasan5 libatomic1 libcc1-0 libgcc-8-dev libgcc1 libgcc1:i386 libgfortran5 libgomp1
  libitm1 liblsan0 libmpx2 libquadmath0 libstdc++-8-dev libstdc++6 libstdc++6:i386 libtsan0 libubsan1
Suggested packages:
  cpp-doc gcc-8-locales g++-8-multilib gcc-8-doc libstdc++6-8-dbg gcc-multilib autoconf automake libtool flex bison gcc-doc gcc-8-multilib
  libgcc1-dbg libgomp1-dbg libitm1-dbg libatomic1-dbg libasan5-dbg liblsan0-dbg libtsan0-dbg libubsan1-dbg libmpx2-dbg libquadmath0-dbg
  libstdc++-8-doc
The following NEW packages will be installed:
  gcc
The following packages will be upgraded:
  cpp cpp-8 g++-8 gcc-8 gcc-8-base gcc-8-base:i386 libasan5 libatomic1 libcc1-0 libgcc-8-dev libgcc1 libgcc1:i386 libgfortran5 libgomp1
  libitm1 liblsan0 libmpx2 libquadmath0 libstdc++-8-dev libstdc++6 libstdc++6:i386 libtsan0 libubsan1
23 upgraded, 1 newly installed, 0 to remove and 127 not upgraded.
Need to get 19.8 MB/35.4 MB of archives.
After this operation, 3,675 kB of additional disk space will be used.
Do you want to continue? [Y/n] y
Ign:1 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 g++-8 amd64 8.3.0-6ubuntu1~18.10.1                                       
Ign:2 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 gcc-8 amd64 8.3.0-6ubuntu1~18.10.1
Err:1 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 g++-8 amd64 8.3.0-6ubuntu1~18.10.1
  Connection failed [IP: 91.189.88.31 80]
Err:2 http://in.archive.ubuntu.com/ubuntu cosmic-updates/main amd64 gcc-8 amd64 8.3.0-6ubuntu1~18.10.1
  Connection failed [IP: 91.189.88.149 80]
Unable to correct missing packages.
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/g++-8_8.3.0-6ubuntu1~18.10.1_amd64.deb  Connection failed [IP: 91.189.88.31 80]
E: Failed to fetch http://in.archive.ubuntu.com/ubuntu/pool/main/g/gcc-8/gcc-8_8.3.0-6ubuntu1~18.10.1_amd64.deb  Connection failed [IP: 91.189.88.149 80]
E: Aborting install.
achint@achint-Lenovo-G570:~$ 

相关内容