apt-get atau yum di Windows

Pernah pake Linux? Pasti sudah familiar dengan yang namanya apt-get dong yah? Tapi sekarang pake Windows? Mau tetep pake apt-get juga di Windows? Bisa! Begini caranya.

Chocolatey is a package manager for Windows (like apt-get or yum but for Windows). It was designed to be a decentralized framework for quickly installing applications and tools that you need. It is built on the NuGet infrastructure currently using PowerShell as its focus for delivering packages from the distros to your door, err computer.

Nah, tau kan artinya?
chocolatey
Intinya adalah Chocolatey.org membuat software semacam apt-get yang fungsinya adalah dapat menginstall, mengupdate, menguninstall program-program menggunakan Command Line (cmd) di Windows. Persis dengan apt-get di debian atau yum di rpm, tapi bukan berarti sama. Kalau mau tau lebih lanjut, silahkan baca sendiri di website resminya : https://chocolatey.org/

Nah, lalu bagaimana cara menginstall Chocolatey ini? Caranya adalah :

  1. Buka CMD kamu, dan ketikkan kode berikut:
    @powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
  2. Langsung copy-paste aja, gak perlu ragu. Trust me, it works.
  3. Jangan lupa teken tombol Enter supaya diinstall. Dan jangan lupa pastikan kamu online yah. Hehehe.
  4. Tunggu proses instalasinya. Terus..Selesai deh

Lalu apalagi? Berikut beberapa contoh penggunaannya:
This is a listing of all of the different things you can pass to choco.

Commands

* list - lists remote or local packages
* search - searches remote or local packages (alias for list)
* install - installs packages from various sources
* version - [DEPRECATED] will be removed in v1 - use `cup -whatif` instead
* pin - suppress upgrades to a package
* update - [DEPRECATED] RESERVED for future use (you are looking for upgrade, these are not the droids you are looking for)
* upgrade - upgrades packages from various sources
* outdated - retrieves packages that are outdated. Similar to upgrade all --noop
* uninstall - uninstalls a package
* source - view and configure default sources
* sources - view and configure default sources (alias for source)
* feature - view and configure choco features
* features - view and configure choco features (alias for feature)
* unpackself - have chocolatey set it self up
* pack - packages up a nuspec to a compiled nupkg
* push - pushes a compiled nupkg
* new - generates files necessary for a chocolatey package
* apikey - retrieves or saves an apikey for a particular source
* setapikey - retrieves or saves an apikey for a particular source (alias for apikey)
* config - Retrieve and configure config file settings

Please run chocolatey with "choco command -help" for specific help on
each command.

Dan ini bukti penulis menginstall cURL menggunakan Chocolatey.
C:\Windows\system32>choco install curl
Installing the following packages:
curl
By installing you accept licenses for the packages.

curl v7.28.1
ShimGen has successfully created a shim for curl.exe
The install of curl was successful.

Chocolatey installed 1/1 package(s). 0 package(s) failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Harus diperhatikan, agar tidak muncul error ketika menjalanlan “choco”, kamu harus menggunakan CMD sebagai Administrator yah. Seperti ini contoh errornya:
Chocolatey detected you are not running from an elevated command shell
(cmd/powershell).

You may experience errors - many functions/packages
require admin rights. Only advanced users should run choco w/out an
elevated shell. When you open the command shell, you should ensure
that you do so with "Run as Administrator" selected.

Do you want to continue?
1) yes
2) no

Gak cuma nginstall, ngupgrade juga bisa lho 😉
choco upgrade namaPaketnya
C:\Windows\system32>choco update ccleaner

DEPRECATION NOTICE - choco update is deprecated and will be removed or
replaced in version 1.0.0 with something that performs the functions
of updating package indexes. Please use `choco upgrade` instead.
Upgrading the following packages:
ccleaner
By upgrading you accept licenses for the packages.
ccleaner is not installed. Installing...

ccleaner v5.17.5590
The package ccleaner wants to run 'chocolateyInstall.ps1'.
Note: If you don't run this script, the installation will fail.
Note: To confirm automatically next time, use '-y' or consider setting
'allowGlobalConfirmation'. Run 'choco feature -h' for more details.
Do you want to run the script?
1) yes
2) no
3) print
1
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\No Chrome Offer Until
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google
PSChildName : No Chrome Offer Until
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
Piriform Ltd : 20991231
PSPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google\No Toolbar Offer Until
PSParentPath : Microsoft.PowerShell.Core\Registry::HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Google
PSChildName : No Toolbar Offer Until
PSDrive : HKLM
PSProvider : Microsoft.PowerShell.Core\Registry
Piriform Ltd : 20991231
Downloading ccleaner 64 bit
from 'https://download.piriform.com/ccsetup517.exe'
Installing ccleaner...
ccleaner has been installed.
The upgrade of ccleaner was successful.

Chocolatey upgraded 1/1 package(s). 0 package(s) failed.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Untuk nama-nama paketnya, bisa dilihat di website resminya yah.

Kamu mungkin ingin membaca ini juga:

Leave a Reply

Your email address will not be published. Required fields are marked *