Difference between revisions of "DEB package notes - dpkg, apt, aptitude, and friends"
From Noah.org
Jump to navigationJump to searchLine 2: | Line 2: | ||
= Notes on APT, apt-get, aptittude, dpkg, and friends = | = Notes on APT, apt-get, aptittude, dpkg, and friends = | ||
+ | |||
+ | == open and extract files from a DEB package == | ||
+ | |||
+ | This will create the destination directory that you give as the last argument. | ||
+ | <pre> | ||
+ | dpkg-deb -x example-package-name.deb /tmp/example-package-name | ||
+ | </pre> | ||
== Download a specific DEB package from a repository == | == Download a specific DEB package from a repository == | ||
− | |||
This will force a download of the given PACKAGE_NAME. The file will be stored in /var/cache/apt/archives and the exact name might be different than the package name. It will at least have a version number appended to it. | This will force a download of the given PACKAGE_NAME. The file will be stored in /var/cache/apt/archives and the exact name might be different than the package name. It will at least have a version number appended to it. |
Revision as of 11:37, 26 April 2010
Contents
Notes on APT, apt-get, aptittude, dpkg, and friends
open and extract files from a DEB package
This will create the destination directory that you give as the last argument.
dpkg-deb -x example-package-name.deb /tmp/example-package-name
Download a specific DEB package from a repository
This will force a download of the given PACKAGE_NAME. The file will be stored in /var/cache/apt/archives and the exact name might be different than the package name. It will at least have a version number appended to it.
apt-get --download-only --force-yes -yy install --reinstall [PACKAGE_NAME]
This script will download into the current directory:
#!/bin/sh # deb-download PACKAGE_NAME=$1 DESTINATION_DIR=$(readlink -f .) PARTIAL_DIR=${DESTINATION_DIR}/partial [ -d ./partial/ ] && PARTIAL_EXISTS=1 if [ -z "${PARTIAL_EXISTS}" ]; then mkdir ${DESTINATION_DIR}/partial fi apt-get -d --force-yes -y install --reinstall -o Dir::Cache::archives=${DESTINATION_DIR} ${PACKAGE_NAME} if [ -z "${PARTIAL_EXISTS}" ]; then rmdir ${DESTINATION_DIR}/partial fi
You can also see the URL of where the package would be downloaded from:
--print-uris
Creating DEB packages
debian control directory
- debian/
- root name of a package control directory.
- dh-make
- Convert an existing source package to your own package for modification.
aptitude -q -y install dh-make fakeroot pbuilder cdebootstrap
How To
- Put all source into a directory named package-version.
- Modify source directory as specified in http://www.debian.org/doc/maint-guide/ch-modify.en.html
- When you are done cd above this directory: cd ..
- create package-version.tar.gz source tarball: `tar czf package-version.tar.gz package-version`.
- Create initial debian package environment: `cd package-version/;dh_make -e user@example.com -f ../package-version.tar.gz`. This will create a new "debian" directory.
- Edit these files ./debian/control ./debian/copyright ./debian/license
- Run `dpkg-buildpackage -rfakeroot`
clean environment and workspace
This depends on `cdebootstrap`. This will take a while as it create an entire Debian chroot directory that looks like a fresh install.
sudo pbuilder create