Learning About chocolatey

I currently use Windows OS, and I have chocolatey installed as a package manager. I want to learn more about it because downloading and installing software on Windows can be a pain sometimes.

Date Created:
Last Edited:
2 451

References



Related


  • Package Manager
    • A package manager or package-management system is a collection of software tools that automates the process of installing, upgrading, configuring, and removing computer programs for a computer in a consistent manner. A package manager deals with packages, distributions of software and data in archive files. Packages contain metadata, such as the software's name, description of its purpose, version number, vendor, checksum, and a list of dependencies necessary for the software to run properly. Upon installation, metadata is stored in a local package database. Package managers typically maintain a database of software dependencies and version information to prevent software mismatches and missing prerequisites. Package managers are designed to eliminate the need for manual installs and updates.
  • Installer
    • An installation program or installer is a computer program that installs files, such as applications, drivers, or other software, onto a computer. some installers are specifically made to install the files they contain; other installers are general purpose and work by reading the contents of the software package to be installed.
  • NuGet
    • NuGet is a package manager, primarily used for packaging and distributing software written using .NET and the .NET Framework. Since its introduction in 2010, NuGet has evolved into a larger ecosystem of tools and services, including a free and open-source client application, hosted package servers, and software development tools.
  • Archive File
    • In computing, an archive file is a computer file that is composed of one or more files along with metadata. Many archive formats also support compression of member files. Archive files are used to collect multiple data files together into a single file for easier portability and storage, or simply to compress files to use less storage space. Archive files often store directory structures, error detection and correction information, comments, and some use built-in encryption.


Notes


Chocolatey is a machine-level, command-line package manager and installer for software on Microsoft Windows. It uses the NuGet packaging infrastructure and Windows PowerShell to simplify the process of downloading and installing software. The name is an extension on a pun of NuGet (from 'nougat') because everyone loves Chocolatey nougat.

Chocolatey

Chocolatey was created by Rob Reynolds in 2011 with the simple goal of offering a universal package manager for Windows. Chocolatey is an open source project that provides developers and admins alike a better way to mange Windows software.


Install Chocolatey For Individual Use

  1. Open PowerShell in administrator mode.
    1. Run Get-ExecutionPolicy. If it returns Restricted, then run Set-ExecutionPolicy AllSigned or Set-ExecutionPolicy Bypass -ScopeProcess
  2. Run the following command:
C:> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://community.chocolatey.org/install.ps1'))
  1. Wait for the command to complete.
  2. If you don't see any errors, you are ready to use Chocolatey. Type choco or choco-? now, or see Getting Started for usage instructions.


Getting Started

Chocolatey is a software management solution unlike any you've ever experienced on Windows. Think of it like this - you create a software development package using a little PowerShell, then you can deploy it anywhere you have Windows with everything.

Chocolatey is like dpkg (Apt-Get)/RPM, but built with Windows in mind (there are differences and limitations). It can also do configuration tasks and anything that you can do with PowerShell.

