User Tools

Site Tools


how_to_obtain_packages_using_apt

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
how_to_obtain_packages_using_apt [2022/07/19 19:52] – created 85.134.209.200how_to_obtain_packages_using_apt [2022/07/22 18:06] (current) admin
Line 3: Line 3:
 ===== APT (Advanced Packaging Tool) ===== ===== APT (Advanced Packaging Tool) =====
 ====About APT==== ====About APT====
-APT provides an effective way of installing packages and programs. Default settings are created and in some cases default users are created for managing the services and/or programs. APT handles all shared modules, dependencies and libraries of tools. When installing a program via APT - the default locations within Linux (Debian) should be consulted.<br>The following directories are where files are stored after APT - and are mostly default:<br> +APT provides an effective way of installing packages and programs. Default settings are created and in some cases default users are created for managing the services and/or programs. APT handles all shared modules, dependencies and libraries of tools. When installing a program via APT - the default locations within Linux (Debian) should be consulted. The following directories are where files are stored after APT - and are mostly default: 
-/etc/        -> stores all scripts (/etc/init.d = Startup Scripts)<br> +  /etc/        -> stores all scripts (/etc/init.d = Startup Scripts) 
-/var/        -> stores things such as temp, logs, www, mail, backups, libraries etc.<br> +  /var/        -> stores things such as temp, logs, www, mail, backups, libraries etc. 
-/usr/        -> stores bin files which can be executed using ./<br> +  /usr/        -> stores bin files which can be executed using . 
-/home/       -> stores all user home files.<br> +  /home/       -> stores all user home files. 
-<br>+ 
  
 ====General Use:==== ====General Use:====
 To download Updates and All Package Information for Debian Sarge To download Updates and All Package Information for Debian Sarge
-**apt-get update**+<code> 
 +apt-get update 
 +</code>
  
 To upgrade All Packages and Sources To upgrade All Packages and Sources
-**apt-get upgrade** and/or +<code> 
-**apt-get install**+apt-get upgrade  
 +#and/or 
 +apt-get install 
 +</code>
  
 To Install an Individual Package To Install an Individual Package
-**apt-get install package**+<code> 
 +apt-get install package 
 +</code> 
  
 To Remove an Individual Package To Remove an Individual Package
-**apt-get remove package**+<code> 
 +apt-get remove package 
 +</code>
  
 To Show Information on a Particular Package To Show Information on a Particular Package
-**apt-cache show package**+<code> 
 +apt-cache show package 
 +</code>
  
 To Search for New Packages (apart from web search) To Search for New Packages (apart from web search)
-**apt-cache search package**+<code> 
 +apt-cache search package 
 +</code>
  
 APT runs ontop of dpkg (front end) - a Package Manager APT runs ontop of dpkg (front end) - a Package Manager
 To List Packages and perform more detailed operations: To List Packages and perform more detailed operations:
-**dpkg -l** or +<code> 
-**dpkg -l | grep package**<br> +dpkg -l 
-<br>+#or 
 +dpkg -l | grep package 
 +</code>
  
 ====Problems with APT==== ====Problems with APT====
-Even though APT is meant to provide an effective way to install packages etc., problems were experienced. Problems arose due to incorrect apt-get installing in the beginning and also due to suggests etc. with mail.<br> +Even though APT is meant to provide an effective way to install packages etc., problems were experienced. Problems arose due to incorrect apt-get installing in the beginning and also due to suggests etc. with mail. 
-Pine was initially installed. Postfix and Courier were installed then. Pine suddenly dropped off, or was uninstalled due to dependancies & incomplete knowledge of what was happening. Care MUST be taken with apt. What was done in this case to fix pine, was to download a .deb package from the pine homepage. It was installed via:<br+ 
-dpkg -i package.deb <br>Another related problem is the fact that Horde does not want to install via apt-get after Mailserver install and config.<br> + 
-//edit: Dont know if pine is available via apt-get due to licencing issues// +Pine was initially installed. Postfix and Courier were installed then. Pine suddenly dropped off, or was uninstalled due to dependancies & incomplete knowledge of what was happening. Care MUST be taken with apt. What was done in this case to fix pine, was to download a .deb package from the pine homepage. It was installed via: 
-----+ 
 +<code
 +dpkg -i package.deb 
 +</code> 
 + 
 +Another related problem is the fact that Horde does not want to install via apt-get after Mailserver install and config. #edit: Dont know if pine is available via apt-get due to licencing issues 
  
 ====Config for APT==== ====Config for APT====
