{"id":13494413,"url":"https://github.com/binpash/try","last_synced_at":"2026-05-03T16:05:57.340Z","repository":{"id":166583063,"uuid":"642077719","full_name":"binpash/try","owner":"binpash","description":"Inspect a command's effects before modifying your live system","archived":false,"fork":false,"pushed_at":"2026-04-25T22:04:13.000Z","size":92161,"stargazers_count":5430,"open_issues_count":33,"forks_count":79,"subscribers_count":5,"default_branch":"main","last_synced_at":"2026-04-26T00:18:22.496Z","etag":null,"topics":["administration","containers","shell","tools","virtualization"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/binpash.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2023-05-17T19:15:04.000Z","updated_at":"2026-04-23T23:15:50.000Z","dependencies_parsed_at":"2023-12-19T17:16:35.553Z","dependency_job_id":"38a9622b-509a-43bf-acfd-5e9c45f22acf","html_url":"https://github.com/binpash/try","commit_stats":null,"previous_names":["binpash/try"],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/binpash/try","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Ftry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Ftry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Ftry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Ftry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/binpash","download_url":"https://codeload.github.com/binpash/try/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/binpash%2Ftry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32575173,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["administration","containers","shell","tools","virtualization"],"created_at":"2024-07-31T19:01:24.842Z","updated_at":"2026-05-03T16:05:57.302Z","avatar_url":"https://github.com/binpash.png","language":"Shell","funding_links":[],"categories":["Shell","tools"],"sub_categories":[],"readme":"# try\n\n\u003cimg src=\"docs/try_logo.png\" alt=\"try logo\" width=\"100\" height=\"130\"\u003e\n\n\"Do, or do not. There is no try.\"\n\nWe're setting out to change that: `try cmd` and commit---or not.\n\n## Description\n[![Main workflow](https://github.com/binpash/try/actions/workflows/test.yaml/badge.svg)](https://github.com/binpash/try/actions/workflows/test.yaml)\n[![License](https://img.shields.io/badge/License-MIT-blue)](#license)\n[![issues - try](https://img.shields.io/github/issues/binpash/try)](https://github.com/binpash/try/issues)\n\n`try` lets you run a command and inspect its effects before changing your live system. `try` uses Linux's [namespaces (via `unshare`)](https://docs.kernel.org/userspace-api/unshare.html) and the [overlayfs](https://docs.kernel.org/filesystems/overlayfs.html) union filesystem.\n\nPlease note that `try` is a prototype and not a full sandbox, and should not be used to execute\ncommands that you don't already trust on your system, (i.e. network calls are all allowed)\n\n\u003cimg src=\"docs/try_pip_install_example.gif\" alt=\"try gif\"\u003e\n\n## Getting Started\n\n### Dependencies\n\n`try` relies on the following Debian packages\n\n* `attr` (for `getfattr`)\n* `pandoc` and `autoconf` (if working from a GitHub clone)\n\nIn cases where overlayfs doesn't work on nested mounts, you will need either\n[mergerfs](https://github.com/trapexit/mergerfs) or [unionfs](https://github.com/rpodgorny/unionfs-fuse). `try` should be able to autodetect them, but you can specify the path to mergerfs or unionfs with -U (e.g. `try -U ~/.local/bin/unionfs`)\n\nTo run `try`'s test suite (`scripts/run_tests.sh`), you will need:\n\n* `bash`\n* `expect`\n* `curl`\n\n`try` has been tested on the following distributions:\n\n* `Ubuntu 20.04 LTS` or later\n* `Debian 12`\n* `Fedora 38`\n* `Centos 9 Stream 5.14.0-325.el9`\n* `Arch 6.1.33-1-lts`\n* `Alpine 6.1.34-1-lts`\n* `Rocky 9 5.14.0-284.11.1.el9_2`\n* `SteamOS 3.4.8 5.13.0-valve36-1-neptune`\n\n*Note that try will only work on [Linux\n5.11](https://github.com/torvalds/linux/commit/92dbc9dedccb9759c7f9f2f0ae6242396376988f)\nor higher for overlayfs to work in a user namespace.*\n\n### Installing\n\nThere are three ways to install try:\n\n1. **The quick and janky way: grab the script.** You only need the [`try` script](https://raw.githubusercontent.com/binpash/try/main/try). Put it in your `PATH` and you're ready to go. You won't have documentation or utility support, but it should work as is.\n\n2. **By cloning the repository.** Run the following:\n```ShellSession\n$ git clone https://github.com/binpash/try.git\n$ autoconf \u0026\u0026 ./configure \u0026\u0026 make \u0026\u0026 sudo make install\n```\nYou should now have a fully featured `try`, including the support utilities (which should help `try` run faster) and manpage. Run `make test` to confirm that everything works.\n\n3. **By using a source distribution.** Download `try-XXX.tgz` from [the release page](https://github.com/binpash/try/releases). You can get the latest prerelease by downloading [`try-latest.tgz`](https://github.com/binpash/try/releases/download/latest/try-latest.tgz). You can then install similarly to the above:\n```ShellSession\n$ git clone https://github.com/binpash/try.git\n$ ./configure \u0026\u0026 make \u0026\u0026 sudo make install\n```\n\nThe repository and source distribution are slightly different: the repository does not include the `configure` script (generated by `autoconf`) or the manpage (generated by `pandoc`), but the source distribution does.\n\n#### Arch Linux\n\n`try` is present in [AUR](https://aur.archlinux.org/packages/try), you can install it with your preferred AUR helper:\n\n```shellsession\nyay -S try\n```\n\nor manually:\n\n```shellsession\ngit clone https://aur.archlinux.org/try.git\ncd try\nmakepkg -sic\n```\n\n#### Nix/NixOS\n\n`try` is present in [nixpkgs](https://search.nixos.org/packages?channel=unstable\u0026show=try\u0026from=0\u0026size=50\u0026sort=relevance\u0026type=packages\u0026query=try) and maintained by us.\n\n```shellsession\nnix-shell -p try\n```\n\n## Example Usage\n\n`try` is a higher-order command, like `xargs`, `exec`, `nohup`, or `find`. For example, to install a package via `pip3`, you can invoke `try` as follows:\n\n```ShellSession\n$ try pip3 install libdash\n... # output continued below\n```\n\nBy default, `try` will ask you to commit the changes made at the end of its execution.\n\n```ShellSession\n...\nDefaulting to user installation because normal site-packages is not writeable\nCollecting libdash\n  Downloading libdash-0.3.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (254 kB)\n     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 254.6/254.6 KB 2.1 MB/s eta 0:00:00\nInstalling collected packages: libdash\nSuccessfully installed libdash-0.3.1\nWARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv\n\nChanges detected in the following files:\n\n/tmp/tmp.zHCkY9jtIT/upperdir/home/gliargovas/.local/lib/python3.10/site-packages/libdash/ast.py (modified/added)\n/tmp/tmp.zHCkY9jtIT/upperdir/home/gliargovas/.local/lib/python3.10/site-packages/libdash/_dash.py (modified/added)\n/tmp/tmp.zHCkY9jtIT/upperdir/home/gliargovas/.local/lib/python3.10/site-packages/libdash/__init__.py (modified/added)\n/tmp/tmp.zHCkY9jtIT/upperdir/home/gliargovas/.local/lib/python3.10/site-packages/libdash/__pycache__/printer.cpython-310.pyc (modified/added)\n/tmp/tmp.zHCkY9jtIT/upperdir/home/gliargovas/.local/lib/python3.10/site-packages/libdash/__pycache__/ast.cpython-310.pyc (modified/added)\n\u003csnip\u003e\n\nCommit these changes? [y/N] y\n```\n\nSometimes, you might want to pre-execute a command and commit its result at a later time. Running `try -n` will print the overlay directory on STDOUT without committing the result.\n\n```ShellSession\n$ try -n \"curl https://sh.rustup.rs | sh\"\n/tmp/tmp.uCThKq7LBK\n```\n\nAlternatively, you can specify your own existing overlay directory using the `-D [dir]` flag:\n\n```ShellSession\n$ mkdir rustup-sandbox\n$ try -D rustup-sandbox \"curl https://sh.rustup.rs | sh\"\n$ ls rustup-sandbox\ntemproot  upperdir  workdir\n```\n\nAs you can see from the output above, `try` has created an overlay environment in the `rustup-sandbox` directory.\n\nManually inspecting upperdir reveals the changes to the files made inside the overlay during the execution of the previous command with *try*:\n\n```ShellSession\n~/try/rustup-sandbox/upperdir$ du -hs .\n1.2G    .\n```\n\nYou can inspect the changes made inside a given overlay directory using `try`:\n\n```ShellSession\n$ try summary rustup-sandbox/ | head\n\nChanges detected in the following files:\n\nrustup-sandbox//upperdir/home/ubuntu/.profile (modified/added)\nrustup-sandbox//upperdir/home/ubuntu/.bashrc (modified/added)\nrustup-sandbox//upperdir/home/ubuntu/.rustup/update-hashes/stable-x86_64-unknown-linux-gnu (modified/added)\nrustup-sandbox//upperdir/home/ubuntu/.rustup/settings.toml (modified/added)\nrustup-sandbox//upperdir/home/ubuntu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/libstd-8389830094602f5a.so (modified/added)\nrustup-sandbox//upperdir/home/ubuntu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/etc/lldb_commands (modified/added)\nrustup-sandbox//upperdir/home/ubuntu/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/etc/gdb_lookup.py (modified/added)\n```\n\nYou can also choose to commit the overlay directory contents:\n\n```ShellSession\n$ try commit rustup-sandbox\n```\n\nYou can also run `try explore` to open your current shell in try, or `/try\nexplore /tmp/tmp.X6OQb5tJwr` to explore an existing sandbox.\n\nTo specify multiple lower directories for overlay (by merging them together), you can use the `-L` (implies `-n`) flag followed by a colon-separated list of directories. The directories on the left have higher precedence and can overwrite the directories on the right:\n\n```ShellSession\n$ try -D /tmp/sandbox1 \"echo 'File 1 Contents - sandbox1' \u003e file1.txt\"\n$ try -D /tmp/sandbox2 \"echo 'File 2 Contents - sandbox2' \u003e file2.txt\"\n$ try -D /tmp/sandbox3 \"echo 'File 2 Contents - sandbox3' \u003e file2.txt\"\n\n# Now use the -L flag to merge both sandbox directories together, with sandbox3 having precedence over sandbox2\n$ try -L \"/tmp/sandbox3:/tmp/sandbox2:/tmp/sandbox1\" \"cat file1.txt file2.txt\"\nFile 1 Contents - sandbox1\nFile 2 Contents - sandbox3\n```\n\nIn this example, `try` will merge `/sandbox1`, `/sandbox2` and `/sandbox3` together before mounting the overlay. This way, you can combine the contents of multiple `try` sandboxes.\n\n\n## Known Issues\nAny command that interacts with other users/groups will fail since only the\ncurrent user's UID/GID are mapped. However, the [future\nbranch](https://github.com/binpash/try/tree/future) has support for uid/mapping;\nplease refer to the that branch's readme for installation instructions for the\nuid/gidmapper (root access is required for installation).\n\nShell quoting may be unintuitive, you may expect `try bash -c \"echo a\"` to work,\nhowever, try will actually execute `bash -c echo a`, which will not result in\n`a` being printed. [We are currently not planning on resolving this\nbehavior.](https://github.com/binpash/try/issues/155#issuecomment-2078556237)\n\nPlease also report any issue you run into while using the future branch!\n\n## Version History\n\n* v0.2.0 - 2023-07-24\n  - Refactor tests.\n  - Improved linting.\n  - Hide `try`-internal variables from scripts.\n  - Style guide.\n  - Testing in Vagrant.\n  - Support nested mounts.\n  - Resolve issues with `userxattr`.\n  - Better support for `unionfs`.\n  - Use `/bin/sh`, not `/bin/bash`.\n  - `-i` flag to ignore paths.\n  - Interactive improvements.\n\n* v0.1.0 - 2023-06-25\n  - Initial release.\n\n## See Also\n\n[checkinstall](http://checkinstall.izto.org/) (unmaintained)\n\ncheckinstall keeps track of all the files created or modified by your\ninstallation script, builds a standard binary package and installs it in your\nsystem. This package can then be easily installed, managed, and removed using\nthe package manager of your Linux distribution. It helps in maintaining a clean\nand organized system by keeping track of installed software and its\ndependencies.\n\n## License\n\nThis project is licensed under the MIT License - see LICENSE for details.\n\nCopyright (c) 2023 The PaSh Authors.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinpash%2Ftry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbinpash%2Ftry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbinpash%2Ftry/lists"}