Du kannst nicht mehr als 25 Themen auswählen Themen müssen entweder mit einem Buchstaben oder einer Ziffer beginnen. Sie können Bindestriche („-“) enthalten und bis zu 35 Zeichen lang sein.

lab9-solution.org 2.3 KiB

vor 11 Monaten
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. #+title: Lab9 Solution
  2. #+title: Amirlan Sharipov (BS21-CS-01)
  3. #+author: Amirlan Sharipov (BS21-CS-01)
  4. #+PROPERTY: header-args :results verbatim :exports both
  5. #+OPTIONS: ^:nil
  6. * Question 1
  7. One of the alternative is to use GPS-based ntp and sync time with the satellites.
  8. * Question 2
  9. Use one server as an ntp client and another as an ntp server and sync them regularly using cron.
  10. * Question 3
  11. apt is a new command-line interface aimer for interactive usage.
  12. apt is a high-level tool to interact with tools like apt-get and apt-cache.
  13. * Question 4
  14. upgrade only upgrades the packages and never removes them, whereas full-upgrade may result in removal of some packages. This may cause problems for system administrators.
  15. * Question 5
  16. The information is taken from https://linuxhint.com/install-atom-text-editor-ubuntu-22-04/
  17. I am very skeptical about this method. Atom is deprecated. As well as apt-key. But it works
  18. ** Add gpg atom's gpg keys
  19. wget -qO - https://packagecloud.io/AtomEditor/atom/gpgkey | sudo apt-key add -
  20. ** Add atom's repository to sources list
  21. sudo sh -c 'echo "deb [arch=amd64] https://packagecloud.io/AtomEditor/atom/any/ any main" > /etc/apt/sources.list.d/atom.list'
  22. ** Dowload packages information from all sources
  23. sudo apt update
  24. ** Search for atom
  25. apt search atom
  26. There was a huge output with atom in it.
  27. ** Finally install atom
  28. sudo apt install atom
  29. * Question 6
  30. #+begin_src bash
  31. cat control create-package.sh
  32. #+end_src
  33. #+RESULTS:
  34. #+begin_example
  35. Package: hellopackage
  36. Version: 1.0
  37. Architecture: all
  38. Maintainer: RinRi
  39. Depends: python3
  40. Description: Hello world
  41. #!/bin/bash
  42. rm -rf hellopackage
  43. mkdir -p hellopackage hellopackage/usr/local/bin hellopackage/var/helloworld
  44. printf "%s" '#!/usr/bin/env python3\nprint("Hello, World!")' > hellopackage/var/helloworld/helloworld.py
  45. printf "%s" '#!/bin/bash\n/var/helloworld/helloworld.py' > hellopackage/usr/local/bin/helloworld
  46. chmod -R 0755 hellopackage/var/helloworld hellopackage/usr/local/bin/helloworld
  47. mkdir -p hellopackage/DEBIAN
  48. cp control hellopackage/DEBIAN/
  49. dpkg-deb --build --root-owner-group hellopackage
  50. #+end_example
  51. After this just use sudo apt install ./hellopackage.deb and everything works.
  52. [[./lab9-image-01.jpg]]
  53. The artifacts created by the package are the same as in the image but from the root directory.