在shadowsoks下怎么更新软件

先描述一下我的情况。我们学校不给大一开通校园网,我自己租用了***的vps服务器,搭建shadowsocks,(使用ipv6地址才能连接),开始了自己悲催的上网生活。

也就是说,我所有的网络全部来源于socks代理,但是我在系统设置网络里面设置好之后,任然无法通过输入命令

sudo apt-get update

来更新软件源

使用本机自带的software updater 也总是提醒我检查网络连接。

好吧,得想办法将

sudo apt-get update

时的网络连接给转到socks代理去

google查询得知了

该文地址如下:

http://blog.ihipop.info/2011/01/1988.html?utm_source=textarea.com&utm_medium=textarea.com&utm_campaign=article

按照该文的方法配置好之后,使用proxychains4命令放在其他命令前面,可以把网络连接转到socks代理去,总算是好了。

使用

sudo proxychains4 apt-get update

的时候电脑能联网检查更新了。

但是,当我

sudo apt-get install XXXX

时又出现问题了

如下:

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/d/dpkg/dpkg-dev_1.17.5ubuntu5.5_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/b/build-essential/build-essential_11.6ubuntu6_amd64.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/f/fakeroot/libfakeroot_1.20-3ubuntu2_amd64.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/f/fakeroot/fakeroot_1.20-3ubuntu2_amd64.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/liba/libalgorithm-diff-perl/libalgorithm-diff-perl_1.19.02-3_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/liba/libalgorithm-diff-xs-perl/libalgorithm-diff-xs-perl_0.04-2build4_amd64.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/liba/libalgorithm-merge-perl/libalgorithm-merge-perl_0.08-2_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/c/chardet-whl/python-chardet-whl_2.2.1-2~ubuntu1_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/p/python-colorama/python-colorama_0.2.5-0.1ubuntu2_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/p/python-colorama/python-colorama-whl_0.2.5-0.1ubuntu2_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/d/distlib/python-distlib_0.1.8-1ubuntu1_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/d/distlib/python-distlib-whl_0.1.8-1ubuntu1_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/h/html5lib/python-html5lib_0.999-3~ubuntu1_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/h/html5lib/python-html5lib-whl_0.999-3~ubuntu1_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/s/six/python-six-whl_1.5.2-1ubuntu1_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/p/python-urllib3/python-urllib3-whl_1.7.1-1ubuntu4_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/r/requests/python-requests-whl_2.2.1-1ubuntu0.3_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/p/python-setuptools/python-setuptools-whl_3.3-1ubuntu2_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip-whl_1.5.4-1ubuntu3_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/p/python-setuptools/python-setuptools_3.3-1ubuntu2_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/universe/p/python-pip/python-pip_1.5.4-1ubuntu3_all.deb Size mismatch

Failed to fetch http://cn.archive.ubuntu.com/ubuntu/pool/main/w/wheel/python-wheel_0.24.0-1~ubuntu1_all.deb Size mismatch

密密麻麻一片错误信息看着就心慌,仔细看一下也许也不是没有解决办法,错误信息里面把安装包的位置都说出来了,

那么,我们用

proxychains wget url

将安装包下载后再安装就是了(将url替换成错误信息里面的网址)

那么多文件,一个一个下载太麻烦了,弄一些小动作:

vim down.sh

按 I 进入插入模式

将上面包涵网址的错误信息全部复制下来,粘贴到down.sh里面去,把Failed to fetch全部替换成wget ,把末尾的 Size mismatch 删除。

执行

chmod +x down.sh

proxychians4 ./down.sh

就会依次下载各个需要的安装包了。

使用

dpkg -i 包名

就可以安装了,包名就是你下载好的deb文件的全部文件名

再处理一下刚才的down.sh文件,文件内容改成这样:

dpkg -i dpkg-dev_1.17.5ubuntu5.5_all.deb

dpkg -i build-essential_11.6ubuntu6_amd64.deb

dpkg -i libfakeroot_1.20-3ubuntu2_amd64.deb

dpkg -i fakeroot_1.20-3ubuntu2_amd64.deb

dpkg -i libalgorithm-diff-perl_1.19.02-3_all.deb

dpkg -i libalgorithm-diff-xs-perl_0.04-2build4_amd64.deb

dpkg -i libalgorithm-merge-perl_0.08-2_all.deb

dpkg -i python-chardet-whl_2.2.1-2~ubuntu1_all.deb

dpkg -i python-colorama_0.2.5-0.1ubuntu2_all.deb

dpkg -i python-colorama-whl_0.2.5-0.1ubuntu2_all.deb

dpkg -i python-distlib_0.1.8-1ubuntu1_all.deb

dpkg -i python-distlib-whl_0.1.8-1ubuntu1_all.deb

dpkg -i python-html5lib_0.999-3~ubuntu1_all.deb

dpkg -i python-html5lib-whl_0.999-3~ubuntu1_all.deb

dpkg -i python-six-whl_1.5.2-1ubuntu1_all.deb

dpkg -i python-urllib3-whl_1.7.1-1ubuntu4_all.deb

dpkg -i python-requests-whl_2.2.1-1ubuntu0.3_all.deb

dpkg -i python-setuptools-whl_3.3-1ubuntu2_all.deb

dpkg -i python-pip-whl_1.5.4-1ubuntu3_all.deb

