Ubuntu cannot be connected to the Internet in linux, while windows can be connected to the Internet.

Source: Internet
Author: User
Usually, windows can be connected to the Internet but ubuntu cannot be connected to the Internet on the same machine. However, this is common in Campus Networks with Chinese characteristics. although there are local solutions, the advantages of apt cannot be reflected in the need for a networked linux and a huge hard disk space (and fast network speed.

The following describes a relatively roundabout method:

First, download the package information from the source. For the download list, see the attachment. here we use the cn99 source and gutsy as an example (I haven't read the source manual yet, so I just downloaded the gutsy-related items outside the pool folder. For other cases, please compare them yourself ).
Note that you need to use the download software that can reconstruct the directory structure to download, just like the-x option of wget.Code:Wget-B-I cn99_gutsy.lst-w 2-x

Be honest, please use a single thread + latency for downloading, and use your own ip Address
After the download, it looks like thisCode:Autumncat @ autumncat-host :~ /Apt-source/ubuntu.cn99.com
$ Find
.
./Ubuntu
./Ubuntu/dists
./Ubuntu/dists/gutsy
./Ubuntu/dists/gutsy/Contents-amd64.gz
./Ubuntu/dists/gutsy/Contents-i386.gz
./Ubuntu/dists/gutsy/Release
./Ubuntu/dists/gutsy/Release. gpg
./Ubuntu/dists/gutsy/main
./Ubuntu/dists/gutsy/main/binary-amd64
./Ubuntu/dists/gutsy/main/binary-amd64/packages.bz2
./Ubuntu/dists/gutsy/main/binary-amd64/packages.gz
./Ubuntu/dists/gutsy/main/binary-amd64/release
./Ubuntu/dists/gutsy/main/binary-i386
./Ubuntu/dists/gutsy/main/binary-i386/packages.bz2
./Ubuntu/dists/gutsy/main/binary-i386/packages.gz
./Ubuntu/dists/gutsy/main/binary-i386/release
./Ubuntu/dists/gutsy/main/Debian-Installer
./Ubuntu/dists/gutsy/main/Debian-installer/binary-amd64
./Ubuntu/dists/gutsy/main/Debian-installer/binary-amd64/packages.bz2
....

Then you can copy the entire directory to a directory in Linux.

Then modify the source list, as shown in the following figure:Code:$ CAT/etc/APT/sources. List
Deb file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy main restricted universe multiverse
Deb file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-security main restricted universe multiverse
Deb file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted universe multiverse
Deb file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-proposed main restricted universe multiverse
Deb file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse
Deb-src file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy main restricted universe multiverse
Deb-src file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-security main restricted universe multiverse
Deb-src file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-updates main restricted universe multiverse
Deb-Src file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-proposed main restricted universe multiverse
Deb-Src file: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/ gutsy-backports main restricted universe multiverse

LastCode:Sudo apt-Get update

But at this time, Apt-Get install is useless, because the huge pool directory is not downloaded.

The next step is to obtain the package address. There are many methods, such as using apt-Get.Code:$ Apt-Get install -- print-Uris-y gedit | cut-D/'-S-F 2-2
File: // home/autumncat/apt-source/sources
File: // home/autumncat/apt-source/sources
File: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/pool/main/g/gedit/gedit-common_2.w.3-0ubuntu=all.deb
File: // home/autumncat/apt-source/sources
File: // home/autumncat/apt-source/ubuntu.cn99.com/ubuntu/pool/main/g/gedit/gedit_2.20.3-0ubuntu=i386.deb

Or new

But we can see that the URL is incorrect. Let's fix it (replace the previous part with the correct one ):Code:$ Apt-get install -- print-uris-y gedit | cut-d/'-s-f 2-2 | sed's | file: /// home/autumncat/apt-source/| http: // | G'
Http://ubuntu.cn99.com/ubuntu/pool/main/g/gtksourceview2/libgtksourceview2.0-common_2.0.1-0ubuntu1_all.deb
Http://ubuntu.cn99.com/ubuntu/pool/main/g/gtksourceview2/libgtksourceview2.0-0_2.0.1-0ubuntu1_i386.deb
Http://ubuntu.cn99.com/ubuntu/pool/main/g/gedit/gedit-common_2.20.3-0ubuntu1_all.deb
Http://ubuntu.cn99.com/ubuntu/pool/main/p/pygtksourceview/python-pygtksourceview_2.0.0-0ubuntu3_i386.deb
Http://ubuntu.cn99.com/ubuntu/pool/main/g/gedit/gedit_2.20.3-0ubuntu1_i386.deb

Finally, you can download the required deb package in windows.
After the required deb package download, You Can dpkg-I or put it in the cache directory to install. From: http://forum.ubuntu.org.cn/viewtopic.php? T = 87977

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.