【已解決】Ubuntu17.10升級時出現了問題 [論壇 - Ubuntu安裝問題]
正在瀏覽:
1 名遊客
【已解決】Ubuntu17.10升級時出現了問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員四級
![]() ![]() 註冊日期:
2010/11/7 0:52 所屬群組:
已註冊使用者 等級: 19
HP : 0 / 464
![]() |
事情是這樣的, 我的Ubuntu由17。04升級至17。10時, 再輸入sudo apt update時竟然出現了以下的問題:
http://paste.ubuntu.com/26045723/ 那我應該要怎麼辦呢?
2017/11/26 8:28
|
||||||||||
![]() |
回覆: Ubuntu17.10升級時出現了問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
先把您的「/etc/apt/sources.list」備份起來,
接著把您的「/etc/apt/sources.list」內容完全清掉, 然後請連到「#24 回覆: Ubuntu 17.10 推出」, 貼上該篇貼的「/etc/apt/sources.list」, 然後再執行「sudo apt-get update」就會正常了。 猜測您的「/etc/apt/sources.list」設定應該有重複的, 所以執行「sudo apt-get update」才會出現您貼出來的訊息。
或是您也可以檢查您的「/etc/apt/sources.list」的「第3行」和「第5行」。 其他省略的訊息,請依此類推。 以上提供參考 報告完畢 ![]()
2017/11/26 10:27
|
||||||||||
![]() |
回覆: Ubuntu17.10升級時出現了問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員四級
![]() ![]() 註冊日期:
2010/11/7 0:52 所屬群組:
已註冊使用者 等級: 19
HP : 0 / 464
![]() |
事情已經解決, 非常之感謝你的意見!!
不過我想請教一下有關的程式碼究竟可以從何處找到?
2017/11/30 6:33
|
||||||||||
![]() |
回覆: Ubuntu17.10升級時出現了問題 |
|||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
會員五級
![]() ![]() 註冊日期:
2012/4/22 10:50 所屬群組:
已註冊使用者 等級: 37
HP : 0 / 905
![]() |
Dark.Kiva 寫到: 以下我在「Ubuntu 17.10」in「lxqt」上測試的。 下面我前面先囉唆一下,提供「我探索的思路」,讓您參考 ![]() ================================================================================ ## 探索開始 執行
顯示
執行
顯示
表示「/usr/bin/apt-get」這個檔案,是屬於「apt」這個套件。 ================================================================================ 執行
顯示
所以上面的方式,可以結合成一行 執行下面指令
顯示
上面「$(which apt-get)」這個用法,您可以參考「$ man bash」, 使用「Command Substitution」當關鍵字來查詢,可以找到類似如下的說明 Command Substitution Command substitution allows the output of a command to replace the command name. There are two forms: $(command) or `command` ================================================================================ 接著回到正題, 剛剛找到「apt」這個套件, 執行下面指令,下載「apt」這個套件的「Source Package: apt」
就會下載兩個檔案 * apt_1.5.1.dsc * apt_1.5.1.tar.xz 並且解開到「apt-1.5.1」這個資料夾。 通常我會先執行「$ tree apt-1.5.1」來觀看「apt-1.5.1」這個資料夾的整個樹狀結構。 不過因為太多檔案了,所以我就不貼出來了。 然後上面要執行「apt-get source apt」,有一個前置作業要先做,我之前寫在「#24 回覆: Ubuntu 17.10 推出」, 索引則是在「#22 回覆: Ubuntu 17.10 推出」。 以前的一些討論案例,我或多或少都有用到這些技巧, 一些討論案例和參考連結,我之前紀錄在「[索引] 套件操作實務」。 ================================================================================ 然後接著就可以開始探索「apt-1.5.1」這個資料夾。 您可以使用您慣用的文字編輯器,使用「Find in files」的功能來找尋。 以下我則是用指令來當範例說明,概念是一樣通用的。 參考您提供的「提示訊息」。
使用「is configured multiple times in」這個來當關鍵字找尋。 執行
或是執行
顯示
就可以找到「apt-1.5.1/apt-pkg/deb/debmetaindex.cc」這個檔案, 接下來我就沒再探索下去了,以上提供給您一個探索的起點。 註:若是有些東西在「apt」找不到,可以朝「dpkg」這個方向去找 ================================================================================ 若您是要問「/etc/apt/sources.list」,原本的內容,是如何產生的, 我在「#24 回覆: Ubuntu 17.10 推出」貼的內容, 是我灌「Ubuntu 17.10 英文界面」,安裝程式產生的。 安裝程式應該是「ubiquity」這個套件,也許您可以從這個套件的「Source Package: ubiquity」探索起, 這部份我目前就沒再去探究了。方法就參考上面提到的步驟和思路。 以前有一個討論案例「#2 回覆: Ubuntu 自動登入」,我有提到「ubiquity」。 不過我那時也只有簡單的探索,沒探索到很深入。所以一樣提供您探索的起點。 ================================================================================ 若是要問升級的方式那段,我沒有使用過升級的方式,通常我都重灌。 不過您一樣只要知道您是使用那個指令,然後透過「dpkg -S」,來找到相關的套件,就可以當作探索的起點。 ================================================================================ 接著提供如何編譯「apt-1.5.1」。 先說明前置作業。 先執行下面指令,安裝「build-essential」。
然後執行下面指令,安裝「編譯apt」所需要的套件。
另外您也可以執行下面指令,觀看「Build-Depends」。
顯示
================================================================================ 接下來切換到「apt-1.5.1」這個資料夾。
您可以看到有一個資料夾「debian」
顯示 debian/ ├── apt.apt-compat.cron.daily ├── apt.auto-removal.sh ├── apt.bug-script ├── apt.conf.autoremove ├── apt-daily.service ├── apt-daily.timer ├── apt-daily-upgrade.service ├── apt-daily-upgrade.timer ├── apt.dirs ├── apt-doc.doc-base.guide ├── apt-doc.doc-base.offline ├── apt-doc.docs ├── apt-doc.install ├── apt.install ├── apt.lintian-overrides ├── apt.logrotate ├── apt.maintscript ├── apt.postinst ├── apt.postrm ├── apt.systemd.daily ├── apt-transport-https.docs ├── apt-transport-https.install ├── apt-transport-https.README ├── apt-utils.install ├── changelog ├── compat ├── control ├── copyright ├── gbp.conf ├── libapt-inst2.0.install ├── libapt-inst2.0.symbols ├── libapt-pkg5.0.install ├── libapt-pkg5.0.symbols ├── libapt-pkg-dev.install ├── libapt-pkg-doc.doc-base.design ├── libapt-pkg-doc.doc-base.dpkg-tech ├── libapt-pkg-doc.doc-base.files ├── libapt-pkg-doc.doc-base.method ├── libapt-pkg-doc.docs ├── libapt-pkg-doc.install ├── libapt-pkg-doc.lintian-overrides ├── NEWS ├── rules ├── source │ ├── format │ └── options └── tests ├── control └── run-tests 2 directories, 47 files 關於「debian/control」,您可以參考「$ man deb-src-control」。 關於「debian/rules」,您可以參考「man dh」和「debhelper」 或是參考「Debian 新維護人員手冊 / 4. debian 目錄中的必須內容」 * 4.1. control * 4.4. rules 關於「Debian Source Package」的「debian/control」是閱讀「$ man deb-src-control」。 關於「Debian Binary Package」的「DEBIAN/control」是閱讀「$ man deb-control」。 ================================================================================ 在往下說明前,先看一下「debian/rules」的內容,基本上它就是「Makefile」, 只不過它被設為可執行,然後第一行「#!/usr/bin/make -f」是設定 關於第一行,請參考「Wikipedia / Shebang (Unix)」。 執行
顯示 #!/usr/bin/make -f # Copyright (C) 2009, 2016 Julian Andres Klode <jak@debian.org> # # Free Software, licensed under the GPL-2 or (at your option) any later version. export DEB_LDFLAGS_MAINT_APPEND := -Wl,--as-needed export DEB_BUILD_MAINT_OPTIONS := hardening=+all # do not fail as we are just experimenting with symbol files for now export DPKG_GENSYMBOLS_CHECK_LEVEL=0 export CTEST_OUTPUT_ON_FAILURE=1 %: dh $@ override_dh_clean: cp COPYING debian/copyright dh_clean override_dh_install-indep: dh_install --list-missing override_dh_install-arch: dh_install -papt-utils -X/dump dh_install -papt -Xmethods/curl -Xmethods/curl+https -Xmethods/curl+http dh_install --remaining --list-missing install -m 644 debian/apt.conf.autoremove debian/apt/etc/apt/apt.conf.d/01autoremove install -m 755 debian/apt.auto-removal.sh debian/apt/etc/kernel/postinst.d/apt-auto-removal override_dh_gencontrol: dh_gencontrol -- -Vapt:keyring="$(shell ./vendor/getinfo keyring-package)" override_dh_installcron: dh_installcron --name=apt-compat override_dh_systemd_start: # Do not restart "apt-daily.service" because this script runs # unattended-upgrades. So if apt itself is upgraded as part of # an unattended-upgrades run it would kill itself dh_systemd_start -papt apt-daily.timer apt-daily-upgrade.timer dh_systemd_start --remaining-packages override_dh_auto_configure-arch: flags=-DWITH_DOC=OFF override_dh_auto_configure-indep: flags=-DWITH_DOC=ON override_dh_auto_configure-arch override_dh_auto_configure-indep: dh_auto_configure -- $(flags) override_dh_auto_build: dh_auto_build -- -O 然後執行
顯示
可以找到「/usr/share/doc/debhelper/examples/rules.tiny」這個範例
顯示 #!/usr/bin/make -f %: dh $@ 可以對照上面「apt」的「debian/rules」的部份。 關鍵在於,其實就是將「make」的「rule」導到「dh」這個指令。 關於「make」,可以參考最近的一篇討論「#3 回覆: 安裝過Realtek驅動出現 Dummy Output...」,裡面有列一些參考連結。 ================================================================================ 題外話,也可以下載「hello」的「Source Package: hello」來觀看 執行
會下載三個檔案 * hello_2.10-1build1.debian.tar.xz * hello_2.10-1build1.dsc * hello_2.10.orig.tar.gz 並且解開到「hello-2.10」這個資料夾 然後執行下面指令
顯示 hello-2.10/debian ├── changelog ├── compat ├── control ├── copyright ├── rules ├── rules-old ├── source │ └── format └── watch 1 directory, 8 files 您可以看到「rules-old」這個檔案,也就是以前的寫法。
顯示 #!/usr/bin/make -f # See debian/rules if you prefer the new dh syntax. package = hello clean: rm -f build [ ! -f Makefile ] || $(MAKE) distclean dh_clean install: build dh_clean dh_auto_install build: dh_auto_configure dh_auto_build touch build binary-indep: install # There are no architecture-independent files to be uploaded # generated by this package. If there were any they would be # made here. binary-arch: install dh_installdocs -a NEWS dh_installchangelogs -a ChangeLog dh_installinfo -a doc/*.info dh_strip -a dh_compress -a dh_fixperms -a dh_installdeb -a dh_shlibdeps -a dh_gencontrol -a dh_md5sums -a dh_builddeb -a binary: binary-indep binary-arch build-arch: build build-indep: build .PHONY: binary binary-arch binary-indep build-arch build-indep clean 對照目前的寫法
顯示 #!/usr/bin/make -f %: dh $@ override_dh_auto_clean: [ ! -f Makefile ] || $(MAKE) distclean override_dh_installdocs: dh_installdocs NEWS ================================================================================ 接著我們再回到「apt-1.5.1」這裡。 我們可以先作點小實驗, 執行
顯示
接著我們可以選擇「build」這個「rule」來作實驗 也就是可以執行下面指令,來編譯「apt」了
若您有照上面提到的前置作業,先執行「sudo apt-get build-dep apt」, 然後再執行「debian/rules build」, 正常的狀況下,執行上面的指令,應該是會編譯成功。 ================================================================================ 接下來要來說明,如何產生「BinaryPackage」和「SourcePackage」。 現在所在的路徑,是在「apt-1.5.1」這個資料夾裡。
整個過程完成後,就會在上一層目錄產生很多的檔案 執行
顯示
================================================================================ 關於「dpkg-buildpackage」這個指令,是來自「dpkg-dev」這個套件。 當您安裝「build-essential」這個套件時,也會一併安裝「dpkg-dev」這個套件。 在「#24 回覆: Ubuntu 17.10 推出」,也有提到, 要執行「$ apt-get source apt」的前置作業,要先安裝「dpkg-dev」這個套件。 因為下載下來的「apt_1.5.1.dsc」和「apt_1.5.1.tar.xz」,最後會有一個動作「$ dpkg-source -x apt_1.5.1.dsc」解開, 而「dpkg-source」是來自於「dpkg-dev」這個套件。 關於「dpkg-source」這個指令,可以對照「dpkg-deb」這個指令來研究。 ================================================================================ 接著您也可以執行下面指令來作實驗,對照上面,少了「-b」。
================================================================================ 接下來,介紹另一個指令「debuild」。 先執行下面指令,安裝「devscripts」這個套件。
執行下面指令,閱讀「debuild」的相關說明
在下面的「example」,可以看到下面的一段說明。 EXAMPLES To build your own package, simply run debuild from inside the source tree. dpkg-buildpackage(1) options may be given on the command line. The typical command line options to build only the binary package(s) without signing the .changes file (or the non-existent .dsc file): debuild -i -us -uc -b Change the -b to -S to build only a source package. ...略... 所以在剛剛的「apt-1.5.1」這個資料夾裡,可以執行下面兩個指令,來作實驗。
和
對照剛剛的
和
================================================================================ 以上的一些指令,之前我有紀錄在「GitHub」上。 之前我有紀錄一篇「[影片教學][TOSSUG] Debian 套件打包工作坊」,裡面有一些參考連結。 然後我查詢「debuild」發現「這裡」有很多參考教學。 不過這時候應該可以開始閱讀下面兩篇,應該會比較能消化吸收。 * Debian 新維護人員手冊 / 章 1. 從一條正確的路開始 * Debian Packaging Tutorial 其他的相關文件可以在「Debian Developers' Manuals」找到。 ================================================================================ * man deb-control (Package: dpkg-dev) * man deb-src-control (Package: dpkg-dev) * man dpkg-deb (Package: dpkg) * man dpkg-source (Package: dpkg-dev) * man dpkg-buildpackage (Package: dpkg-dev) * man debuild (Package: devscripts) * man dh (Package: debhelper) * man debhelper (Package: debhelper) ================================================================================ 有一些我也還沒研究透徹,不過上面提到的,應該可以給您一些探索的起點。 以上提供參考 報告完畢 ![]()
2017/11/30 14:52
|
||||||||||
![]() |
您可以查看帖子.
您不可發帖.
您不可回覆.
您不可編輯自己的帖子.
您不可刪除自己的帖子.
您不可發起投票調查.
您不可在投票調查中投票.
您不可上傳附件.
您不可不經審核直接發帖.