{"id":15558474,"url":"https://github.com/lukesavefrogs/cygwin-native-package-manager","last_synced_at":"2026-04-22T15:36:40.238Z","repository":{"id":103950936,"uuid":"268053340","full_name":"LukeSavefrogs/Cygwin-Native-Package-Manager","owner":"LukeSavefrogs","description":"A way to have a CLI package manager using ONLY native Cygwin tools + bash","archived":false,"fork":false,"pushed_at":"2024-05-07T14:21:21.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-03-30T22:31:22.863Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LukeSavefrogs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"LukeSavefrogs","patreon":"LukeSavefrogs","ko_fi":"lukesavefrogs","custom":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RN3XMAHA8FZEE\u0026source=url"]}},"created_at":"2020-05-30T10:00:47.000Z","updated_at":"2025-03-29T08:06:23.000Z","dependencies_parsed_at":null,"dependency_job_id":"30d99b44-0ed5-4fe9-9dfd-3104c803903d","html_url":"https://github.com/LukeSavefrogs/Cygwin-Native-Package-Manager","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LukeSavefrogs/Cygwin-Native-Package-Manager","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2FCygwin-Native-Package-Manager","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2FCygwin-Native-Package-Manager/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2FCygwin-Native-Package-Manager/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2FCygwin-Native-Package-Manager/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LukeSavefrogs","download_url":"https://codeload.github.com/LukeSavefrogs/Cygwin-Native-Package-Manager/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LukeSavefrogs%2FCygwin-Native-Package-Manager/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32143659,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-22T15:33:03.595Z","status":"ssl_error","status_checked_at":"2026-04-22T15:30:42.712Z","response_time":58,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-02T15:35:00.286Z","updated_at":"2026-04-22T15:36:39.915Z","avatar_url":"https://github.com/LukeSavefrogs.png","language":"Shell","funding_links":["https://github.com/sponsors/LukeSavefrogs","https://patreon.com/LukeSavefrogs","https://ko-fi.com/lukesavefrogs","https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=RN3XMAHA8FZEE\u0026source=url"],"categories":[],"sub_categories":[],"readme":"# Cygwin Package Manager (native)\n## Background \nThere are many alternatives out there for having an **apt-like** Package Manager for Cygwin (as well documented [here](https://stackoverflow.com/questions/9260014/how-do-i-install-cygwin-components-from-the-command-line/23143997#23143997)) like:\n- [**apt-cyg**](https://github.com/transcode-open/apt-cyg)\n- [**cyg-apt**](https://github.com/nylen/cyg-apt)\n- The **GUI** (too mainstream)\n- Some more...\n\nBut, as a challange, i **didn't** want to **install anything** and do everything i needed using **only** Cygwin inbuilt CLI commands. \n\nOn Cygwin FAQ webpage at chapter **2.3** you can find a [list of all the parameters](https://cygwin.com/faq.html) you can pass to the setup to automate things, like specify which architecture, proxy to use AND which packages to **install** or **uninstall**.\nSo i just created a **wrapper** around these parameters. \n\n## Instructions\nTo use it:\n- Copy this code into your `~/.bashrc`:\n```Bash\nCustomPkgManager () (\n        local default='\\033[0m';\n        local red='\\033[31m';\n        local yellow='\\033[33m'\n        local cyan='\\033[36m';\n        local underlined='\\033[4m';\n\n\n        local operative_system=$(uname -o);\n        local arch=$(uname -m);\n\n        local installer_path=/tmp/CygwinSetup_${arch}.exe;\n        local max_width_column=55;\n\n        local terminal_lines=$(tput lines);\n        local terminal_columns=$(tput cols);\n\n\n        main () {\n                local option=${1,,};\n                shift;\n                \n                # This only works with Cygwin, so exclude others\n                if [[ $operative_system != \"Cygwin\" ]]; then\n                        printf \"[${red}ERROR${default}] - Operative System is not Cygwin!\\n\\n\";\n                        return 1;\n                fi\n\n                # Check if there are any options\n                [[ -z \"$option\" ]] \u0026\u0026 {\n                        printf \"[${red}ERROR${default}] - First paramtere not specified\\n\\n\";\n\n                        usage;\n                        return 1;\n                }\n\n                # If there is no installer at the specified path, download it\n                if [[ ! -f \"$installer_path\" ]]; then\n                        printf \"[${yellow}WARNING${default}] - Installer not found under path $installer_path\\n\";\n\n                        download_setup;\n                fi;\n                \n                # Do things based on the option specified as first parameter\n                case $option in\n                        \"list\")\n                                printf \"Downloading packages from repository. Please wait...\";\n                                list_of_packages=$(packages_from_repo);\n\n                                # Clear line\n                                printf \"\\r%*s\" $terminal_columns \"\";\n\n                                less \u003c\u003c\u003c \"$list_of_packages\";\n\n\n                                return 0;\n                                ;;\n                        \"search\")\n                                search_params=$(echo \"$@\" | tr -s '[:space:]' | tr ',' '|' | tr ' ' '|');\n                                [[ -z \"$search_params\" ]] \u0026\u0026 {\n                                        printf \"[${red}ERROR${default}] - No search params specified\\n\\n\";\n\n                                        usage;\n                                        return 1;\n                                }\n\n\n                                printf \"Downloading packages from repository. Please wait...\";\n                                formatted_data=$(packages_from_repo | awk \"\\$1 ~ /$search_params/{print}\" | sed -r \"s/$search_params/\\\\\\\\033[1;31m\u0026\\\\\\\\033[0m/\");\n\n                                # Check if there are results\n                                total_results=0;\n                                [[ ! -z \"$formatted_data\" ]] \u0026\u0026 total_results=$(wc -l \u003c\u003c\u003c\"$formatted_data\");\n\n                                # Clear line before printing data\n                                printf \"\\r%*s\\r\" $terminal_columns \"\";\n\n\n                                # Print data\n                                printf \"\\nTotal results: $total_results\\n\\n\"\n                                [[ ! -z \"$formatted_data\" ]] \u0026\u0026 printf \"$formatted_data\\n\";\n\n\n                                return 0;\n                                ;;\n                        \"install\")\n                                packages=$(echo \"$@\" | tr -s '[:space:]' | tr ' ' ',');\n                                [[ -z \"$packages\" ]] \u0026\u0026 {\n                                        printf \"[${red}ERROR${default}] - No packages specified\\n\\n\";\n\n                                        usage;\n                                        return 1;\n                                }\n\n\n                                printf \"Installing: $packages\\n\\n\";\n                                \"$installer_path\" -nq -WB -P $packages\n\n\n                                return 0;\n                                ;;\n                        \"remove\")\n                                packages=$(echo \"$@\" | tr -s '[:space:]' | tr ' ' ',');\n                                [[ -z \"$packages\" ]] \u0026\u0026 {\n                                        printf \"[${red}ERROR${default}] - No packages specified\\n\\n\";\n\n                                        usage;\n                                        return 1;\n                                }\n\n\n                                printf \"Removing: $packages\\n\\n\";\n                                \"$installer_path\" -nq -WB -x $packages\n\n\n                                return 0;\n                                ;;\n                        *)\n                                printf \"ERROR - Unknown option\\n\\n\";\n                                usage;\n\n                                return 1;\n                                ;;\n                esac;\n        }\n\n        # ---------------- Functions ----------------\n        usage() {\n                printf \"A small Package Manager for Cygwin made using only Cygwin inbuilt features\\n\\n\";\n                printf \"Usage:\\n\";\n                printf \"\\t${FUNCNAME[2]} list\\n\";\n                printf \"\\t${FUNCNAME[2]} search ${underlined}REGEX${default}\\n\";\n                printf \"\\t${FUNCNAME[2]} install ${underlined}PACKAGE${default}\\n\";\n                printf \"\\t${FUNCNAME[2]} remove ${underlined}PACKAGE${default}\\n\";\n        }\n\n\n        download_setup() {\n                printf \"Download: \";\n                [[ $arch == \"x86_64\" ]] \u0026\u0026 {\n                        download_url='https://cygwin.com/setup-x86_64.exe';\n                } || {\n                        download_url='https://cygwin.com/setup-x86.exe';\n                }\n\n\n                curl -s \"$download_url\" \u003e \"$installer_path\" \u0026\u0026 printf \"${green}OK${default}\\n\\n\" || printf \"${red}ERRORE${default}\\n\\n\";\n                chmod 777 \"$installer_path\";\n        }\n\n\n        # Retrieves packages and descriptions from the package list hosted on Cygwin Official Website\n        packages_from_repo() (\n                data=$(curl -s --ssl-no-revoke https://cygwin.com/packages/package_list.html);\n\n                awk -v max_length=$max_width_column '\n                        /href=\"summary/{\n                                line=$0;\n                                name=\"\";\n                                description=\"\";\n\n                                name=substr(line, index(line, \".html\\\"\u003e\")+7);\n                                name=substr(name, 0, index(name, \"\u003c/a\u003e\")-1);\n\n                                description=substr(line, index(line, \"\u003c/a\u003e\u003c/td\u003e\u003ctd\u003e\")+13);\n                                description=substr(description, 0, index(description, \"\u003c/td\u003e\u003c/tr\u003e\")-1);\n\n                                printf(\"%-*s - %s\\n\", max_length, name, description);\n                        }\n                ' \u003c\u003c\u003c\"$data\";\n        );\n\n        main \"$@\";\n\n        return $?;\n)\n```\nThen, to use it you can call the function with apt-like parameters like this:\n- `CustomPkgManager install sl`\n- `CustomPkgManager search nano`\n\n## Tips \nTo make everything more user-friendly you can use handy and easy-to-remember aliases: \n```Bash\nalias pkgInstall='CustomPkgManager install'\nalias pkgRemove='CustomPkgManager remove'\nalias pkgList='CustomPkgManager list'\nalias pkgSearch='CustomPkgManager search'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukesavefrogs%2Fcygwin-native-package-manager","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flukesavefrogs%2Fcygwin-native-package-manager","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flukesavefrogs%2Fcygwin-native-package-manager/lists"}