可以在無人看管的情形下遠端升級嗎? [論壇 - Ubuntu安裝問題]


正在瀏覽:   1 名遊客


 到底部   前一個主題   下一個主題  [無發表權] 請登錄或者註冊

(1) 2 3 »


可以在無人看管的情形下遠端升級嗎?
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24829
EXP: 86
離線
我公司的電腦下載速度很慢,
利用 do-release-upgrade 來升級的,
據它的預估要5、6個小時以上
我想利用下班前下指令執行升級
然後第二天早上再看看結果

可是,升級中會問東問西,若沒回答的話,程式就卡住不動,
想請教諸位先進,有沒有什麼辦法,讓它能夠從頭跑到尾,
自動完成呢?

或者是,有沒有其它比較有效率的升級模式?

2011/10/15 20:44
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?
會員四級
註冊日期:
2006/9/17 14:02
所屬群組:
已註冊使用者
等級: 16
HP : 0 / 380
MP : 100 / 18960
EXP: 22
離線
可以利用 screen 或是 tmux 這樣的程式

2011/10/15 21:56
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24829
EXP: 86
離線
FourDollars 寫到:
可以利用 screen 或是 tmux 這樣的程式

非常感謝指點,
可小弟才疏學淺
Google了一下,實在看不懂如何使用於升級作業
不過,還是很感謝!

2011/10/15 22:29
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?
會員四級
註冊日期:
2007/8/12 16:54
來自 Taiwan-Kaohsiung
所屬群組:
已註冊使用者
等級: 16
HP : 0 / 393
MP : 107 / 18572
EXP: 74
離線
拿光碟升級看看吧

指令模式都問東問西

2011/10/15 23:01
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?

註冊日期:
2009/12/6 10:32
所屬群組:
已註冊使用者
等級: 71
HP : 1053 / 1756
MP : 4456 / 70949
EXP: 24
離線
試試看 以下方法 The Debian way of upgrading
Please be aware that this method is valid, yet not officially advised by the Ubuntu developers.

建議:先備存你的 ubuntu server 作業系統

把下列指令寫在 script 檔 並且給予 可執行屬性:

sudo apt-get install aptitude # 如果你沒安裝這個套件 要先安裝這個套件
sudo aptitude update -y # 準備升級所有套件到最新版本
sudo aptitude safe-upgrade -y # 升級所有套件到最新版本
sudo sed -i.ORIG s/Natty/Oneiric/g /etc/apt/sources.list
# 把/etc/apt/sources.list備份到/etc/apt/sources.list.ORIG
# 把/etc/apt/sources.list從Natty升級到Oneiric, 變成11.10的軟體來源
sudo mv /etc/apt/sources.list.d/ /etc/apt/sources.list.d.ORIG/
# 把第三方軟體來源的資料夾/sources.list.d/改名爲/sources.list.d.ORIG/備存起來
sudo mkdir /etc/apt/sources.list.d/
# 建立新的空的第三方軟體來源的資料夾/sources.list.d/
sudo aptitude update -y
sudo aptitude safe-upgrade -y
sudo aptitude full-upgrade -y
# 更新完畢
sudo rmdir /etc/apt/sources.list.d/
sudo mv /etc/apt/sources.list.d.ORIG/ /etc/apt/sources.list.d/
# 再把第三方軟體來源備存的資料夾/sources.list.d.ORIG/改回來/sources.list.d/
sudo aptitude update -y
sudo aptitude safe-upgrade -y
sudo aptitude full-upgrade -y
# 更新完畢
sudo shutdown -P now # 更新完畢 關機

實際執行更新
sudo script檔名

這個方法應該可以適用在任何版本 是 Debian 的方法 但未獲得 ubuntu 官方推薦
是否有風險 請你衡量 記得事先備存一份
歡迎 分享你成功或失敗的經驗

2011/10/16 0:00
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24829
EXP: 86
離線
向poloshiao報告一下
依照您的script執行之後
沒有失敗訊息,也沒有問東問西
但也沒有成功
因為版本仍然停留在 11.04 版

另外,執行中好像看到一行訊息
sudo rmdir -f /etc/apt/sources.list.d/
-f 的選項無效

但這個似不影響執行

2011/10/16 17:17
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?

註冊日期:
2009/12/6 10:32
所屬群組:
已註冊使用者
等級: 71
HP : 1053 / 1756
MP : 4456 / 70949
EXP: 24
離線
另外,執行中好像看到一行訊息 sudo rmdir -f /etc/apt/sources.list.d/ -f 的選項無效

對 rmdir 沒有 -f 選項
我有發現 但是忘了拿掉
謝謝你的更正
因為版本仍然停留在 11.04 版

你可以提供你更改後的這兩個檔案 貼上來嗎
1. sudo cat /etc/apt/sources.list
2. sudo cat /etc/update-manager/release-upgrades

2011/10/16 17:38
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24829
EXP: 86
離線
/etc/apt/sources.list

# deb cdrom:[Ubuntu 9.04 _Jaunty Jackalope_ - Release amd64 (20090420.1)]/ jaunty main restricted
# See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to
# newer versions of the distribution.

deb http://tw.archive.ubuntu.com/ubuntu/ natty main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ natty main restricted

## Major bug fix updates produced after the final release of the
## distribution.
deb http://tw.archive.ubuntu.com/ubuntu/ natty-updates main restricted
deb-src http://tw.archive.ubuntu.com/ubuntu/ natty-updates main restricted

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team. Also, please note that software in universe WILL NOT receive any
## review or updates from the Ubuntu security team.
deb http://tw.archive.ubuntu.com/ubuntu/ natty universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ natty universe
deb http://tw.archive.ubuntu.com/ubuntu/ natty-updates universe
deb-src http://tw.archive.ubuntu.com/ubuntu/ natty-updates universe

