安装ubuntu 12.04后,我的互联网连接完全消失了

安装Ubuntu 12.04后,在我的电脑上,我的网络完全消失了。 在终端内部,输入nm-tool我得到以下内容:

 The program nm-tool is currently not installed. You can install by typing: sudo apt-get install network-manager 

在我输入密码后,我得到了这个:

 Reading package lists... Done Building dependency tree Reading state information... Done Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: network manager : Depends: iputils-arping but it is not going to be installed E: Unable to correct problems, you have held broken packages 

对于计算机我是一个完全新手,所以我不知道。

如果您没有网络,那么您的软件包已损坏且无法安装 – Apt无法检索软件包。


手动下载

当你在这里发帖时,你显然有另一个可以访问网络的单元。 如果这个可用于下载包,您可以手动执行。

  • 在Ubuntu Packages Search中,您可以指定分发和包; 搜索; 选择点击链接; 到页面底部; 选择包; 选择架构; 复制镜像链接/或直接链接;

下载(这是针对i386,精确):

 wget http://archive.ubuntu.com/ubuntu//pool/main/n/network-manager/network-manager_0.9.4.0-0ubuntu3_i386.deb 

您还将在该页面上提供依赖项。

  • 或 – 如果其他机器的版本和架构相同,则在终端中:
 uri=$(apt-cache show network-manager | grep "^Filename: " | cut -d' ' -f2) && wget "http://archive.ubuntu.com/ubuntu/$uri" 

列出依赖关系和状态:

 apt-rdepends network-manager --follow=DEPENDS --print-state 

如果没有安装apt-rdepends则应安装它的依赖项

  • 或者 – 遵循其中一条说明 。

发布更多信息

现在。 一种更简单的方法可能是尝试使用其他工具修复网络。

一个

打开终端Ctrl + Alt + T并发出以下命令:

 lshw -C network ifconfig -a ip addr list route -n 

并在您的问题中发布输出。

或者, – 更完整 – 运行脚本。 请参阅底部的代码。

  1. 将代码保存到文件并将其复制到没有网络的计算机。
  2. 打开终端并使其可执行:
      chmod 700 name_of_file 
  3. 运行它并将输出保存到文件:
     ./name_of_file>结果
     # 要么
     ./name_of_file | 发球结果

如果需要,请将其清理并将其添加到您的问题中。

码:

 #!/bin/bash # No warranties, guaranties etc. version=0.0.1 sep="==============================================================" # has_tool "" has_tool() { command -v "$1" >/dev/null 2>&1 } # prnt_header "" "" prnt_header() { printf ";; %s\n" "$sep" printf ";; = tool: %-52s =\n" "$1" [[ "$2" != "" ]] && printf ";; = arg : %-52s =\n" "$2" if ! has_tool "$1"; then e=";; = ERR: \`$1' not present." printf "%-63s =\n" "$e" printf ";; %s\n" "$sep" return 1 fi if [[ "$1" =~ cat|more|less ]]; then if ! [[ -e "$2" ]]; then e=";; = ERR: File; \`$2' not present." printf "%-63s =\n" "$e" printf ";; %s\n" "$sep" return 1 fi fi printf ";; %s\n" "$sep" return 0 } # tool_info "" "" "" tool_info() { local v= (($#!=3)) && { printf >&2 "* $0 ERR: Bad call to cmd_present. Missing arguments.\n" printf >&2 ";; '%s'\n" "$@" return 1 } if ! prnt_header "$1" "$3"; then return 1 fi if [[ $2 ]]; then printf ";; Version \$ %s %s\n" "$1" "$2" v=( $($1 $2 2>&1) ) printf ";; %s\n" "${v[*]}" fi printf ";;\n" } # tool_do "" "" "" "" tool_do() { (($#!=4)) && { printf >&2 "* $0 ERR: Bad call to cmd_do. Missing arguments.\n" printf >&2 ";; '%s'\n" "$@" return 1 } if ! tool_info "$1" "$2" "$3"; then return 1 fi printf ";; Output:\n" (($4==1)) && sudo $1 $3 || $1 $3 printf "\n;;\n" return 0 } ping_gateways() { if has_tool route; then # TODO: Check for UG flag gw=$(route -n | awk '{print $2}' | grep -o '^[0-9\.]*') for g in ${gw[*]}; do if ! [[ "$g" == "0.0.0.0" ]]; then tool_do "ping" "-V" "-c 3 $g" 0 fi done fi } printf ";; _______________________ NET TEST _____________________________\n" | tee /dev/stderr printf ";; v. %s\n\n" "$version" | tee /dev/stderr printf >&2 ";; Working ...\n" tool_info "NetworkManager" "--version" "" printf >&2 ";; Hardware ...\n" tool_do "lshw" "-version" "-C network" 1 #printf >&2 "\r\033[KVarious information ..." printf >&2 ";; Various information ...\n" tool_do "ifconfig" "-V" "-a" 0 tool_do "ip" "-V" "addr list" 0 tool_do "route" "-V" "-n" 0 tool_do "netstat" "-V" "-rn" 0 tool_do "iptables" "--version" "-n -L" 1 printf >&2 ";; Some cat'ing ...\n" tool_do "cat" "" "/etc/network/interfaces" 0 tool_do "cat" "" "/etc/hosts" 0 tool_do "cat" "" "/etc/hosts.allow" 0 tool_do "cat" "" "/etc/hosts.deny" 0 tool_do "cat" "" "/etc/modules" 0 tool_do "cat" "" "/etc/modules.conf" 0 tool_do "cat" "" "/etc/resolv.conf" 0 printf >&2 ";; Some dig'ing ...\n" tool_do "host" "" "localhost" 0 tool_do "nslookup" "" "localhost" 0 tool_do "nslookup" "" "askubuntu.com" 0 tool_do "dig" "" "." 0 tool_do "dig" "" "localhost" 0 tool_do "dig" "" "askubuntu.com" 0 printf >&2 ";; Ping gateways ...\n" ping_gateways printf >&2 ";; Ping various ...\n" tool_do "ping" "" "-c 3 216.239.32.10" 0 printf >&2 ";; Ping google DNS ...\n" # https://developers.google.com/speed/public-dns/docs/using tool_do "ping" "" "-c 3 8.8.8.8" 0 tool_do "ping" "" "-c 3 8.8.4.4" 0 printf "\n;; Fine.\n" | tee /dev/stderr