{"id":23058152,"url":"https://github.com/samwhelp/demo-repository-ubuntu","last_synced_at":"2026-05-17T02:48:57.848Z","repository":{"id":90411889,"uuid":"96491645","full_name":"samwhelp/demo-repository-ubuntu","owner":"samwhelp","description":"Demo Ubuntu Repository","archived":false,"fork":false,"pushed_at":"2017-11-08T15:49:37.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"gh-pages","last_synced_at":"2025-02-08T20:12:30.332Z","etag":null,"topics":["apt","deb","debian","repository","ubuntu"],"latest_commit_sha":null,"homepage":"https://samwhelp.github.io/demo-repository-ubuntu/","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/samwhelp.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}},"created_at":"2017-07-07T02:38:35.000Z","updated_at":"2017-07-07T07:04:33.000Z","dependencies_parsed_at":"2023-03-30T06:09:36.834Z","dependency_job_id":null,"html_url":"https://github.com/samwhelp/demo-repository-ubuntu","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwhelp%2Fdemo-repository-ubuntu","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwhelp%2Fdemo-repository-ubuntu/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwhelp%2Fdemo-repository-ubuntu/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/samwhelp%2Fdemo-repository-ubuntu/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/samwhelp","download_url":"https://codeload.github.com/samwhelp/demo-repository-ubuntu/tar.gz/refs/heads/gh-pages","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246944385,"owners_count":20858772,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["apt","deb","debian","repository","ubuntu"],"created_at":"2024-12-16T02:14:35.630Z","updated_at":"2025-10-10T10:34:21.685Z","avatar_url":"https://github.com/samwhelp.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# demo-repository-ubuntu\n\n「[Demo Ubuntu Repository](https://samwhelp.github.io/demo-repository-ubuntu/) ([GitHub](https://github.com/samwhelp/demo-repository-ubuntu))」\n\n\n## 套件庫結構\n\n執行\n\n``` sh\n$ tree ubuntu\n```\n\n顯示\n\n```\nubuntu/\n├── dists\n│   └── xenial\n│       └── main\n│           ├── binary-amd64\n│           │   └── Packages.gz\n│           ├── binary-i386\n│           │   └── Packages.gz\n│           └── source\n│               └── Sources.gz\n└── pool\n    └── main\n        ├── a\n        ├── b\n        ├── c\n        │   └── chewup\n        │       ├── chewup_0.1.0_all.deb\n        │       ├── chewup_0.1.0.dsc\n        │       └── chewup_0.1.0.tar.gz\n        ├── d\n        ├── e\n        ├── f\n        ├── g\n        ├── h\n        ├── i\n        ├── j\n        ├── k\n        ├── l\n        ├── m\n        ├── n\n        ├── o\n        ├── p\n        ├── q\n        ├── r\n        ├── s\n        ├── t\n        ├── u\n        ├── v\n        ├── w\n        ├── x\n        ├── y\n        └── z\n\n35 directories, 6 files\n```\n\n\n## 操作說明\n\n### 觀看簡易說明\n\n執行\n\n``` sh\n$ make\n```\n\n顯示\n\n```\nUsage: make [command]\n\nEx:\n$ make\n$ make help\n\n$ make update\n\n$ make serve\n\n$ make sources-list-install\n$ make sources-list-remove\n\n$ make localhost-sources-list-install\n$ make localhost-sources-list-remove\n\n$ make github-sources-list-install\n$ make github-sources-list-remove\n```\n\n### 更新「Packages.gz」和「Sources.gz」\n\n執行\n\n``` sh\n$ make update\n```\n\n會更新下面三個檔案\n\n* ubuntu/dists/xenial/main/binary-i386/Packages.gz\n* ubuntu/dists/xenial/main/binary-amd64/Packages.gz\n* ubuntu/dists/xenial/main/source/Sources.gz\n\n詳細的執行動作，可以參考「[bin/update.sh](bin/update.sh)」的內容。\n\n\n### 設定「sources.list」\n\n有三種可以選擇\n\n\n#### 選擇一「/etc/apt/sources.list.d/demo-local.list」\n\n執行\n\n``` sh\n$ make sources-list-install\n```\n\n會產生「/etc/apt/sources.list.d/demo-local.list」這個檔案，\n\n然後就需要執行「`sudo apt-get update`」。\n\n若要移除「/etc/apt/sources.list.d/demo-local.list」這個檔案，\n\n就要執行\n\n``` sh\n$ make sources-list-remove\n```\n\n詳細的執行動作，可以參考「[bin/sources-list-install.sh](bin/sources-list-install.sh)」和「[bin/sources-list-remove.sh](bin/sources-list-remove.sh)」的內容。\n\n\n#### 選擇二「/etc/apt/sources.list.d/demo-localhost.list」\n\n執行\n\n``` sh\n$ make localhost-sources-list-install\n```\n\n會產生「/etc/apt/sources.list.d/demo-localhost.list」這個檔案，\n\n然後執行\n\n``` sh\n$ make serve\n```\n\n然後再執行「`sudo apt-get update`」，\n\n\n若要移除「/etc/apt/sources.list.d/demo-localhost.list」這個檔案，\n\n就要執行\n\n``` sh\n$ make localhost-sources-list-remove\n```\n\n詳細的執行動作，可以參考「[bin/localhost-sources-list-install.sh](bin/localhost-sources-list-install.sh)」和「[bin/localhost-sources-list-remove.sh](bin/localhost-sources-list-remove.sh)」的內容。\n\n\n#### 選擇三「/etc/apt/sources.list.d/demo-github.list」\n\n執行\n\n``` sh\n$ make github-sources-list-install\n```\n\n會產生「/etc/apt/sources.list.d/demo-github.list」這個檔案，\n\n然後就需要執行「`sudo apt-get update`」。\n\n若要移除「/etc/apt/sources.list.d/demo-github.list」這個檔案，\n\n就要執行\n\n``` sh\n$ make github-sources-list-remove\n```\n\n詳細的執行動作，可以參考「[bin/github-sources-list-install.sh](bin/github-sources-list-install.sh)」和「[bin/github-sources-list-remove.sh](bin/github-sources-list-remove.sh)」的內容。\n\n\n### 測試\n\n以上面的選擇二「/etc/apt/sources.list.d/demo-localhost.list」這個為例，\n\n當執行完「`sudo apt-get update`」後，\n\n然後執行\n\n``` sh\n$ ls /var/lib/apt/lists/localhost*\n```\n\n顯示\n\n```\n/var/lib/apt/lists/localhost:8080_ubuntu_dists_xenial_main_binary-amd64_Packages\n/var/lib/apt/lists/localhost:8080_ubuntu_dists_xenial_main_binary-i386_Packages\n/var/lib/apt/lists/localhost:8080_ubuntu_dists_xenial_main_source_Sources\n```\n\n執行\n\n``` sh\n$ apt-cache policy\n```\n\n顯示\n\n```\nPackage files:\n 100 /var/lib/dpkg/status\n     release a=now\n 500 http://localhost:8080/ubuntu xenial/main i386 Packages\n     release c=main,b=i386\n     origin localhost\n 500 http://localhost:8080/ubuntu xenial/main amd64 Packages\n     release c=main,b=amd64\n     origin localhost\n...略...\n```\n\n執行\n\n``` sh\n$ apt-cache policy chewup\n```\n\n顯示\n\n```\nchewup:\n  Installed: 0.1.0\n  Candidate: 0.1.0\n  Version table:\n *** 0.1.0 500\n        500 http://localhost:8080/ubuntu xenial/main amd64 Packages\n        500 http://localhost:8080/ubuntu xenial/main i386 Packages\n        100 /var/lib/dpkg/status\n```\n\n執行\n\n``` sh\n$ apt-cache show chewup\n```\n\n顯示\n\n```\nPackage: chewup\nVersion: 0.1.0\nArchitecture: all\nMaintainer: samwhelp \u003csamwhelp@users.noreply.github.com\u003e\nInstalled-Size: 80\nDepends: python3, python3-gi, gir1.2-gtk-3.0, gir1.2-keybinder-3.0, gir1.2-appindicator3-0.1, libchewing3\nFilename: pool/main/c/chewup/chewup_0.1.0_all.deb\nSize: 9704\nMD5sum: b107311c5a24aa4a205e47b85ae45e00\nSHA1: c7de75e8fdaeee37fa7ce276cdb79a199f588326\nSHA256: ac9dbdd2b8ca159971a442ccc03a6646a6dae34ef9c9b81337ad7c01e3e67e76\nSection: utils\nPriority: optional\nDescription: Chewing user phrase editor and cli util.\nDescription-md5: 2322dac17ffee7c95c00424e1c3d8b9a\n```\n\n執行\n\n``` sh\n$ grep '^Package: chewup$' /var/lib/apt/lists/localhost:8080_ubuntu_dists_xenial_main_binary-amd64_Packages -n -A 15\n```\n\n顯示\n\n```\n1:Package: chewup\n2-Version: 0.1.0\n3-Architecture: all\n4-Maintainer: samwhelp \u003csamwhelp@users.noreply.github.com\u003e\n5-Installed-Size: 80\n6-Depends: python3, python3-gi, gir1.2-gtk-3.0, gir1.2-keybinder-3.0, gir1.2-appindicator3-0.1, libchewing3\n7-Filename: pool/main/c/chewup/chewup_0.1.0_all.deb\n8-Size: 9704\n9-MD5sum: b107311c5a24aa4a205e47b85ae45e00\n10-SHA1: c7de75e8fdaeee37fa7ce276cdb79a199f588326\n11-SHA256: ac9dbdd2b8ca159971a442ccc03a6646a6dae34ef9c9b81337ad7c01e3e67e76\n12-Section: utils\n13-Priority: optional\n14-Description: Chewing user phrase editor and cli util.\n15-\n```\n\n執行\n\n``` sh\n$ apt-cache showsrc chewup\n```\n\n顯示\n\n```\nFormat: 1.0\nPackage: chewup\nBinary: chewup\nArchitecture: all\nVersion: 0.1.0\nMaintainer: samwhelp \u003csamwhelp@users.noreply.github.com\u003e\nStandards-Version: 3.9.6\nVcs-Browser: https://github.com/samwhelp/util-chewup\nVcs-Git: https://github.com/samwhelp/util-chewup.git\nBuild-Depends: debhelper (\u003e= 9), python3 (\u003e= 3.5)\nPackage-List:\n chewup deb utils optional arch=all\nDirectory: pool/main/c/chewup\nChecksums-Sha1:\n 27ba00e07039591d51db24c65befec59ba7d4518 624 chewup_0.1.0.dsc\n 915f136125abe936c8e2492a0791eb44103c44a5 60379 chewup_0.1.0.tar.gz\nChecksums-Sha256:\n b5d75a1f0e64705639a56d81773f9211c02266463ae611c3a633d070cbd5cd02 624 chewup_0.1.0.dsc\n 52f4c9c574a40ce60f64f4729b5f620d62a588cbb25d29478d20bae9616f7a6d 60379 chewup_0.1.0.tar.gz\nFiles:\n 0530e7af0e59891f4ff373afca75ab4e 624 chewup_0.1.0.dsc\n 67205d56d31cc4e8950566909ee6babe 60379 chewup_0.1.0.tar.gz\n```\n\n執行\n\n``` sh\n$ grep '^Package: chewup$' /var/lib/apt/lists/localhost:8080_ubuntu_dists_xenial_main_source_Sources -n -A 22\n```\n\n顯示\n\n```\n2:Package: chewup\n3-Binary: chewup\n4-Architecture: all\n5-Version: 0.1.0\n6-Maintainer: samwhelp \u003csamwhelp@users.noreply.github.com\u003e\n7-Standards-Version: 3.9.6\n8-Vcs-Browser: https://github.com/samwhelp/util-chewup\n9-Vcs-Git: https://github.com/samwhelp/util-chewup.git\n10-Build-Depends: debhelper (\u003e= 9), python3 (\u003e= 3.5)\n11-Package-List:\n12- chewup deb utils optional arch=all\n13-Directory: pool/main/c/chewup\n14-Checksums-Sha1:\n15- 27ba00e07039591d51db24c65befec59ba7d4518 624 chewup_0.1.0.dsc\n16- 915f136125abe936c8e2492a0791eb44103c44a5 60379 chewup_0.1.0.tar.gz\n17-Checksums-Sha256:\n18- b5d75a1f0e64705639a56d81773f9211c02266463ae611c3a633d070cbd5cd02 624 chewup_0.1.0.dsc\n19- 52f4c9c574a40ce60f64f4729b5f620d62a588cbb25d29478d20bae9616f7a6d 60379 chewup_0.1.0.tar.gz\n20-Files:\n21- 0530e7af0e59891f4ff373afca75ab4e 624 chewup_0.1.0.dsc\n22- 67205d56d31cc4e8950566909ee6babe 60379 chewup_0.1.0.tar.gz\n23-\n```\n\n執行下面指令，安裝「[chewup](https://github.com/samwhelp/util-chewup)」這個套件。\n\n``` sh\n$ sudo apt-get install chewup\n```\n\n執行下面指令，重新安裝「chewup」這個套件。\n\n``` sh\n$ sudo apt-get install chewup --reinstall\n```\n\n執行下面指令，移除「chewup」這個套件。\n\n``` sh\n$ sudo apt-get remove chewup\n```\n\n執行下面指令，下載「chewup」這個「[Binary Package](https://wiki.debian.org/Packaging/BinaryPackage)」。\n\n``` sh\n$ apt-get download chewup\n```\n\n執行下面指令，下載「chewup」這個「[Source Package](https://wiki.debian.org/Packaging/SourcePackage)」，並且解開。\n\n``` sh\n$ apt-get source chewup\n```\n\n## 相關討論\n\n* [#2 回覆: apt 出現許多錯誤訊息](https://www.ubuntu-tw.org/modules/newbb/viewtopic.php?post_id=357764#forumpost357764)\n* [簡易的建立自己的套件庫](https://www.ubuntu-tw.org/modules/newbb/viewtopic.php?post_id=342070#forumpost342070)\n\n\n## Manpages\n\n* $ man [sources.list](http://manpages.ubuntu.com/manpages/xenial/en/man5/sources.list.5.html)\n* $ man [dpkg-scanpackages](http://manpages.ubuntu.com/manpages/xenial/en/man1/dpkg-scanpackages.1.html)\n* $ man [dpkg-scansources](http://manpages.ubuntu.com/manpages/xenial/en/man1/dpkg-scansources.1.html)\n* $ man [gzip](http://manpages.ubuntu.com/manpages/xenial/en/man1/gzip.1.html)\n* $ man [gunzip](gunzip)\n* $ man [md5sum](http://manpages.ubuntu.com/manpages/xenial/en/man1/md5sum.1.html)\n* $ man [sha1sum](http://manpages.ubuntu.com/manpages/xenial/en/man1/sha1sum.1.html)\n* $ man [sha256sum](http://manpages.ubuntu.com/manpages/xenial/en/man1/sha256sum.1.html)\n\n\n## Ubuntu Community Help Wiki\n\n* [Repositories](https://help.ubuntu.com/community/Repositories)\n* [Repositories/Ubuntu](https://help.ubuntu.com/community/Repositories/Ubuntu)\n* [Repositories/CommandLine](https://help.ubuntu.com/community/Repositories/CommandLine)\n* [Repositories/Personal](https://help.ubuntu.com/community/Repositories/Personal)\n* [HowToMD5SUM](https://help.ubuntu.com/community/HowToMD5SUM)\n* [HowToSHA256SUM](https://help.ubuntu.com/community/HowToSHA256SUM)\n\n\n## Debian Wiki\n\n* [SourcesList](https://wiki.debian.org/SourcesList)\n* [DebianRepository](https://wiki.debian.org/DebianRepository)\n* [Packaging](https://wiki.debian.org/Packaging)\n* [Binary Package](https://wiki.debian.org/Packaging/BinaryPackage)\n* [Source Package](https://wiki.debian.org/Packaging/SourcePackage)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamwhelp%2Fdemo-repository-ubuntu","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsamwhelp%2Fdemo-repository-ubuntu","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsamwhelp%2Fdemo-repository-ubuntu/lists"}