-apt config is located at: /etc/apt<br>+apt config is located at: /etc/apt 
 1. The following is required if using a proxy server to access the internet: 1. The following is required if using a proxy server to access the internet:
- **apt.conf** (May have to write a new file)+<code> 
 + vi /etc/apt/apt.conf (May have to write a new file)
  Acquire::http::Proxy "http://proxy:port";  Acquire::http::Proxy "http://proxy:port";
 +</code>
  
 2. To obtain apt packages fast from the nearest mirror (should be done from initial set-up) sources.list can be edited. It is also determined whether to use "STABLE" or "TESTING" apt source packages. 2. To obtain apt packages fast from the nearest mirror (should be done from initial set-up) sources.list can be edited. It is also determined whether to use "STABLE" or "TESTING" apt source packages.
- **sources.list** (Should be OK as is) +<code> 
- deb http://ftp.ie.debian.org/debian/ stable main +sources.list (Should be OK as is) 
- deb-src http://ftp.ie.debian.org/debian/ stable main+deb http://ftp.ie.debian.org/debian/ stable main 
 +deb-src http://ftp.ie.debian.org/debian/ stable main 
 +</code>
  
-Instead of Configuring Step 1. for using a Proxy server, an environment variable can also be set. This is useful if using links or a text based browser.<br+Instead of Configuring Step 1. for using a Proxy server, an environment variable can also be set. This is useful if using links or a text based browser. 
 +<code>
 <root@debian>>~$ export http_proxy="http://proxy:port" <root@debian>>~$ export http_proxy="http://proxy:port"
 +</code>
  
 ==== Apt Pinning (installing stable and testing packages together)==== ==== Apt Pinning (installing stable and testing packages together)====
 +
 The following is taken from an excellent article on this: The following is taken from an excellent article on this:
 http://jaqque.sbih.org/kplug/apt-pinning.html http://jaqque.sbih.org/kplug/apt-pinning.html
  
 Include both stable and testing sources to /etc/apt/sources.list Include both stable and testing sources to /etc/apt/sources.list
 +<code>
  vi /etc/apt/sources.list  vi /etc/apt/sources.list
    
Line 81: Line 112:
  Pin: release a=unstable  Pin: release a=unstable
  Pin-Priority: 600  Pin-Priority: 600
 +</code>
 Thats it. Thats it.
 +<code>
  apt-get install package (works as normal taking stable first)  apt-get install package (works as normal taking stable first)
  apt-get -t testing install <package>  apt-get -t testing install <package>
  #or  #or
  apt-get install <package>/unstable  apt-get install <package>/unstable
 +</code>
  
 ===== dpkg - Debian Package Manager ===== ===== dpkg - Debian Package Manager =====
Line 92: Line 125:
  
 ==== Install a .deb package manually ==== ==== Install a .deb package manually ====
 +<code>
  dpkg -i package.deb  dpkg -i package.deb
- <nowiki>//</nowiki>generally the .deb can be downloaded from debian.org+ #generally the .deb can be downloaded from debian.org 
 +</code>
  
 ==== Find where a package installs itself ==== ==== Find where a package installs itself ====
 +<code>
  dpkg -L package  dpkg -L package
 +</code>
 +
 +==== Remove / Uninstall a package ====
 +<code>
 +apt-get remove package
 +#OR
 +apt-get purge package
 +#The latter removes and purges all config files.
 +#Note after removing the one package, extra ones which were installed at the time will remain. To remove them also:
 +apt autoremove
 +</code>
  
 ===== APT Guru Tricks ===== ===== APT Guru Tricks =====
 Taken from: http://maketecheasier.com/become-an-apt-guru/2009/02/24/ Taken from: http://maketecheasier.com/become-an-apt-guru/2009/02/24/
 +<code>
  dpkg -S /etc/mysql/my.cnf  dpkg -S /etc/mysql/my.cnf
  #shows which package created a particular file.  #shows which package created a particular file.
Line 110: Line 157:
  echo "(packagename) hold" | dpkg --set-selections  echo "(packagename) hold" | dpkg --set-selections
  #both these do the same thing, i.e. prevent a package from been updated.  #both these do the same thing, i.e. prevent a package from been updated.
 +</code>
how_to_obtain_packages_using_apt.1658260370.txt.gz · Last modified: 2022/07/19 20:13 (external edit)