Terminology

  • Chocolatey - Windows package manager for software management, can also be considered a framework.
  • Chocolatey.org - Website that is one stop shop for Chocolatey information and contains a community maintained package repository.
  • NuGet - Framework and .NET package manager for software libraries. Chocolatey` uses the NuGet packaging framework.
  • Package - Packages contain the software they represent and the final location of software may or may not be in the package.
  • Software - Software refers to the actual runtime software that a package represents.
  • Native Installer - Actual installers that install software into Programs and Features, natively on a Windows machine.
  • Install Package - packages that wrap native installers
  • Portable Package - packages that use zip or just contain the runtime software. Usually these packages require administrative privileges to install or run.
  • Extension Package - packages that provide extensions to Chocolatey's PowerShell module through additional PowerShell modules.
  • Template Package - packages that have packaging templates in them, used in package creation
  • Metapackage - packages that only exist to take dependencies on other packages, usually as a way of providing one command to geta complete setup.
  • Virtual package - a concept that a package can "provide" some functionality and any package that meets that provides will be considered a dependency met.

Chocolatey packages are known as nupkg files, which is a compiled NuSpec or a fancy zip file that knows about package metadata (including dependencies and versioning). These packages are an enhanced Nuget package, they have additional metdata that is specific to Chocolatey.

Chocolatey packages are installed to ChocolateyInstall\lib, but the software could go to various locations, depending on how the package maintainer created the package.


Chocolatey Commands

  • apikey 
    • retrieves, saves or deletes an API key for a particular source
  • cache 
    • Manage the local HTTP caches used to store queries (v2.1.0+)
  • config
    • Retrieve and configure config file settings
  • download 
    • downloads packages - optionally internalizing all remote resources
  • export 
    • exports list of currently installed packages
  • feature
    • view and configure choco features
  • features
    • view and configure choco features (alias for feature)
  • find 
    • searches remote packages (alias for search)
  • help
    • displays top level help information for choco
  • info
    • retrieves package information. Shorthand for choco search pkgname —exact —verbose
  • install
    • installs packages from various sources
  • list
    • lists local packages
  • new
    • generates files necessary for a chocolatey package from a template
  • optimize
    • optimizes installation, reducing space usage
  • outdated
    • retrieves packages that are outdated. Similar to upgrade all —noop
  • pack 
    • packages nuspec, scripts, and other Chocolatey package resources into a nupkg file
  • pin 
    • suppress upgrades for a package
  • push 
    • pushes a compiled nupkg to a source
  • rule 
    • view or list implemented package rules (v2.3.0+)
  • search 
    • searches remote packages
  • setapikey 
    • retrieves, saves or deletes an API key for a particular source (alias for apikey)
  • source 
    • view and configure default sources
  • sources 
    • view and configure default sources (alias for source)
  • support 
    • provides support information
  • sync 
    • synchronizes against system installed software - generates missing packages
  • synchronize 
    • synchronizes against system installed software - generates missing packages
  • template 
    • get information about installed templates
  • templates 
    • get information about installed templates (alias for template)
  • uninstall 
    • uninstalls a package
  • unpackself 
    • [DEPRECATED] will be removed in v3.0.0 - re-installs Chocolatey base files
  • upgrade 
    • upgrades packages from various sources

Comments

You have to be logged in to add a comment

User Comments

Insert Math Markup

ESC
About Inserting Math Content
Display Style:

Embed News Content

ESC
About Embedding News Content

Embed Youtube Video

ESC
Embedding Youtube Videos

Embed TikTok Video

ESC
Embedding TikTok Videos

Embed X Post

ESC
Embedding X Posts

Embed Instagram Post

ESC
Embedding Instagram Posts

Insert Details Element

ESC

Example Output:

Summary Title
You will be able to insert content here after confirming the title of the <details> element.

Insert Table

ESC
Customization
Align:
Preview:

Insert Horizontal Rule

#000000

Preview:


View Content At Different Sizes

ESC

Edit Style of Block Nodes

ESC

Edit the background color, default text color, margin, padding, and border of block nodes. Editable block nodes include paragraphs, headers, and lists.

#ffffff
#000000

Edit Selected Cells

Change the background color, vertical align, and borders of the cells in the current selection.

#ffffff
Vertical Align:
Border
#000000
Border Style:

Edit Table

ESC
Customization:
Align:

Upload Lexical State

ESC

Upload a .lexical file. If the file type matches the type of the current editor, then a preview will be shown below the file input.

Upload 3D Object

ESC

Upload Jupyter Notebook

ESC

Upload a Jupyter notebook and embed the resulting HTML in the text editor.

Insert Custom HTML

ESC

Edit Image Background Color

ESC
#ffffff

Insert Columns Layout

ESC
Column Type:

Select Code Language

ESC
Select Coding Language

Insert Chart

ESC

Use the search box below

Upload Previous Version of Article State

ESC