Ubuntu12.04 build a local ubuntu Update source

Source: Internet
Author: User
Ubuntu12.04 build the ubuntu Update source apt-get locally and use the wget command from/etc/apt/sources. the list configuration file specifies the source to download the corresponding. deb software package, and then install the software using the dpkg-ipackageName.deb. If the network performance of the environment where the Ubuntu computer is located is relatively high... ubuntu 12.04 build a local Ubuntu Update source
Apt-get actually uses the wget command to download the corresponding. deb package from the source specified in the/etc/apt/sources. list configuration file, and then install the software using dpkg-I packageName. deb. If the environment where the Ubuntu computer is located has poor network performance or cannot connect to the Internet, it is difficult to install a large number of software packages on the Ubuntu Source server. To create a Ubuntu mirror server, you need at least 60 GB of hard disk space. Each Ubuntu version is divided into two versions: 32bit and 64bit. There are two groups of deb packages. The latest ubuntu version requires about 90 GB space for the two deb packages. You can create a 32-bit or 64-bit server of Ubuntu or a server serving both 32-bit and 64-bit. You can also create source servers for all ubuntu versions. Depends on the space remaining on your hard disk and your needs. Use the Ubuntu Source server of the Chinese Emy of science and technology as the Source server to update the server (located in Hefei, 1-gigabit education network access, and 10-Gigabit telecom/Unicom line intelligent routing ), maintained by the China University of Science and Technology Linux user Association and the China University of Science and Technology Network Information Center, including other open-source images, the Deepin official server actually points to this: use apt-mirror to create the local image server sudo apt-get install apt-mirror sudo apt-get install apache2 on the Ubuntu Source server. we need the above two software to build our local Ubuntu Source server.. I will introduce how to build the Ubuntu 32-bit and 64-bit local ubunt source servers. If you want to serve other versions, modify the corresponding configuration. /Etc/apt/mirror. the list configuration file is modified as follows: ############# config #################### set base_path/var/spool /apt-mirror # set kernel _path $ base_path/mirror # set skel_path $ base_path/skel # set var_path $ base_path/var # set cleanscript $ var_path/clean. sh # set defaultarch # Set postmir_script $ var_path/postmirror. sh # set run_postmirror 0 set nthreads 20 set _ tilde 0 ############### end config ############ # deb http://debian.ustc.edu.cn/ubuntu/ Precise main multiverse restricted universedeb http://debian.ustc.edu.cn/ubuntu/ Precise-backports main multiverse restricted universedeb http://debian.ustc.edu.cn/ubuntu/ Precise-proposed main multiverse restricted universedeb http://debian.ustc.edu.cn/ubuntu/ Precise-security main multiverse restricted universedeb http://debian.ustc.edu.cn/ubuntu/ Precise-updates main multiverse restricted universedeb-src http://debian.ustc.edu.cn/ubuntu/ Precise main multiverse restricted universedeb-src http://debian.ustc.edu.cn/ubuntu/ Precise-backports main multiverse restricted universedeb-src http://debian.ustc.edu.cn/ubuntu/ Precise-proposed main multiverse restricted universedeb-src http://debian.ustc.edu.cn/ubuntu/ Precise-security main multiverse restricted universedeb-src http://debian.ustc.edu.cn/ubuntu/ Precise-updates main multiverse restricted universedeb-i386 http://debian.ustc.edu.cn/ubuntu/ Precise main multiverse restricted universedeb-i386 http://debian.ustc.edu.cn/ubuntu/ Precise-backports main multiverse restricted universedeb-i386 http://debian.ustc.edu.cn/ubuntu/ Precise-proposed main multiverse restricted universedeb-i386 http://debian.ustc.edu.cn/ubuntu/ Precise-security main multiverse restricted universedeb-i386 http://debian.ustc.edu.cn/ubuntu/ Precise-updates main multiverse restricted universedeb http: // * indicates downloading the 64-bit deb software. Deb-i386 http: // * indicates downloading the 32-bit deb software. Run sudo apt-mirror to run wget http://mirrors.sohu.com/Ubuntu Download the corresponding deb package. After sudo apt-mirror is executed, all the required deb packages and corresponding configuration files are available in the/var/spool/apt-mirror directory. The download path is/var/spool/apt-mirror/debian.ustc.edu.cn/ubuntu. if you select another Ubuntu Source service area, the download will go to another directory. Now we have all the files required by the Ubuntu Source server, but we cannot use the local Ubuntu Source server. Because it is not started yet. The Ubuntu Source server is actually an http server. We access sohu's Ubuntu Source server through a browser. Therefore, we also need to start a web server to start the local Ubuntu Source server. I chose to use the web server apache2 to serve the Ubuntu Source server. The Ubuntu Source server is actually a series of static files. Apt-cache and apt-get programs download and install the corresponding static files through wget. As we all know, Apache2 Web servers are very efficient and stable in serving static files. Therefore, I chose the apache2 server. After the apache2 server is installed, the/var/www/directory is used as the Web root directory by default. I would like to make a coincidence here: cd/var/www/ln/var/spool/apt-mirror/debian.ustc.edu.cn/ubuntu/-s creates an Ubuntu hyperlink under the/var/www directory, link to/var/spool/apt-mirror/debian.ustc.edu.cn/ubuntu/sudo/etc/init. the d/apache2 start/restart/stop/status command can be used to manage the apache2 server. Start with sudo apache2ctl start. Open your browser and enter http://localhost/Ubuntu You can see http://mirrors.sohu.com/Ubuntu /The same page. So far, our local Ubuntu Source server has been created successfully. Synchronize the local ubunt source server and remote ubunt source server on a regular basis every day. the content of the ubunt source server we create now is the same as that of the server of the Chinese Emy of science and technology. However, every day, the Ubuntu team adds a new deb package to the Ubuntu Source server. The Chinese Emy of science and technology synchronizes with the official Ubuntu source server every day. We must use the sudo apt-mirror command frequently to synchronize the latest deb package. We can use a script that is executed regularly to synchronize with the Ubuntu Source server of the Chinese Emy of science and technology every day to solve this problem. 1 sudovim/etc/cron. d/apt-mirror remove the # signature of the command. Command: 1 0 4 *** apt-mirror/usr/bin/apt-mirror>/var/spool/apt-mirror/var/cron. log, the computer automatically starts apt-mirror and Ubuntu Source server synchronization every day. Now we can modify the/etc/atp/Source. list file to use the local Ubuntu source server as the apt Source. For example, if the address of my ubunt server is 222.24.24.175, add deb. http://222.24.24.175/ubuntu/ Precise main multiverse restricted universedeb http://222.24.24.175/ubuntu/ Precise-backports main multiverse restricted universedeb http://222.24.24.175/ubuntu/ Precise-proposed main multiverse restricted universedeb http://222.24.24.175/ubuntu/ Precise-security main multiverse restricted universedeb http://222.24.24.175/ubuntu/ Precise-updates main multiverse restricted universedeb-src http://222.24.24.175/ubuntu/ Precise main multiverse restricted universedeb-src http://222.24.24.175/ubuntu/ Precise-backports main multiverse restricted universedeb-src http://222.24.24.175/ubuntu/ Precise-proposed main multiverse restricted universedeb-src http://222.24.24.175/ubuntu/ Precise-security main multiverse restricted universedeb-src http://222.24.24.175/ubuntu/ Precise-updates main multiverse restricted universe. If you want to use other ubunt source servers at the same time, put the above configuration on the configuration file to match first. Then execute sudo apt-get update to rebuild the local index. The local ubunt source server will be used later. Speed :)
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.