LoginSignup
1
1

More than 3 years have passed since last update.

Ubuntu16.04.7 LTSでapt-get updateのエラー対応

Last updated at Posted at 2020-10-22

環境

Ubuntu16.04.7 LTS
Windows10 + Vegrant

やった事

apt-get update をしたが、どうも失敗しているもよう。

$ sudo apt-get update
Get:1 http://dl.google.com/linux/chrome/deb stable InRelease [1,811 B]
Get:2 http://dl.google.com/linux/chrome/deb stable/main amd64 Packages [1,089 B]
Hit:3 http://archive.ubuntu.com/ubuntu xenial InRelease
Hit:4 https://deb.nodesource.com/node_9.x xenial InRelease
Get:5 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:7 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Get:8 http://security.ubuntu.com/ubuntu xenial-security/main amd64 Packages [1,476 kB]
Get:9 http://archive.ubuntu.com/ubuntu xenial-updates/main amd64 Packages [1,880 kB]
Get:10 http://security.ubuntu.com/ubuntu xenial-security/main i386 Packages [1,075 kB]
Get:11 http://archive.ubuntu.com/ubuntu xenial-updates/main i386 Packages [1,445 kB]
Get:12 http://security.ubuntu.com/ubuntu xenial-security/main Translation-en [350 kB]
Get:13 http://security.ubuntu.com/ubuntu xenial-security/restricted amd64 Packages [9,824 B]
Get:14 http://security.ubuntu.com/ubuntu xenial-security/restricted i386 Packages [9,800 B]
Get:15 http://security.ubuntu.com/ubuntu xenial-security/universe amd64 Packages [761 kB]
Get:16 http://archive.ubuntu.com/ubuntu xenial-updates/main Translation-en [454 kB]
Get:17 http://security.ubuntu.com/ubuntu xenial-security/universe i386 Packages [641 kB]
Get:18 http://archive.ubuntu.com/ubuntu xenial-updates/restricted amd64 Packages [10.2 kB]
Get:19 http://archive.ubuntu.com/ubuntu xenial-updates/restricted i386 Packages [10.2 kB]
Get:20 http://archive.ubuntu.com/ubuntu xenial-updates/universe amd64 Packages [1,183 kB]
Get:21 http://security.ubuntu.com/ubuntu xenial-security/universe Translation-en [216 kB]
Get:22 http://security.ubuntu.com/ubuntu xenial-security/multiverse amd64 Packages [8,236 B]
Get:23 http://security.ubuntu.com/ubuntu xenial-security/multiverse i386 Packages [8,492 B]
Get:24 http://archive.ubuntu.com/ubuntu xenial-updates/universe i386 Packages [1,052 kB]
Get:25 http://archive.ubuntu.com/ubuntu xenial-updates/universe Translation-en [346 kB]
Get:26 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse amd64 Packages [23.0 kB]
Get:27 http://archive.ubuntu.com/ubuntu xenial-updates/multiverse i386 Packages [21.8 kB]
Get:28 http://archive.ubuntu.com/ubuntu xenial-backports/main amd64 Packages [9,812 B]
Get:29 http://archive.ubuntu.com/ubuntu xenial-backports/main i386 Packages [9,784 B]
Get:30 http://archive.ubuntu.com/ubuntu xenial-backports/universe amd64 Packages [11.3 kB]
Get:31 http://archive.ubuntu.com/ubuntu xenial-backports/universe i386 Packages [10.9 kB]
Get:32 http://archive.ubuntu.com/ubuntu xenial-backports/universe Translation-en [4,476 B]
Fetched 11.4 MB in 28s (396 kB/s)
Reading package lists... Done
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
N: Skipping acquire of configured file 'main/binary-i386/Packages' as repository 'http://dl.google.com/linux/chrome/deb stable InRelease' doesn't support architecture 'i386'
W: Target Packages (main/binary-amd64/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Packages (main/binary-all/Packages) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en_US) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1
W: Target Translations (main/i18n/Translation-en) is configured multiple times in /etc/apt/sources.list.d/google-chrome.list:3 and /etc/apt/sources.list.d/google.list:1

参考記事
ググってみると、下記の情報を見つけたので、同じ事をやってみると、自分のバージョンでも解決しました。
https://qiita.com/on-vegetable/items/8f821be0641d0dbb7631

つまり、下記ファイルをvimで開くと、1行だけ記述があるので、コメントを入れて保存する。
ReadOnlyになっているので、root権限で更新する事になります。

sudo vi /etc/apt/sources.list.d/google.list
# deb http://dl.google.com/linux/chrome/deb/ stable main

再度、apt-get updateを実行すると、上手くいったようです。

$ sudo apt-get update
Hit:1 http://dl.google.com/linux/chrome/deb stable InRelease
Hit:2 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:3 http://security.ubuntu.com/ubuntu xenial-security InRelease [109 kB]
Hit:4 https://deb.nodesource.com/node_9.x xenial InRelease
Get:5 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [109 kB]
Get:6 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [107 kB]
Fetched 325 kB in 2s (128 kB/s)
Reading package lists... Done

updateは何をしているのかと言えば、/etc/apt/sources.listに記載されている、リモートリポジトリのURLを読みにいって、リモートリポジトリに最新のパッケージがアップされていれば、パッケージのインデックスファイルをローカルにダウンロードする処理を行っています。Getとあれば、ダウンロードされて、インデックスファイルが更新された事を示しています。インデックスファイルは/var/lib/apt/listsに存在します。

upgradeを実行する。

$sudo apt-get upgrade

image.png
途中でこのようなGUIが出てくるが、デフォルトのままでOK。

A new version (/tmp/grub.Iey8alxWwl) of configuration file /etc/default/grub is available, but the version installed currently has been locally modified.
構成ファイル/ etc / default / grubの新しいバージョン(/tmp/grub.Iey8alxWwl)が利用可能ですが、現在インストールされているバージョンはローカルで変更されています。

What do you want to do about modified configuration file grub?
変更された構成ファイルgrubについて何をしたいですか?

この処理が多少長いが、正常終了したようです。

次回ログインした時に、このように0個で表示されているはずです。

0 個のパッケージがアップデート可能です。
0 個のアップデートはセキュリティアップデートです。
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1