dpkg -i python-setuptools_3.3-1ubuntu2_all.deb

dpkg -i python-pip_1.5.4-1ubuntu3_all.deb

dpkg -i python-wheel_0.24.0-1~ubuntu1_all.deb

 然后执行
sudo ./down.sh
等待安装完成就好了。
 
PS:这些安装示范是我安装python-pip的时候用的。
文章首发在:
https://www.textarea.com/suppermary/zai-shadowsoks-xia-zenme-gengxin-ruanjian-559/

linux中,在在shadowsoks下怎么更新软件的更多相关文章

  1. 在Linux中的文本模式下手动安装 Parallels Tools

    1.启动虚拟机. 2.当看到提示 X Server 无法启动的消息时,使用 Ctrl+Option+F1(Ctrl+Alt+F1)切换到另一个虚拟控制台并输入登录信息. 3 从“虚拟机”菜单中选择“安 ...

  2. Linux中Nginx反向代理下的tomcat集群

    Nginx具有反向代理(注意和正向代码的区别)和负载均衡等特点. 这次Nginx安装在 192.168.1.108 这台linux 机器上.安装Nginx 先要装openssl库,gcc,PCRE,z ...

  3. 在Linux中复制文件夹下的全部文件到另外文件夹

    https://jingyan.baidu.com/article/656db918f83c0de380249c5a.html 在Linux系统中复制或拷贝文件我们可以用cp或者copy命令,但要对一 ...

  4. linux中rc.d目录下的文件

    参考 http://blog.sina.com.cn/s/blog_414d78870102vqj5.html http://www.360doc.com/content/12/0820/17/933 ...

  5. linux中bin和xbin下可执行程序的区别

    /bin下的都是Linux最基础的,所有用户都可以使用的外部命令 /sbin下的都是只有超级用户root才能使用的.管理Linux系统的外部命令 /usr/bin以及/usr/local/bin下的都 ...

  6. Linux中Oracle的sqlplus下退格和Del键无效的问题解决

    利用rlwrap工具解决方法 1.安装rlwrap和readline库 CentOS下可以用EPEL的yum源直接安装,步骤如下: (1)RHEL/CentOS/SL Linux 6.x 下安装 EP ...

  7. linux中centos6.9环境下的python3.6和pip的安装

    安装python3.6可能使用的依赖# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqli ...

  8. Linux中如何批量删除目录下文件后缀

    1. rename rename分为perl版本和C版本,以下截图是C版本效果: perl版本:rename 's/.bak//' *.bak 2. for循环+awk 3. for循环+cut 4. ...

  9. linux中在某个目录下多个文件中搜索关键字

    有四种方法: find 文件目录 -name '*.*' -exec grep 'xxx' {} + -n 或是 find 文件目录 -name '*.*' | xargs grep 'xxx' -n ...

随机推荐

  1. js 请求异常重连或断线后联网重连机制(ajax)

    转到到 https://blog.csdn.net/mengtoumingren/article/details/80296788

  2. Python面试题之一:解密

    Python面试题之一: 说明:就是Python工程师面试题 一.字典转换与正则提取值 1:key与Value交换 a = {'a':1,'b':2} print({value:key for key ...

  3. 孤荷凌寒自学python第四十九天继续研究跨不同类型数据库的通用数据表操作函数

    孤荷凌寒自学python第四十九天继续研究跨不同类型数据库的通用数据表操作函数 (完整学习过程屏幕记录视频地址在文末,手写笔记在文末) 今天继续建构自感觉用起来顺手些的自定义模块和类的代码. 不同类型 ...

  4. SQL 基础笔记(二):进阶查询

    本笔记整理自<SQL 基础教程>.<MySQL 必知必会>和网上资料.个人笔记不保证正确. 一.复杂查询 视图 将 SELECT 查询包装成一个虚拟表,该虚拟表就被称为视图.( ...

  5. Metaspolit

    Metaspolit介绍 Metasploit是一款开源的安全漏洞检测工具,安全工作人员常用 Metasploit工具来检测系统的安全性.Metasploit Framework (MSF) 在200 ...

  6. 解决:spring security 登录页停留时间过长 跳转至 403页面

    前言:最近的项目中用到了spring security组件,说句显low的话:我刚开始都不知道用了security好不勒,提了bug,在改的过程中,遇到了一些问题,找同事交流,才知道是用的securi ...

  7. .net发展-关注

    文章:用.net core 写后端—— c++外的另一种选择? 文章:

  8. 201621123034 《Java程序设计》第8周学习总结

    作业08-集合 1. 本周学习总结 以你喜欢的方式(思维导图或其他)归纳总结集合相关内容. 2. 书面作业 1. ArrayList代码分析 1.1 解释ArrayList的contains源代码 答 ...

  9. GCC 中 -L、-rpath和-rpath-link的区别

    GCC 中 -L.-rpath和-rpath-link的区别 来源 http://blog.csdn.net/q1302182594/article/details/42102961 关于这3个参数的 ...

  10. hdu 6126 Give out candies

    hdu 6126 Give out candies(最小割) 题意: 有\(n\)个小朋友,标号为\(1\)到\(n\),你要给每个小朋友至少\(1\)个且至多\(m\)个的糖果.小朋友们共提出\(k ...