## N.B. software from this repository is ENTIRELY UNSUPPORTED by the Ubuntu
## team, and may not be under a free licence. Please satisfy yourself as to
## your rights to use the software. Also, please note that software in
## multiverse WILL NOT receive any review or updates from the Ubuntu
## security team.
deb http://tw.archive.ubuntu.com/ubuntu/ natty multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ natty multiverse
deb http://tw.archive.ubuntu.com/ubuntu/ natty-updates multiverse
deb-src http://tw.archive.ubuntu.com/ubuntu/ natty-updates multiverse

## Uncomment the following two lines to add software from the 'backports'
## repository.
## N.B. software from this repository may not have been tested as
## extensively as that contained in the main release, although it includes
## newer versions of some applications which may provide useful features.
## Also, please note that software in backports WILL NOT receive any review
## or updates from the Ubuntu security team.
# deb http://tw.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse
# deb-src http://tw.archive.ubuntu.com/ubuntu/ jaunty-backports main restricted universe multiverse

## Uncomment the following two lines to add software from Canonical's
## 'partner' repository.
## This software is not part of Ubuntu, but is offered by Canonical and the
## respective vendors as a service to Ubuntu users.
# deb http://archive.canonical.com/ubuntu jaunty partner
# deb-src http://archive.canonical.com/ubuntu jaunty partner

deb http://security.ubuntu.com/ubuntu natty-security main restricted
deb-src http://security.ubuntu.com/ubuntu natty-security main restricted
deb http://security.ubuntu.com/ubuntu natty-security universe
deb-src http://security.ubuntu.com/ubuntu natty-security universe
deb http://security.ubuntu.com/ubuntu natty-security multiverse
deb-src http://security.ubuntu.com/ubuntu natty-security multiverse
# deb http://ppa.launchpad.net/ubuntu-mozilla-daily/ppa/ubuntu karmic main # 停用升級至 karmic

/etc/update-manager/release-upgrades

# Default behavior for the release upgrader.

[DEFAULT]
# Default prompting behavior, valid options:
#
# never - Never check for a new release.
# normal - Check to see if a new release is available. If more than one new
# release is found, the release upgrader will attempt to upgrade to
# the release that immediately succeeds the currently-running
# release.
# lts - Check to see if a new LTS release is available. The upgrader
# will attempt to upgrade to the first LTS release available after
# the currently-running one. Note that this option should not be
# used if the currently-running release is not itself an LTS
# release, since in that case the upgrader won't be able to
# determine if a newer release is available.
Prompt=normal


家中的電腦已經升級至 11.10 了, 我可以把它的 /etc/apt/sources.list 拷貝至公司的電腦中,再重新執行一次嗎 ?

2011/10/16 20:57
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?

註冊日期:
2009/12/6 10:32
所屬群組:
已註冊使用者
等級: 71
HP : 1053 / 1756
MP : 4456 / 70949
EXP: 24
離線
/etc/update-manager/release-upgrades
1. 使用 do-release-upgrade 來升級時
/etc/apt/sources.list 是 Natty
所以 Prompt=normal
才會 升級爲 Oneiric
2. 使用 script 檔升級
/etc/apt/sources.list 原是 Natty
但是已經使用
sudo sed -i.ORIG s/Natty/Oneiric/g /etc/apt/sources.list
更改爲 Oneiric
所以 Prompt=never 即可
實際上 script 檔執行時 可能沒有去核對這個設定 (猜測的)

2. /etc/apt/sources.list
都還是 natty
如果這是已經執行
sudo sed -i.ORIG s/Natty/Oneiric/g /etc/apt/sources.list
的結果
那就表示 這個指令沒效果
這是 原稿的指令
現在 改成兩個 指令 來取代:
sudo cp /etc/apt/sources.list /etc/apt/sources.list.ORIG
sudo sed s/Natty/Oneiric/g /etc/apt/sources.list # 把 前後''都拿掉
請你先把 script 改改看
註:你可以先實驗看看這個指令執行有沒有效
然後 sudo cat /etc/apt/sources.list 看看 Natty 有沒有全部改爲 Oneiric
但是記得把 /etc/apt/sources.list.ORIG 再 覆蓋 /etc/apt/sources.list 回來

3. 你要把備存的檔案 回存 再重新執行 script 檔
希望 你這次能成功

4. 這是(我所知道)第一次 有人嘗試這樣更新版本 希望你的先鋒 能夠造福其它網友

5. 辛苦您啦 ! 如果還有錯誤訊息 把 錯誤訊息 copy 上來 我們一起來找原因

2011/10/16 21:40
應用擴展 工具箱
回覆: 可以在無人看管的情形下遠端升級嗎?
會員五級
註冊日期:
2008/11/21 9:18
所屬群組:
已註冊使用者
等級: 23
HP : 0 / 571
MP : 229 / 24829
EXP: 86
離線

sudo sed s/Natty/Oneiric/g /etc/apt/sources.list

這行指令無效,我覺得問題似乎是出在大小寫上頭

若改成

sudo sed s/natty/Oneiric/g /etc/apt/sources.list


也就是 Natty 要改成 natty

如此一來,那麼,Oneiric 要不要一併改成 oneiric 呢 ?

2011/10/17 16:14
應用擴展 工具箱

(1) 2 3 »

 [無發表權] 請登錄或者註冊


可以查看帖子.
不可發帖.
不可回覆.
不可編輯自己的帖子.
不可刪除自己的帖子.
不可發起投票調查.
不可在投票調查中投票.
不可上傳附件.
不可不經審核直接發帖.