Ubuntu Google Chrome Proxy设置

本文介绍如何在Ubuntu系统中为Google Chrome浏览器配置代理设置,以便能够访问Google网站及下载扩展程序,特别适合需要通过公司代理访问外网的程序开发者。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原创转载请注明出处:http://agilestyle.iteye.com/blog/2353664

 

Ubuntu下Google Chrome的Settings下的Proxy默认是不能进行配置的,在中国大陆通常就会导致无法访问Google,以及安装一些对程序开发有用的extension,这对我们从事程序开发的人员颇为不便,解决办法如下:

一般公司都会提供访问外网的代理,打开Ubuntu的System Settings


 

点击Network,选择Network proxy,输入自己公司的代理,Apply system wide即可


 

接下来就可以打开Chrome,访问Google官网,获取Google Extentions,比如安装AdBlock、Proxy SwitchyOmega等,方便程序开发。

(base) lxy@lxy-Legion-Y9000P-IAH7H:~$ sudo add-apt-repository ppa:apt-fast/stable sudo apt update sudo apt install apt-fast [sudo] lxy 的密码: 源: 'deb https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu/ jammy main' 描述: This PPA contains tested (stable) builds of apt-fast. Project: https://github.com/ilikenwf/apt-fast 更多信息:https://launchpad.net/~apt-fast/+archive/ubuntu/stable 正在添加源。 按 [ENTER] 继续,或按 Ctrl-c 取消。 Adding deb entry to /etc/apt/sources.list.d/apt-fast-ubuntu-stable-jammy.list Adding disabled deb-src entry to /etc/apt/sources.list.d/apt-fast-ubuntu-stable-jammy.list Adding key to /etc/apt/trusted.gpg.d/apt-fast-ubuntu-stable.gpg with fingerprint BC5934FD3DEBD4DAEA544F791E2824A7F22B44BD 命中:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease 获取:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease [128 kB] 获取:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease [127 kB] 获取:4 https://dl.google.com/linux/chrome/deb stable InRelease [1,825 B] 获取:5 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease [129 kB] 获取:7 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates/main amd64 DEP-11 Metadata [114 kB] 错误:4 https://dl.google.com/linux/chrome/deb stable InRelease 由于没有公钥,无法验证下列签名: NO_PUBKEY 32EE5355A6BC6E42 获取:8 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates/restricted amd64 DEP-11 Metadata [212 B] 获取:9 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates/universe amd64 DEP-11 Metadata [359 kB] 获取:10 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates/multiverse amd64 DEP-11 Metadata [940 B] 获取:11 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports/main amd64 DEP-11 Metadata [7,064 B] 获取:12 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports/restricted amd64 DEP-11 Metadata [212 B] 获取:13 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports/universe amd64 DEP-11 Metadata [24.2 kB] 获取:14 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports/multiverse amd64 DEP-11 Metadata [212 B] 获取:15 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security/main amd64 DEP-11 Metadata [54.6 kB] 获取:16 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security/restricted amd64 DEP-11 Metadata [208 B] 获取:17 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security/universe amd64 DEP-11 Metadata [125 kB] 获取:18 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security/multiverse amd64 DEP-11 Metadata [208 B] 命中:6 https://packages.microsoft.com/repos/code stable InRelease 获取:19 https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu jammy InRelease [18.3 kB] 忽略:20 https://deepin-wine.i-m.dev InRelease 获取:21 https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu jammy/main amd64 Packages [536 B] 命中:22 https://deepin-wine.i-m.dev Release 获取:23 https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu jammy/main i386 Packages [536 B] 获取:24 https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu jammy/main Translation-en [272 B] 忽略:25 https://deepin-wine.i-m.dev Release.gpg 已下载 1,090 kB,耗时 3秒 (364 kB/s) 正在读取软件包列表... 完成 W: 校验数字签名时出错。此仓库未被更新,所以仍然使用此前的索引文件。GPG 错误:https://dl.google.com/linux/chrome/deb stable InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 32EE5355A6BC6E42 W: 无法下载 https://dl.google.com/linux/chrome/deb/dists/stable/InRelease 由于没有公钥,无法验证下列签名: NO_PUBKEY 32EE5355A6BC6E42 W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。 命中:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy InRelease 命中:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates InRelease 命中:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-backports InRelease 命中:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-security InRelease 获取:6 https://dl.google.com/linux/chrome/deb stable InRelease [1,825 B] 错误:6 https://dl.google.com/linux/chrome/deb stable InRelease 由于没有公钥,无法验证下列签名: NO_PUBKEY 32EE5355A6BC6E42 命中:5 https://packages.microsoft.com/repos/code stable InRelease 命中:7 https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu jammy InRelease 忽略:8 https://deepin-wine.i-m.dev InRelease 命中:9 https://deepin-wine.i-m.dev Release 忽略:10 https://deepin-wine.i-m.dev Release.gpg 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 有 275 个软件包可以升级。请执行 ‘apt list --upgradable’ 来查看它们。 W: 校验数字签名时出错。此仓库未被更新,所以仍然使用此前的索引文件。GPG 错误:https://dl.google.com/linux/chrome/deb stable InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY 32EE5355A6BC6E42 W: 无法下载 https://dl.google.com/linux/chrome/deb/dists/stable/InRelease 由于没有公钥,无法验证下列签名: NO_PUBKEY 32EE5355A6BC6E42 W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 下列软件包是自动安装的并且现在不需要了: apport-symptoms gdb libbabeltrace1 libboost-regex1.74.0 libc6-dbg libdebuginfod-common libdebuginfod1 libipt2 libsource-highlight-common libsource-highlight4v5 nvidia-firmware-535-535.183.01 python3-systemd 使用'sudo apt autoremove'来卸载它(它们)。 将会同时安装下列软件: aria2 libaria2-0 libc-ares2 libssh2-1 建议安装: aptitude zsh fish 下列【新】软件包将被安装: apt-fast aria2 libaria2-0 libc-ares2 libssh2-1 升级了 0 个软件包,新安装了 5 个软件包,要卸载 0 个软件包,有 275 个软件包未被升级。 需要下载 1,661 kB 的归档。 解压缩后会消耗 5,948 kB 的额外空间。 您希望继续执行吗? [Y/n] y 获取:1 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy-updates/main amd64 libc-ares2 amd64 1.18.1-1ubuntu0.22.04.3 [45.1 kB] 获取:2 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 libssh2-1 amd64 1.10.0-3 [109 kB] 获取:3 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 libaria2-0 amd64 1.36.0-1 [1,086 kB] 获取:4 http://mirrors.tuna.tsinghua.edu.cn/ubuntu jammy/universe amd64 aria2 amd64 1.36.0-1 [381 kB] 获取:5 https://ppa.launchpadcontent.net/apt-fast/stable/ubuntu jammy/main amd64 apt-fast all 1.11.1-1~ubuntu22.04.1 [38.5 kB] 已下载 1,661 kB,耗时 2秒 (1,075 kB/s) 正在预设定软件包 ... 正在选中未选择的软件包 libc-ares2:amd64。 (正在读取数据库 ... 系统当前共安装有 240215 个文件和目录。) 准备解压 .../libc-ares2_1.18.1-1ubuntu0.22.04.3_amd64.deb ... 正在解压 libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ... 正在选中未选择的软件包 libssh2-1:amd64。 准备解压 .../libssh2-1_1.10.0-3_amd64.deb ... 正在解压 libssh2-1:amd64 (1.10.0-3) ... 正在选中未选择的软件包 libaria2-0:amd64。 准备解压 .../libaria2-0_1.36.0-1_amd64.deb ... 正在解压 libaria2-0:amd64 (1.36.0-1) ... 正在选中未选择的软件包 aria2。 准备解压 .../aria2_1.36.0-1_amd64.deb ... 正在解压 aria2 (1.36.0-1) ... 正在选中未选择的软件包 apt-fast。 准备解压 .../apt-fast_1.11.1-1~ubuntu22.04.1_all.deb ... 正在解压 apt-fast (1.11.1-1~ubuntu22.04.1) ... 正在设置 libc-ares2:amd64 (1.18.1-1ubuntu0.22.04.3) ... 正在设置 libssh2-1:amd64 (1.10.0-3) ... 正在设置 libaria2-0:amd64 (1.36.0-1) ... 正在设置 aria2 (1.36.0-1) ... 正在设置 apt-fast (1.11.1-1~ubuntu22.04.1) ... 正在处理用于 man-db (2.10.2-1) 的触发器 ... 正在处理用于 libc-bin (2.35-0ubuntu3.10) 的触发器 ... (base) lxy@lxy-Legion-Y9000P-IAH7H:~$ sudo apt-fast install ttf-mscorefonts-installer 正在读取软件包列表... 完成 正在分析软件包的依赖关系树... 完成 正在读取状态信息... 完成 ttf-mscorefonts-installer 已经是最新版 (3.8ubuntu2)。 下列软件包是自动安装的并且现在不需要了: apport-symptoms gdb libbabeltrace1 libboost-regex1.74.0 libc6-dbg libdebuginfod-common libdebuginfod1 libipt2 libsource-highlight-common libsource-highlight4v5 nvidia-firmware-535-535.183.01 python3-systemd 使用'sudo apt autoremove'来卸载它(它们)。 升级了 0 个软件包,新安装了 0 个软件包,要卸载 0 个软件包,有 275 个软件包未被升级。
最新发布
07-08
<think>我们面临两个问题: 1. 使用apt-fast安装ttf-mscorefonts-installer时下载速度慢 2. 出现GPG公钥验证错误:NO_PUBKEY 32EE5355A6BC6E42 首先,我们分析问题: - apt-fast是一个多线程下载工具,它通过axel或aria2c等多线程下载器来加速apt的下载过程。但是,ttf-mscorefonts-installer在安装过程中会从SourceForge下载字体文件(exe格式),这些文件可能因为网络问题导致下载缓慢。 - GPG公钥错误是因为系统缺少对应的公钥,无法验证软件包的签名。 解决方案分两部分: ### 第一部分:解决下载速度慢的问题 我们可以采用手动下载字体文件并放入缓存目录的方法,这样apt-fast在安装时就会跳过下载步骤,直接使用我们预先下载好的文件。 步骤: 1. 创建缓存目录(如果不存在): ```bash sudo mkdir -p /var/lib/update-notifier/package-data-downloads/partial/ ``` 2. 手动下载所有需要的字体文件(共11个)到当前目录,然后移动到缓存目录。我们可以使用以下脚本一次性完成: ```bash # 下载字体文件列表 FONT_FILES=( "andale32.exe" "arial32.exe" "arialb32.exe" "comic32.exe" "courie32.exe" "georgi32.exe" "impact32.exe" "times32.exe" "trebuc32.exe" "verdan32.exe" "webdin32.exe" ) # 下载并移动到缓存目录 for file in "${FONT_FILES[@]}"; do wget "https://sourceforge.net/projects/corefonts/files/the%20fonts/final/$file" -O "$file" sudo mv "$file" /var/lib/update-notifier/package-data-downloads/partial/ # 创建对应的.done文件(表示下载完成) sudo touch /var/lib/update-notifier/package-data-downloads/partial/"$file.done" done ``` 注意:引用[3]中提到需要为每个字体文件创建一个同名的.done文件,这样安装程序就会认为这些文件已经下载完成。 3. 然后使用apt-fast安装: ```bash sudo apt-fast install ttf-mscorefonts-installer ``` ### 第二部分:修复GPG公钥错误(NO_PUBKEY 32EE5355A6BC6E42) 这个错误是因为缺少对应的公钥。我们可以通过以下命令添加公钥: ```bash sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 32EE5355A6BC6E42 ``` 如果上述命令失败(可能由于keyserver连接问题),可以尝试使用备用keyserver: ```bash sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32EE5355A6BC6E42 ``` 或者,也可以从Ubuntu密钥服务器网站下载并手动添加: ```bash gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv 32EE5355A6BC6E42 gpg --export 32EE5355A6BC6E42 | sudo apt-key add - ``` ### 完整步骤总结 1. **手动下载字体文件并放入缓存目录**: ```bash sudo mkdir -p /var/lib/update-notifier/package-data-downloads/partial/ FONT_FILES=("andale32.exe" "arial32.exe" "arialb32.exe" "comic32.exe" "courie32.exe" "georgi32.exe" "impact32.exe" "times32.exe" "trebuc32.exe" "verdan32.exe" "webdin32.exe") for file in "${FONT_FILES[@]}"; do wget "https://sourceforge.net/projects/corefonts/files/the%20fonts/final/$file" sudo mv "$file" /var/lib/update-notifier/package-data-downloads/partial/ sudo touch /var/lib/update-notifier/package-data-downloads/partial/"$file.done" done ``` 2. **添加缺失的GPG公钥**: ```bash sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32EE5355A6BC6E42 ``` 3. **使用apt-fast安装**: ```bash sudo apt-fast install ttf-mscorefonts-installer ``` ### 验证安装 安装完成后,可以检查字体是否安装成功: ```bash fc-list | grep -i "Arial" ``` ### 相关问题 §§相关问题§§ 1. 如何解决在安装`ttf-mscorefonts-installer`时出现的EULA许可协议提示? 2. 如何手动安装Microsoft Core Fonts而不使用包管理器? 3. 在Ubuntu系统中如何修复其他常见的GPG公钥错误(如NO_PUBKEY)?</think>### 解决 apt-fast 安装 ttf-mscorefonts-installer 的速度问题及 GPG 错误修复 #### 一、解决安装速度慢的问题 **推荐方案:手动下载字体文件 + apt-fast 安装** ```bash # 1. 创建缓存目录 sudo mkdir -p /var/lib/update-notifier/package-data-downloads/partial/ # 2. 下载所有字体文件 (共11个) FONT_FILES=( andale32.exe arial32.exe arialb32.exe comic32.exe courie32.exe georgi32.exe impact32.exe times32.exe trebuc32.exe verdan32.exe webdin32.exe ) for file in "${FONT_FILES[@]}"; do wget "https://sourceforge.net/projects/corefonts/files/the%20fonts/final/$file" sudo mv "$file" /var/lib/update-notifier/package-data-downloads/partial/ sudo touch "/var/lib/update-notifier/package-data-downloads/partial/$file.done" # 创建完成标记[^3] done # 3. 使用apt-fast安装 sudo apt-fast install ttf-mscorefonts-installer ``` #### 二、修复 GPG 公钥错误 (NO_PUBKEY 32EE5355A6BC6E42) ```bash # 1. 添加缺失的公钥 sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 32EE5355A6BC6E42 # 2. 更新软件源 sudo apt-fast update # 3. 重新安装 sudo apt-fast install --fix-missing ttf-mscorefonts-installer ``` #### 三、备选加速方案 **方案1:使用代理加速** ```bash # 设置临时代理 (替换实际值) export http_proxy="http://proxy_ip:port" export https_proxy="http://proxy_ip:port" sudo apt-fast install ttf-mscorefonts-installer ``` **方案2:更换下载源** ```bash # 编辑安装脚本 sudo nano /usr/lib/ttf-mscorefonts-installer/install.sh # 替换下载URL (将 downloads.sourceforge.net 改为镜像站) # 示例:替换为 mirror.nyist.edu.cn/sourceforge ``` #### 四、验证安装 ```bash # 检查字体缓存 fc-list | grep -i "Arial" # 预期输出示例 /usr/share/fonts/truetype/msttcorefonts/Arial.ttf: Arial, Arial MT:style=Regular,常规 ``` ### 关键问题解析 1. **下载慢的原因**: - 字体文件从 SourceForge 下载,国内访问较慢 - 单个文件下载(无并行加速) 2. **GPG 错误原因**: - 缺少软件源的签名公钥 - 密钥服务器连接问题 ### 相关问题
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值