![更改用户名后无法使用 apt-get 安装](https://linux22.com/image/1163606/%E6%9B%B4%E6%94%B9%E7%94%A8%E6%88%B7%E5%90%8D%E5%90%8E%E6%97%A0%E6%B3%95%E4%BD%BF%E7%94%A8%20apt-get%20%E5%AE%89%E8%A3%85.png)
我最近将我的 ubuntu 帐户的用户名更改为“admin”,之前是“sunbeam”。现在我尝试使用 apt-get 安装 pylint,但出现以下错误
admin@inspiron-5567:~$ sudo apt-get install pylint
[sudo] password for admin:
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following additional packages will be installed:
blt libtcl8.6 libtk8.6 python-astroid python-backports.functools-lru-cache python-concurrent.futures python-configparser python-egenix-mxdatetime python-egenix-mxtools python-isort python-lazy-object-proxy
python-logilab-common python-mccabe python-setuptools python-singledispatch python-tk python-wrapt tk8.6-blt2.5
Suggested packages:
blt-demo tcl8.6 tk8.6 pylint-doc python-egenix-mxdatetime-dbg python-egenix-mxdatetime-doc python-egenix-mxtools-dbg python-egenix-mxtools-doc pyro python-unittest2 python-setuptools-doc tix python-tk-dbg
The following NEW packages will be installed:
blt libtcl8.6 libtk8.6 pylint python-astroid python-backports.functools-lru-cache python-concurrent.futures python-configparser python-egenix-mxdatetime python-egenix-mxtools python-isort
python-lazy-object-proxy python-logilab-common python-mccabe python-setuptools python-singledispatch python-tk python-wrapt tk8.6-blt2.5
0 upgraded, 19 newly installed, 0 to remove and 5 not upgraded.
Need to get 0 B/3,667 kB of archives.
After this operation, 21.7 MB of additional disk space will be used.
Do you want to continue? [Y/n] y
WARNING: The following packages cannot be authenticated!
libtcl8.6 libtk8.6 tk8.6-blt2.5 blt python-lazy-object-proxy python-wrapt python-singledispatch python-backports.functools-lru-cache python-setuptools python-astroid python-concurrent.futures python-isort
python-mccabe python-configparser python-logilab-common pylint python-egenix-mxtools python-egenix-mxdatetime python-tk
Install these packages without verification? [y/N] y
Get:1 file:/home/sunbeam/subuntu1804 libtcl8.6 8.6.8+dfsg-3 [881 kB]
Err:1 file:/home/sunbeam/subuntu1804 libtcl8.6 8.6.8+dfsg-3
File not found - /home/sunbeam/subuntu1804/./repo/libtcl8.6_8.6.8+dfsg-3_amd64.deb (2: No such file or directory)
Get:2 file:/home/sunbeam/subuntu1804 libtk8.6 8.6.8-4 [693 kB]
Err:2 file:/home/sunbeam/subuntu1804 libtk8.6 8.6.8-4
File not found - /home/sunbeam/subuntu1804/./repo/libtk8.6_8.6.8-4_amd64.deb (2: No such file or directory)
Get:3 file:/home/sunbeam/subuntu1804 tk8.6-blt2.5 2.5.3+dfsg-4 [572 kB]
Err:3 file:/home/sunbeam/subuntu1804 tk8.6-blt2.5 2.5.3+dfsg-4
File not found - /home/sunbeam/subuntu1804/./repo/tk8.6-blt2.5_2.5.3+dfsg-4_amd64.deb (2: No such file or directory)
Get:4 file:/home/sunbeam/subuntu1804 blt 2.5.3+dfsg-4 [4,944 B]
Err:4 file:/home/sunbeam/subuntu1804 blt 2.5.3+dfsg-4
File not found - /home/sunbeam/subuntu1804/./repo/blt_2.5.3+dfsg-4_amd64.deb (2: No such file or directory)
Get:5 file:/home/sunbeam/subuntu1804 python-lazy-object-proxy 1.3.1-1 [20.8 kB]
Err:5 file:/home/sunbeam/subuntu1804 python-lazy-object-proxy 1.3.1-1
File not found - /home/sunbeam/subuntu1804/./repo/python-lazy-object-proxy_1.3.1-1_amd64.deb (2: No such file or directory)
Get:6 file:/home/sunbeam/subuntu1804 python-wrapt 1.9.0-3 [27.5 kB]
Err:6 file:/home/sunbeam/subuntu1804 python-wrapt 1.9.0-3
File not found - /home/sunbeam/subuntu1804/./repo/python-wrapt_1.9.0-3_amd64.deb (2: No such file or directory)
Get:7 file:/home/sunbeam/subuntu1804 python-singledispatch 3.4.0.3-2 [9,848 B]
Err:7 file:/home/sunbeam/subuntu1804 python-singledispatch 3.4.0.3-2
File not found - /home/sunbeam/subuntu1804/./repo/python-singledispatch_3.4.0.3-2_all.deb (2: No such file or directory)
Get:8 file:/home/sunbeam/subuntu1804 python-backports.functools-lru-cache 1.4-2 [5,960 B]
Err:8 file:/home/sunbeam/subuntu1804 python-backports.functools-lru-cache 1.4-2
File not found - /home/sunbeam/subuntu1804/./repo/python-backports.functools-lru-cache_1.4-2_all.deb (2: No such file or directory)
Get:9 file:/home/sunbeam/subuntu1804 python-setuptools 39.0.1-2 [329 kB]
Err:9 file:/home/sunbeam/subuntu1804 python-setuptools 39.0.1-2
File not found - /home/sunbeam/subuntu1804/./repo/python-setuptools_39.0.1-2_all.deb (2: No such file or directory)
Get:10 file:/home/sunbeam/subuntu1804 python-astroid 1.6.0-1 [108 kB]
Err:10 file:/home/sunbeam/subuntu1804 python-astroid 1.6.0-1
File not found - /home/sunbeam/subuntu1804/./repo/python-astroid_1.6.0-1_all.deb (2: No such file or directory)
Get:11 file:/home/sunbeam/subuntu1804 python-concurrent.futures 3.2.0-1 [34.2 kB]
Err:11 file:/home/sunbeam/subuntu1804 python-concurrent.futures 3.2.0-1
File not found - /home/sunbeam/subuntu1804/./repo/python-concurrent.futures_3.2.0-1_all.deb (2: No such file or directory)
Get:12 file:/home/sunbeam/subuntu1804 python-isort 4.3.4+ds1-1 [30.4 kB]
Err:12 file:/home/sunbeam/subuntu1804 python-isort 4.3.4+ds1-1
File not found - /home/sunbeam/subuntu1804/./repo/python-isort_4.3.4+ds1-1_all.deb (2: No such file or directory)
Get:13 file:/home/sunbeam/subuntu1804 python-mccabe 0.6.1-2 [8,092 B]
Err:13 file:/home/sunbeam/subuntu1804 python-mccabe 0.6.1-2
File not found - /home/sunbeam/subuntu1804/./repo/python-mccabe_0.6.1-2_all.deb (2: No such file or directory)
Get:14 file:/home/sunbeam/subuntu1804 python-configparser 3.5.0-1 [59.6 kB]
Err:14 file:/home/sunbeam/subuntu1804 python-configparser 3.5.0-1
File not found - /home/sunbeam/subuntu1804/./repo/python-configparser_3.5.0-1_all.deb (2: No such file or directory)
Get:15 file:/home/sunbeam/subuntu1804 python-logilab-common 1.4.1-1 [369 kB]
Err:15 file:/home/sunbeam/subuntu1804 python-logilab-common 1.4.1-1
File not found - /home/sunbeam/subuntu1804/./repo/python-logilab-common_1.4.1-1_all.deb (2: No such file or directory)
Get:16 file:/home/sunbeam/subuntu1804 pylint 1.8.3-1 [342 kB]
Err:16 file:/home/sunbeam/subuntu1804 pylint 1.8.3-1
File not found - /home/sunbeam/subuntu1804/./repo/pylint_1.8.3-1_all.deb (2: No such file or directory)
Get:17 file:/home/sunbeam/subuntu1804 python-egenix-mxtools 3.2.9-1 [75.3 kB]
Err:17 file:/home/sunbeam/subuntu1804 python-egenix-mxtools 3.2.9-1
File not found - /home/sunbeam/subuntu1804/./repo/python-egenix-mxtools_3.2.9-1_amd64.deb (2: No such file or directory)
Get:18 file:/home/sunbeam/subuntu1804 python-egenix-mxdatetime 3.2.9-1 [68.3 kB]
Err:18 file:/home/sunbeam/subuntu1804 python-egenix-mxdatetime 3.2.9-1
File not found - /home/sunbeam/subuntu1804/./repo/python-egenix-mxdatetime_3.2.9-1_amd64.deb (2: No such file or directory)
Get:19 file:/home/sunbeam/subuntu1804 python-tk 2.7.15~rc1-1 [25.9 kB]
Err:19 file:/home/sunbeam/subuntu1804 python-tk 2.7.15~rc1-1
File not found - /home/sunbeam/subuntu1804/./repo/python-tk_2.7.15~rc1-1_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/libtcl8.6_8.6.8+dfsg-3_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/libtcl8.6_8.6.8+dfsg-3_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/libtk8.6_8.6.8-4_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/libtk8.6_8.6.8-4_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/tk8.6-blt2.5_2.5.3+dfsg-4_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/tk8.6-blt2.5_2.5.3+dfsg-4_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/blt_2.5.3+dfsg-4_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/blt_2.5.3+dfsg-4_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-lazy-object-proxy_1.3.1-1_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/python-lazy-object-proxy_1.3.1-1_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-wrapt_1.9.0-3_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/python-wrapt_1.9.0-3_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-singledispatch_3.4.0.3-2_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-singledispatch_3.4.0.3-2_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-backports.functools-lru-cache_1.4-2_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-backports.functools-lru-cache_1.4-2_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-setuptools_39.0.1-2_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-setuptools_39.0.1-2_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-astroid_1.6.0-1_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-astroid_1.6.0-1_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-concurrent.futures_3.2.0-1_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-concurrent.futures_3.2.0-1_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-isort_4.3.4+ds1-1_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-isort_4.3.4+ds1-1_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-mccabe_0.6.1-2_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-mccabe_0.6.1-2_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-configparser_3.5.0-1_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-configparser_3.5.0-1_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-logilab-common_1.4.1-1_all.deb File not found - /home/sunbeam/subuntu1804/./repo/python-logilab-common_1.4.1-1_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/pylint_1.8.3-1_all.deb File not found - /home/sunbeam/subuntu1804/./repo/pylint_1.8.3-1_all.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-egenix-mxtools_3.2.9-1_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/python-egenix-mxtools_3.2.9-1_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-egenix-mxdatetime_3.2.9-1_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/python-egenix-mxdatetime_3.2.9-1_amd64.deb (2: No such file or directory)
E: Failed to fetch file:/home/sunbeam/subuntu1804/./repo/python-tk_2.7.15~rc1-1_amd64.deb File not found - /home/sunbeam/subuntu1804/./repo/python-tk_2.7.15~rc1-1_amd64.deb (2: No such file or directory)
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
我已经使用了如何更改管理员用户名?将我的用户名从“sunbeam”更改为“admin”,但现在当我使用“apt-get”安装任何东西时,它会尝试从/主页/sunbeam/subuntu1804/./repo/..现在显然不存在了,因为 sunbeam 已重命名为 admin。所以我的问题是,由于文件路径已更改,如何使用 apt-get 安装任何东西?
我该如何解决这个问题?
答案1
以下来自评论
在我看来,您的源 () 中似乎有一个错误的条目/etc/apt/sources
,您需要修改指向旧用户目录的条目到新的 $HOME 路径 (我假设你将旧目录硬编码为源,而现在该目录已经更改)
命令
grep sunbeam /etc/apt/sources.list
我希望不会产生任何结果。如果产生结果,则需要更改这些以反映新的 $HOME 目录名称。
我认为最快的解决方法是编辑文件并使其反映新目录。我会使用
sudo vim /etc/apt/sources.list
但您可以用您喜欢的编辑器替换,或者用(stream-edit)等vim
更改文件。sed