{"id":36850547,"url":"https://github.com/cosandr/go-check-updates","last_synced_at":"2026-01-12T14:37:13.667Z","repository":{"id":57525635,"uuid":"294758453","full_name":"cosandr/go-check-updates","owner":"cosandr","description":"Check for updates and expose them through API or websocket","archived":false,"fork":false,"pushed_at":"2021-04-14T12:41:05.000Z","size":1934,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-06-21T10:39:49.677Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cosandr.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-09-11T17:15:48.000Z","updated_at":"2024-06-21T10:39:49.678Z","dependencies_parsed_at":"2022-08-28T20:22:17.739Z","dependency_job_id":null,"html_url":"https://github.com/cosandr/go-check-updates","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/cosandr/go-check-updates","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosandr%2Fgo-check-updates","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosandr%2Fgo-check-updates/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosandr%2Fgo-check-updates/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosandr%2Fgo-check-updates/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosandr","download_url":"https://codeload.github.com/cosandr/go-check-updates/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosandr%2Fgo-check-updates/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28340403,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T12:22:26.515Z","status":"ssl_error","status_checked_at":"2026-01-12T12:22:10.856Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6: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":"2026-01-12T14:37:12.684Z","updated_at":"2026-01-12T14:37:13.660Z","avatar_url":"https://github.com/cosandr.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Report Card](https://goreportcard.com/badge/github.com/cosandr/go-check-updates)](https://goreportcard.com/report/github.com/cosandr/go-check-updates) [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/cosandr/go-check-updates/blob/master/LICENSE)\n\n# Introduction\n\nA program to check for updates and make the list of updates available through a JSON file or a simple API.\nBy default it will check for updates every 12 hours,\nif run in daemon mode then it will refresh every 12 hours,\notherwise it simply does nothing when run before 12 hours has passed since the previous update.\n\nThe default cache file may change, the first choice is `/tmp/go-check-updates.json`.\nIf the file exists but it isn't writable, it will fallback to `$HOME/.cache/go-check-updates/cache.json` instead.\n\nIt can be disabled completely with `--no-cache`.\n\nThe refresh interval can be changed with the `--cache.interval` option, disable with `--no-refresh`.\nDisabled without daemon mode will refresh every time it is run, with daemon mode there is no auto-refresh.\n\nIt is also possible to monitor the package manager logs, this functionality can be enabled with `-w` or `--watch.enable`.\nEnabled by default when using `setup.sh` to generate systemd units.\n\nSee `go-check-updates -h` for up to date information on the parameters.\n\nThis can then be read by other scripts, for example my own [go-motd](https://github.com/cosandr/go-motd).\n\n## Supported package managers\n\nManager | Name | Old Ver | New Ver | Repo | Logs\n--- | --- | --- | --- | --- | ---\npacman | Y | Y | Y | N* | Y\ndnf/yum | Y | N | Y | Y | Y\n\n\\* Repo is set to \"pacman\"\n\nNOTE: pacman only tested on Arch Linux, dnf/yum only tested on Fedora\n\n## Supported AUR helpers\n\nManager | Name | Old Ver | New Ver | Repo | Logs\n--- | --- | --- | --- | --- | ---\nyay | Y | Y | Y | N* | N/A\npikaur | Y | Y | Y | N* | N/A\nparu | Y | Y | Y | N* | N/A\n\n\\* Repo to \"aur\"\n\nNOTE: Only tested on Arch Linux\n\n## Installation\n\n### Arch Linux\n\n```sh\ngit clone https://github.com/cosandr/go-check-updates.git\ncd go-check-updates/PKGBUILD\nmakepkg -si\n```\n\nEnable and start `go-check-updates.socket`, the pacman hook triggers after every update/remove.\n\n### Generic\n\nUse [setup.sh](setup.sh), read the help it prints out `setup.sh -h`\n\n## Usage\n\nAssuming it is listening on `localhost:8100`.\nSee API section for more details.\n\n```sh\n# Update now, returns after update has completed\n$ curl 'http://localhost:8100/api?refresh'\n{}\n# Refresh internal cache by reading package manager log file\n# Best used in post-install hooks as it is quite fast\n$ curl 'http://localhost:8100/api?refresh\u0026log_file'\n{}\n# Update now, return file location immediately\n$ curl 'http://localhost:8100/api?refresh\u0026filepath\u0026immediate'\n{\"filePath\":\"/tmp/go-check-updates.json\",\"queued\":true}\n# Get current list of updates\n$ curl 'http://localhost:8100/api?updates'\n{\"data\":{\"checked\":\"2020-06-02T13:28:16+02:00\",\"updates\":[]}}\n# Get current updates, update if file is older than 1 hour and return immediately\n# Status code will be 202 and the \"queued\" key will be present and true if an update was queued\n# If no update is needed, status code is 200 and there is no queued key present\n$ curl 'http://localhost:8100/api?refresh\u0026updates\u0026immediate\u0026every=1h'\n{\"data\":{\"checked\":\"2020-09-11T14:47:21+02:00\",\"updates\":[{\"pkg\":\"snapper\",\"oldVer\":\"0.8.12-1\",\"newVer\":\"0.8.13-1\",\"repo\":\"pacman\"}]},\"queued\":true}\n# Can run directly as well (-every can be passed as argument)\n$ go-check-updates\n```\n\n## Example output\n\nNote this is what the API returns in the `data` key, the websocket returns exactly this data directly.\n\n```json\n{\n  \"checked\": \"2020-06-01T23:10:23+02:00\",\n  \"updates\": [\n    {\n      \"pkg\": \"archiso\",\n      \"oldVer\": \"43-2\",\n      \"newVer\": \"44-2\",\n      \"repo\": \"pacman\"\n    },\n    {\n      \"pkg\": \"ca-certificates-mozilla\",\n      \"oldVer\": \"3.52.1-2\",\n      \"newVer\": \"3.53-1\",\n      \"repo\": \"pacman\"\n    },\n    {\n      \"pkg\": \"imagemagick\",\n      \"oldVer\": \"7.0.10.15-1\",\n      \"newVer\": \"7.0.10.16-2\",\n      \"repo\": \"pacman\"\n    }\n  ]\n}\n```\n\n## API\n\nRun with `--daemon` argument to start a web server,\nlisten address and port can be adjusted with `--web.listen-address`.\n\nAlternatively, systemd socket activation can be used with the `--systemd` argument, socket and service units can be\ncreated with the `setup.sh` script.\n\n`/api` endpoint\n\nOne of these parameters must be present:\n\n- `filepath` returns path to the cache file in use\n- `updates` returns currently cached updates\n- `refresh` refreshes cached update list, the other commands run after this one. The following parameters can\nbe combined with this one\n  - `every` value parsed as time duration, it will only refresh if the file is older than this duration\n  - `immediate` won't wait for the request to finish before returning, returned data (if requested) is likely\n    out of date\n  - `log_file` refresh using package manager log file\n\nStatus codes:\n\n- `200` request was successful\n- `400` bad argument(s)\n- `202` update queued\n- `500` something went wrong server side, `Error` is included in response with more details\n\n## Websocket\n\nRequires web server (daemon or systemd mode). Connect to `/ws` endpoint to receive\ndata (same as the JSON file) when updates are refreshed.\n\nExample usage in my [Polybar setup](https://github.com/cosandr/dotfiles/blob/master/dot_config/polybar/scripts/executable_go-check-updates-ws.py).\n\n## Discord notifications\n\nEdit `/etc/sysconfig/go-check-updates` and add `NOTIFY_ENABLE=1` and `WEBHOOK_URL=\"\u003curl\u003e\"`.\nBy default notifications are only sent every hour at most (to prevent spam when upgrading packages),\nthis can be adjusted with the `NOTIFY_INTERVAL` env variable.\n\nEnabling delta notifications `NOTIFY_DELTA` or `--notify.delta` will only send updates which were not present in the last notification, this is particularly useful when a large number of updates are pending.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosandr%2Fgo-check-updates","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosandr%2Fgo-check-updates","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosandr%2Fgo-check-updates/lists"}