Development environment configuration scripts for Ubuntu Desktop.
Not intended for production. Use at your own risk!
Goal: Reduce the time it takes to configure a new Ubuntu Desktop environment for software development.
-
Clone the repo:
git clone https://github.com/yaphott/ubuntu-config-scripts.git
-
Run the script:
cd ubuntu-config-scripts bash ./run.sh
-
A system upgrade will commence and the system will prompt to reboot.
-
After rebooting, run the script once more and respond to any prompts.
Testing occurs in 2 stages:
- Provision a base box and create a snapshot.
- Restore the snapshot and run the configuration scripts.
Creating the snapshot reduces the overall time needed to test the configuration scripts in a clean environment.
First time (base box + main box):
make test-cold
Subsequent times (main box):
make test-warm
Note: Password for the user is
vagrant
.
Add a keyring to the system by providing a key URL and the desired path for the keyring file.
add_keyring.sh <key_url> <key_file_path>
For example using a binary GPG keyring URL:
key_url="https://example.com/apt/keys.gpg"
key_file_path="/etc/apt/keyrings/example-keyring.gpg"
sudo bash ./bin/utils/add_keyring.sh "${key_url}" "${key_file_path}"
Or using an ASCII-armored GPG keyring URL:
key_url="https://example.com/apt/keys.asc"
key_file_path="/etc/apt/keyrings/example-keyring.gpg"
sudo bash ./bin/utils/add_keyring.sh "${key_url}" "${key_file_path}"
Add a repository to the system by providing the repository options, repository URI, repository suite, repository components, and the desired path for the repository list file.
add_repository.sh <repo_options> <repo_uri> <repo_suite> <repo_components> <repo_file_path>
For example, if there is one component:
key_file_path="/etc/apt/keyrings/example-keyring.gpg"
repo_options="arch=$(dpkg --print-architecture) signed-by=${key_file_path}"
repo_uri="https://apt.releases.example.com"
repo_suite="$(lsb_release -cs)"
repo_components="main"
repo_file_path="/etc/apt/sources.list.d/example.list"
bash ./bin/utils/add_repository.sh "${repo_options}" "${repo_uri}" "${repo_suite}" "${repo_components}" "${repo_file_path}"
Or if there are multiple components:
key_file_path="/etc/apt/keyrings/example-keyring.gpg"
repo_options="arch=$(dpkg --print-architecture) signed-by=${key_file_path}"
repo_uri="https://apt.releases.example.com"
repo_suite="$(lsb_release -cs)"
repo_components="main contrib non-free"
repo_file_path="/etc/apt/sources.list.d/example.list"
bash ./bin/utils/add_repository.sh "${repo_options}" "${repo_uri}" "${repo_suite}" "${repo_components}" "${repo_file_path}"
Or if there are no components:
key_file_path="/etc/apt/keyrings/example-keyring.gpg"
repo_options="arch=$(dpkg --print-architecture) signed-by=${key_file_path}"
repo_uri="https://apt.releases.example.com"
repo_suite="$(lsb_release -cs)"
repo_components=""
repo_file_path="/etc/apt/sources.list.d/example.list"
bash ./bin/utils/add_repository.sh "${repo_options}" "${repo_uri}" "${repo_suite}" "${repo_components}" "${repo_file_path}"
See Ubuntu Manpage:
sources.list
for more information on the format of the list file.
All install and configuration scripts should attempt to verify the necessary setup and/or configuration has completed successfully.
Install the required Vagrant plugins by running the following command:
vagrant plugin install vagrant-disksize
Update installed Vagrant plugins by running the following command:
vagrant plugin update
dconf watch /
To monitor changes to specific directories or files, you can use the inotifywatch
command:
inotifywatch -e modify,create,delete -r ~/.config
inotifywatch -e modify,create,delete -r ~/snap/firefox/common/.mozilla
inotifywatch -e modify,create,delete -r ~/.local
inotifywatch -e modify,create,delete -r /etc/default
Note: The above commands require
inotify-tools
to be installed. You can install it using the following command:
sudo apt-get update
sudo apt-get install inotify-tools