Canonical interview take home test
- Get the source code of that Debian package.
- Add an executable bash script called “testing.sh” Executing testing.sh will echo “this is a test from Yi-Tse Wu ” on the console.
- Please echo string “this is a test from Yi-Tse Wu” during the Debian package installation time.
- Host all of your change to a public git repository (e.g. launchpad git, Github or GitLab)
- Dput the source change to your ppa.
- Install your package from your ppa.
- Past the message printed by the installation. The string “this is a test from Yi-Tse Wu” is expected.
- Past the executing result of
dpkg -S testing.sh; testing.sh
The string “this is a test from {your name}” is expected. - Record things that you experienced for this task on this mail as a document. Image the steps is to guide people who did not experience this task to finish this task.
- sudo nano /etc/apt/sources.list
- Uncomment the third line
- sudo spt-get update
- apt-get source hello
- Create a shell named testing.sh in /hello-2.10/src which contains just one line script, echo "this is a test from Yi-Tse Wu"
- Create a file named “postinst” in /hello-2.10/debian
- Write a command, echo "this is a test from Yi-Tse Wu", in postinst
- Create a file named “install” in /hello-2.10/debian
- Write a command, src/testing.sh usr/bin, in install
- Delete a file named “format” in /hello-2.10/Debian/source
- debuild -us -uc (for test)
- sudo dpkg -i hello_2.10-2_armhf.deb (for test)
- debuild -S (for uploading to launchpad)
- debsign -k hello_2.10-2_source.changes (for uploading to launchpad)
- Add the computer SSH key into Github
- git config --global user.email [email protected]
- git config --global user.name "Steven-YiTseWu"
- git init
- git add -A
- git commit -m 'Added my project'
- git remote add origin [email protected]:Steven-YiTseWu/Learn-Debian-package.git
- git branch -m master main
- git push -f origin main
- Create a launchpad account and build a PPA named yitse-hello
- Generate GPG Key and send it to ubuntu server
A. gpg --gen-key
B. gpg –fingerprint C. gpg --keyserver hkps://keyserver.ubuntu.com --send-keys myKey - Upload the fingerprint to PPA, and verify it according to mail send by launchpad
- Upload the SSH key to launchpad
- Install dput, sudo apt-get install dput
- Install debuild, sudo apt-get install devscripts build-essential lintian
- sudo nano ~/.dput.cf
- dput -f my-ppa hello_2.10-2_source.changes
- sudo add-apt-repository ppa:stevenyitsewu/yitse-hello
- sudo apt update
- sudo apt-cache policy hello, find two same name packages
- sudo apt install hello=2.10-2
- dpkg -S testing.sh; testing.sh