Fedora-first Linux development with Codex
A practical environment guide for Bash, native Git, project toolchains and safe system boundaries. Fedora Workstation and Fedora KDE are the reference; Ubuntu/Debian and Arch equivalents appear where package commands genuinely differ.
Environment architecture
Think in layers: Linux host and desktop, terminal and shell, repository and Git, Codex client, then project-local runtimes. A desktop application, a terminal process and a project dependency are different layers with different failure modes.
Terminal emulator displays the session; Bash interprets commands, expands paths and returns exit codes.
Git status and diffs establish what Codex may inspect or modify. Keep unrelated work visible and preserved.
Choose an available interface, authenticate with ChatGPT or an API key, and select the intended project directory.
Bash, PATH and startup files
Use Bash for the examples. The shell, terminal and desktop are separate components. Bash reads different startup files for login and interactive non-login sessions, so a variable or alias may not appear in every context.
printf 'shell: %s\n' "$SHELL"
printf 'working directory: %s\n' "$PWD"
printf 'home: %s\n' "$HOME"
printf 'path: %s\n' "$PATH"
command -v bash
bash --versionUse ~ or $HOME for your home directory. Quote paths that may contain spaces. Single quotes preserve literal characters; double quotes still expand variables. Use ./script only when the file is executable and has a valid interpreter.
References: Bash quoting and Bash startup files.
Filesystem locations and paths
Linux uses one tree rooted at /. Developers commonly work under /home/you. System configuration is commonly in /etc, programs in /usr, variable data in /var, optional software in /opt, temporary files in /tmp and runtime state in /run.
pwd
ls -la
find . -maxdepth 2 -type f -print | sort
readlink -f .Names are normally case-sensitive. Dotfiles such as .git and .env are hidden by ordinary ls. A symlink points elsewhere; resolve it before assuming a path stays inside the repository.
Permissions, ownership and sudo
Permissions apply to owner, group and other users. r reads, w writes and x executes a file or traverses a directory.
ls -l script.sh
id
namei -l script.shchmod u+x script.sh
./script.shsudo elevates one command. Use it only for the specific operation that requires administration. Do not run an entire Codex session as root. Package installation and system service changes often need elevation; repository inspection and project-local tests usually do not.
Package management and dependencies
Distribution packages provide system software and development headers. Project manifests should own application dependencies. These commands change the machine and must be reviewed before running.
# Fedora
sudo dnf install git gcc
# Ubuntu / Debian
sudo apt install git gcc
# Arch Linux
sudo pacman -S git gccDNF, APT and Pacman have different repositories and release policies. Confirm names for the target distribution. Flatpak, Snap and AppImage distribute desktop applications; they do not replace a project’s Python, Node, Rust or C/C++ dependency manifest.
References: DNF install, APT and Pacman.
Codex interfaces and authentication
The Codex CLI can inspect a local repository, edit files and run installed tools. The official Linux installer is available for macOS/Linux, and the first run asks you to sign in. ChatGPT and API-key authentication have different account and data policies.
curl -fsSL https://chatgpt.com/codex/install.sh | sh
cd "$HOME/Projects/my-project"
codexReview the command before executing a remote installer and confirm the official source. For the Linux desktop preview, supported distribution and architecture combinations change over time; use the current official download page rather than guessing a package URL.
References: Codex CLI, Authentication and ChatGPT desktop app for Linux.
Project toolchains
Prefer project-local, reproducible environments. Python projects commonly use venv; JavaScript projects use package.json and a lockfile; Rust uses rustup and Cargo; C/C++ projects declare compiler/build requirements; Java projects use a JDK with Maven or Gradle.
python3 -m venv .venv
. .venv/bin/activate
python -m pip install -r requirements.txt
python -m pytestnpm ci
npm test
cargo test
cargo fmt --check
cargo clippy -- -D warnings
cmake -S . -B build && cmake --build buildRun only commands documented by the project. npm ci requires a lockfile and changes the local dependency directory. Keep system packages separate from project dependencies.
References: Python venv, npm ci, Cargo test, Cargo fmt and CMake.
Diagnostics and services
Use symptom → evidence → hypothesis → test → fix → verification. Inspect only the evidence needed; avoid posting credentials or a complete environment dump.
ps -ef | head
free -h
df -h .
du -sh .
ss -ltnp
command -v node python3 git
printenv PATHMany Fedora installations use systemd, but systemd is not universal. For a systemd service, systemctl status name.service and journalctl -u name.service inspect state and logs. User services use systemctl --user. Starting, stopping or restarting a service changes the environment and needs a specific authorized target.
Linux pitfalls and safe fixes
Wrong working directory or PATH
Compare $PWD, command -v tool and the project’s documented runtime. A shell startup difference can explain why a command works interactively but fails in a task runner.
Permission denied
Inspect with ls -l and namei -l. Fix the narrow file or directory permission that the project owns; do not solve a project issue by making an entire tree world-writable.
Occupied port or service conflict
Use ss -ltnp to identify the listener, then stop only the process you understand. Do not kill arbitrary processes or restart unrelated services.
Case, symlink or mount mismatch
Linux normally distinguishes case and follows symlinks. Resolve the path and check the mount before changing imports or repository structure.
Ready to work in the repository?
Follow the nine-stage Linux Codex workflow.