Linux production source, Linux Production
Linux local source
Because the project needs to build a runtime environment on ubuntu64bit, it requires a lot of software to be installed, download takes a lot of time, and the computer to be installed may not be able to access the Internet due to restrictions, therefore, we need to create a local source. Here are the steps required to create the local source:
1. Copy the required software package
The software installed with apt-get is in the/var/cache/apt/archives directory, create a packages directory under the/directory, and copy all the software packages to the directory. (It can be copied to a directory in any path. This step is mainly to copy all the software packages to one place for future packaging)
2. Generate software package information (including the dependency of important packages)
Use the dpkg-scanpackages command to obtain detailed information about the software package (you must confirm that dpkg-dev is installed ).
$ sudo dpkg-scanpackages /packages/ /dev/null |gzip >/packages/Packages.gz
In this example, the packages.gz file is generated under the packagesdirectory. The packages.gz file is read when apt-get is installed. The package information is obtained. If a dependent package exists, it is automatically downloaded and installed.
Packages.gz contains the following information:
Package name, priority, type, maintainer, architecture, source file (source), version number, dependent package, conflicting information, package size, File Download path, MD5sum, SHA1, package description, xul-Appid --- Application id, Bugs information, Origin, Supported
You can check the dpkg-dev package information:
Package: dpkg-devSource: dpkgVersion: 1.16.1.2ubuntu7.5Architecture: allOrigin: debianBugs: debbugs://bugs.debian.orgMaintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>Installed-Size: 1162Depends: libdpkg-perl (= 1.16.1.2ubuntu7.5), bzip2, xz-utils, patch, make, binutils, base-files (>= 5.0.0)Recommends: gcc | c-compiler, build-essential, fakeroot, gnupg, gpgv, libalgorithm-merge-perlSuggests: debian-keyringBreaks: devscripts (<< 2.10.26), dpkg-cross (<< 2.0.0)Filename: packages//dpkg-dev_1.16.1.2ubuntu7.5_all.debSize: 468412MD5sum: ba929418e76cf3a5d1b6620635db9652SHA1: 8ff26b822576175c3875aae0db0c04b37dcfa2fcSHA256: ec55ac8c839220e1f5abef498def4b06cc75ac23927e2517adbccf3ab0d88efeSection: utilsPriority: optionalMulti-Arch: foreignHomepage: http://wiki.debian.org/Teams/DpkgDescription: Debian package development tools This package provides the development tools (including dpkg-source) required to unpack, build and upload Debian source packages. . Most Debian source packages will require additional tools to build; for example, most packages need make and the C compiler gcc.Original-Maintainer: Dpkg Developers <debian-dpkg@lists.debian.org>
3. Add local source
Apt commandRead/etc/apt/sources. list
Source list (this source list can be added with multiple sources selected at the beginning of each selection). Therefore, we edit this file and add our own local source in the first line, for example:
Deb file: // packages/
Note the space in the middle
4. Package local sources
Copy the/etc/apt/sources. list file to the packages directory, and pack and back up the packages folder for ease of use.
5. How to use local data sources
Put the packages compressed package in the/directory (this directory can be extracted as long as it is consistent with the local path added, so that apt can find the source) and back up the local sources. list. copy the list to the/etc/apt/directory. After modifying/etc/apt/sources. list, the following two commands are generally run to update and upgrade:
Sudo apt-get update
Sudo apt-get dist-upgrade
Where:
Update-retrieve the updated package list
Dist-upgrade-Release Version upgrade
Then you can install apt-get install xxxx offline.
References: