我在同一台计算机上安装了 Ubuntu 22.04 和 Ubuntu 18.04。如果我在其中一个上工作然后切换到另一个,我必须重置系统。恐怕太多的重置可能会导致问题。
有没有办法在不启动计算机的情况下在 22.04 和 18.04 之间切换?
祖尔菲。
我在同一台计算机上安装了 Ubuntu 22.04 和 Ubuntu 18.04。如果我在其中一个上工作然后切换到另一个,我必须重置系统。恐怕太多的重置可能会导致问题。
有没有办法在不启动计算机的情况下在 22.04 和 18.04 之间切换?
祖尔菲。
我输入了以下命令:
$ apt update && apt upgrade
我收到错误:
Reading package lists... Done
E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
E: Unable to lock directory /var/lib/apt/lists/
W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
有人请指导我。
祖尔菲。
我在 ubuntu 18.04 上卸载然后重新安装 mysql,然后我尝试了以下操作:
$ sudo service mysql start
~$ sudo /etc/init.d/mysql start
[ ok ] Starting mysql (via systemctl): mysql.service.
~$ sudo systemctl start mysqld
Failed to start mysqld.service: Unit mysqld.service not found.
我使用以下命令删除 mysql,它的输出也如下所示:
$ sudo apt-get remove --purge mysql-\*
Reading package lists... Done
Building dependency tree
Reading state information... Done
Note, selecting 'mysql-workbench' for glob 'mysql-*'
Note, selecting 'mysql-client-5.5' for glob 'mysql-*'
Note, selecting 'mysql-client-5.6' for glob 'mysql-*'
Note, selecting 'mysql-client-5.7' for glob 'mysql-*'
Note, selecting 'mysql-common-5.6' for glob 'mysql-*'
Note, selecting 'mysql-server-5.0' for glob 'mysql-*'
Note, selecting 'mysql-server-5.1' for glob 'mysql-*'
Note, selecting 'mysql-server-5.5' for glob 'mysql-*'
Note, selecting 'mysql-server-5.6' for glob 'mysql-*'
Note, selecting 'mysql-server-5.7' for glob 'mysql-*'
Note, selecting 'mysql-utilities' for glob 'mysql-*'
Note, selecting 'mysql-testsuite' for glob 'mysql-*'
Note, selecting 'mysql-server' for glob 'mysql-*'
Note, selecting 'mysql-client' for glob 'mysql-*'
Note, selecting 'mysql-sandbox' for glob 'mysql-*'
Note, selecting 'mysql-client-core-5.5' for glob 'mysql-*'
Note, selecting 'mysql-client-core-5.6' for glob 'mysql-*'
Note, selecting 'mysql-client-core-5.7' for glob 'mysql-*'
Note, selecting 'mysql-testsuite-5.5' for glob 'mysql-*'
Note, selecting 'mysql-testsuite-5.6' for glob 'mysql-*'
Note, selecting 'mysql-testsuite-5.7' for glob 'mysql-*'
Note, selecting 'mysql-common' for glob 'mysql-*'
Note, selecting 'mysql-workbench-data' for glob 'mysql-*'
Note, selecting 'mysql-server-core-5.1' for glob 'mysql-*'
Note, selecting 'mysql-server-core-5.5' for glob 'mysql-*'
Note, selecting 'mysql-server-core-5.6' for glob 'mysql-*'
Note, selecting 'mysql-server-core-5.7' for glob 'mysql-*'
Note, selecting 'mysql-source-5.7' for glob 'mysql-*'
Package 'mysql-client-5.5' is not installed, so not removed
Package 'mysql-client-5.6' is not installed, so not removed
Package 'mysql-server-core-5.6' is not installed, so not removed
Package 'mysql-client-core-5.5' is not installed, so not removed
Package 'mysql-client-core-5.6' is not installed, so not removed
Note, selecting 'mysql-common' instead of 'mysql-common-5.6'
Package 'mysql-server-5.5' is not installed, so not removed
Package 'mysql-server-5.6' is not installed, so not removed
Package 'mysql-server-core-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.5' is not installed, so not removed
Package 'mysql-testsuite-5.6' is not installed, so not removed
Package 'mysql-server-5.0' is not installed, so not removed
Package 'mysql-server-5.1' is not installed, so not removed
Package 'mysql-server-core-5.1' is not installed, so not removed
Package 'mysql-sandbox' is not installed, so not removed
Package 'mysql-source-5.7' is not installed, so not removed
Package 'mysql-testsuite' is not installed, so not removed
Package 'mysql-testsuite-5.7' is not installed, so not removed
The following packages were automatically installed and are no longer required:
gdal-data libaec0 libarmadillo8 libarpack2 libatkmm-1.6-1v5 libblas3
libcairomm-1.0-1v5 libcoin80v5 libctemplate3 libdap25 libdapclient6v5
libepsilon1 libevent-core-2.1-6 libfreexl1 libfyba0 libgeos-3.6.2
libgeos-c1v5 libgeos-dev libgeotiff2 libglibmm-2.4-1v5
libgnome-keyring-common libgnome-keyring0 libgraphicsmagick-q16-3
libgtkmm-2.4-1v5 libhdf4-0-alt libhdf5-100 libiso9660-10 libkmlbase1
libkmldom1 libkmlengine1 liblapack3 libmad0 libmng2 libnetcdf13 libodbc1
libogdi3.2 libopenthreads-dev libopenthreads20 libpangomm-1.4-1v5 libpq5
libproj12 libqhull7 libspatialite7 libsuperlu5 libsz2 libtinyxml2.6.2v5
liburiparser1 libvcdinfo0 libvsqlitepp3v5 libxerces-c3.2 libxine2
libxine2-bin libxine2-doc libxine2-ffmpeg libxine2-misc-plugins
libxine2-plugins odbcinst odbcinst1debian2 proj-bin proj-data
python-mysql.connector python-paramiko python-pexpect python-ptyprocess
python-pyodbc python-pysqlite2
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
dbconfig-no-thanks
The following packages will be REMOVED:
dbconfig-mysql* libgdal20* libmysqlclient20* libmysqlcppconn7v5*
libopenscenegraph-3.4-131* libopenscenegraph-3.4-dev* libosgearth-dev*
libosgearth5* libosgearthannotation5* libosgearthfeatures5*
libosgearthqt5-5* libosgearthsplat5* libosgearthsymbology5*
libosgearthutil5* mysql-client* mysql-client-5.7* mysql-client-core-5.7*
mysql-common* mysql-server* mysql-server-5.7* mysql-server-core-5.7*
mysql-utilities* mysql-workbench* mysql-workbench-data*
openscenegraph-plugin-osgearth*
The following NEW packages will be installed:
dbconfig-no-thanks
0 upgraded, 1 newly installed, 25 to remove and 12 not upgraded.
2 not fully installed or removed.
Need to get 1,314 B of archives.
After this operation, 337 MB disk space will be freed.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe amd64 dbconfig-no-thanks all 2.0.9 [1,314 B]
Fetched 1,314 B in 0s (3,420 B/s)
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
(Reading database ... 230311 files and directories currently installed.)
Removing mysql-server (5.7.37-0ubuntu0.18.04.1) ...
Removing mysql-server-5.7 (5.7.37-0ubuntu0.18.04.1) ...
dpkg: dbconfig-mysql: dependency problems, but removing anyway as you requested:
phpmyadmin depends on dbconfig-mysql | dbconfig-no-thanks | dbconfig-common (<< 2.0.0); however:
Package dbconfig-mysql is to be removed.
Package dbconfig-no-thanks is not installed.
Version of dbconfig-common on system is 2.0.9.
Removing dbconfig-mysql (2.0.9) ...
Selecting previously unselected package dbconfig-no-thanks.
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
(Reading database ... 230233 files and directories currently installed.)
Preparing to unpack .../dbconfig-no-thanks_2.0.9_all.deb ...
Unpacking dbconfig-no-thanks (2.0.9) ...
dpkg: warning: files list file for package 'mysql-common' missing; assuming package has no files currently installed
(Reading database ... 230234 files and directories currently installed.)
Removing openscenegraph-plugin-osgearth (2.9.0+dfsg-1) ...
Removing mysql-workbench (6.3.8+dfsg-1build3) ...
Removing libosgearth-dev (2.9.0+dfsg-1) ...
Removing libmysqlcppconn7v5:amd64 (1.1.9-1) ...
Removing libopenscenegraph-3.4-dev (3.4.1+dfsg1-3) ...
Removing libosgearthsplat5 (2.9.0+dfsg-1) ...
Removing libosgearthqt5-5 (2.9.0+dfsg-1) ...
Removing mysql-client (5.7.37-0ubuntu0.18.04.1) ...
Removing mysql-client-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Removing mysql-client-core-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Removing mysql-server-core-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Removing mysql-utilities (1.6.4-1) ...
Removing mysql-workbench-data (6.3.8+dfsg-1build3) ...
Removing libosgearthutil5 (2.9.0+dfsg-1) ...
Removing libosgearthannotation5 (2.9.0+dfsg-1) ...
Removing libosgearthfeatures5 (2.9.0+dfsg-1) ...
Removing libosgearthsymbology5 (2.9.0+dfsg-1) ...
Removing libosgearth5 (2.9.0+dfsg-1) ...
Removing libopenscenegraph-3.4-131:amd64 (3.4.1+dfsg1-3) ...
Removing libgdal20 (2.2.3+dfsg-2) ...
Removing libmysqlclient20:amd64 (5.7.37-0ubuntu0.18.04.1) ...
Removing mysql-common (5.8+1.0.4) ...
Setting up dbconfig-no-thanks (2.0.9) ...
Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2) ...
Processing triggers for libc-bin (2.27-3ubuntu1.4) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for shared-mime-info (1.9-2) ...
Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ...
Processing triggers for hicolor-icon-theme (0.17-2) ...
Processing triggers for mime-support (3.60ubuntu1) ...
(Reading database ... 227342 files and directories currently installed.)
Purging configuration files for mysql-common (5.8+1.0.4) ...
Purging configuration files for mysql-utilities (1.6.4-1) ...
Purging configuration files for mysql-server-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Processing triggers for systemd (237-3ubuntu10.53) ...
Processing triggers for ureadahead (0.100.0-21) ...
ureadahead will be reprofiled on next reboot
然后我尝试使用以下命令重新安装,我得到了 stat 文件错误:
:~$ sudo apt-get install mysql-server mysql-client
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
gdal-data libaec0 libarmadillo8 libarpack2 libatkmm-1.6-1v5 libblas3
libcairomm-1.0-1v5 libcoin80v5 libctemplate3 libdap25 libdapclient6v5
libepsilon1 libfreexl1 libfyba0 libgeos-3.6.2 libgeos-c1v5 libgeos-dev
libgeotiff2 libglibmm-2.4-1v5 libgnome-keyring-common libgnome-keyring0
libgraphicsmagick-q16-3 libgtkmm-2.4-1v5 libhdf4-0-alt libhdf5-100
libiso9660-10 libkmlbase1 libkmldom1 libkmlengine1 liblapack3 libmad0
libmng2 libnetcdf13 libodbc1 libogdi3.2 libopenthreads-dev libopenthreads20
libpangomm-1.4-1v5 libpq5 libproj12 libqhull7 libspatialite7 libsuperlu5
libsz2 libtinyxml2.6.2v5 liburiparser1 libvcdinfo0 libvsqlitepp3v5
libxerces-c3.2 libxine2 libxine2-bin libxine2-doc libxine2-ffmpeg
libxine2-misc-plugins libxine2-plugins odbcinst odbcinst1debian2 proj-bin
proj-data python-mysql.connector python-paramiko python-pexpect
python-ptyprocess python-pyodbc python-pysqlite2
Use 'sudo apt autoremove' to remove them.
The following additional packages will be installed:
mysql-client-5.7 mysql-client-core-5.7 mysql-common mysql-server-5.7
mysql-server-core-5.7
Suggested packages:
mailx tinyca
The following NEW packages will be installed:
mysql-client mysql-client-5.7 mysql-client-core-5.7 mysql-common
mysql-server mysql-server-5.7 mysql-server-core-5.7
0 upgraded, 7 newly installed, 0 to remove and 12 not upgraded.
Need to get 7,308 B/18.9 MB of archives.
After this operation, 154 MB of additional disk space will be used.
Do you want to continue? [Y/n] Y
Get:1 http://us.archive.ubuntu.com/ubuntu bionic/main amd64 mysql-common all 5.8+1.0.4 [7,308 B]
Fetched 7,308 B in 0s (23.3 kB/s)
Preconfiguring packages ...
Selecting previously unselected package mysql-common.
(Reading database ... 227329 files and directories currently installed.)
Preparing to unpack .../mysql-common_5.8+1.0.4_all.deb ...
Unpacking mysql-common (5.8+1.0.4) ...
Selecting previously unselected package mysql-client-core-5.7.
Preparing to unpack .../mysql-client-core-5.7_5.7.37-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-client-core-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-client-5.7.
Preparing to unpack .../mysql-client-5.7_5.7.37-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-client-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-server-core-5.7.
Preparing to unpack .../mysql-server-core-5.7_5.7.37-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-core-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Setting up mysql-common (5.8+1.0.4) ...
update-alternatives: warning: alternative /etc/mysql/mysql.cnf (part of link group my.cnf) doesn't exist; removing from list of alternatives
update-alternatives: warning: /etc/alternatives/my.cnf is dangling; it will be updated with best choice
update-alternatives: using /etc/mysql/my.cnf.fallback to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Selecting previously unselected package mysql-server-5.7.
(Reading database ... 227485 files and directories currently installed.)
Preparing to unpack .../mysql-server-5.7_5.7.37-0ubuntu0.18.04.1_amd64.deb ...
Unpacking mysql-server-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-client.
Preparing to unpack .../mysql-client_5.7.37-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-client (5.7.37-0ubuntu0.18.04.1) ...
Selecting previously unselected package mysql-server.
Preparing to unpack .../mysql-server_5.7.37-0ubuntu0.18.04.1_all.deb ...
Unpacking mysql-server (5.7.37-0ubuntu0.18.04.1) ...
Setting up mysql-server-core-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Setting up mysql-client-core-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Setting up mysql-client-5.7 (5.7.37-0ubuntu0.18.04.1) ...
Setting up mysql-client (5.7.37-0ubuntu0.18.04.1) ...
Setting up mysql-server-5.7 (5.7.37-0ubuntu0.18.04.1) ...
update-alternatives: using /etc/mysql/mysql.cnf to provide /etc/mysql/my.cnf (my.cnf) in auto mode
Renaming removed key_buffer and myisam-recover options (if present)
Cannot stat file /proc/10333/fd/4: Permission denied
Cannot stat file /proc/10333/fd/5: Permission denied
Cannot stat file /proc/10333/fd/14: Permission denied
Cannot stat file /proc/10333/fd/15: Permission denied
Cannot stat file /proc/10333/fd/16: Permission denied
Cannot stat file /proc/10333/fd/17: Permission denied
Cannot stat file /proc/10333/fd/48: Permission denied
Cannot stat file /proc/10333/fd/72: Permission denied
Cannot stat file /proc/10333/fd/87: Permission denied
Cannot stat file /proc/10333/fd/90: Permission denied
Cannot stat file /proc/10333/fd/93: Permission denied
Cannot stat file /proc/10333/fd/96: Permission denied
Cannot stat file /proc/10333/fd/1023: Permission denied
Cannot stat file /proc/10341/fd/5: Permission denied
Cannot stat file /proc/10341/fd/6: Permission denied
Cannot stat file /proc/10341/fd/7: Permission denied
Cannot stat file /proc/10341/fd/8: Permission denied
Cannot stat file /proc/10341/fd/9: Permission denied
Cannot stat file /proc/10341/fd/10: Permission denied
Cannot stat file /proc/10363/fd/3: Permission denied
Cannot stat file /proc/10375/fd/3: Permission denied
Cannot stat file /proc/10375/fd/4: Permission denied
Cannot stat file /proc/10375/fd/7: Permission denied
Cannot stat file /proc/10375/fd/8: Permission denied
Cannot stat file /proc/10375/fd/9: Permission denied
Cannot stat file /proc/10375/fd/10: Permission denied
Cannot stat file /proc/10375/fd/103: Permission denied
Cannot stat file /proc/10377/fd/13: Permission denied
Cannot stat file /proc/10377/fd/14: Permission denied
Cannot stat file /proc/10377/fd/15: Permission denied
Cannot stat file /proc/10377/fd/16: Permission denied
Cannot stat file /proc/10377/fd/17: Permission denied
Cannot stat file /proc/10377/fd/18: Permission denied
Cannot stat file /proc/10377/fd/41: Permission denied
Cannot stat file /proc/10377/fd/103: Permission denied
Cannot stat file /proc/10423/fd/4: Permission denied
Cannot stat file /proc/10423/fd/5: Permission denied
Cannot stat file /proc/10423/fd/11: Permission denied
Cannot stat file /proc/10423/fd/14: Permission denied
Cannot stat file /proc/10423/fd/15: Permission denied
Cannot stat file /proc/10423/fd/16: Permission denied
Cannot stat file /proc/10423/fd/17: Permission denied
Cannot stat file /proc/10423/fd/24: Permission denied
Cannot stat file /proc/10423/fd/48: Permission denied
Cannot stat file /proc/10423/fd/72: Permission denied
Cannot stat file /proc/10423/fd/87: Permission denied
Cannot stat file /proc/10423/fd/90: Permission denied
Cannot stat file /proc/10423/fd/93: Permission denied
Cannot stat file /proc/10423/fd/96: Permission denied
Cannot stat file /proc/10423/fd/1023: Permission denied
Cannot stat file /proc/10424/fd/4: Permission denied
Cannot stat file /proc/10424/fd/5: Permission denied
Cannot stat file /proc/10424/fd/11: Permission denied
Cannot stat file /proc/10424/fd/14: Permission denied
Cannot stat file /proc/10424/fd/15: Permission denied
Cannot stat file /proc/10424/fd/16: Permission denied
Cannot stat file /proc/10424/fd/17: Permission denied
Cannot stat file /proc/10424/fd/24: Permission denied
Cannot stat file /proc/10424/fd/48: Permission denied
Cannot stat file /proc/10424/fd/72: Permission denied
Cannot stat file /proc/10424/fd/87: Permission denied
Cannot stat file /proc/10424/fd/90: Permission denied
Cannot stat file /proc/10424/fd/93: Permission denied
Cannot stat file /proc/10424/fd/96: Permission denied
Cannot stat file /proc/10424/fd/1023: Permission denied
AppArmor parser error for /etc/apparmor.d/usr.sbin.mysqld in /etc/apparmor.d/usr.sbin.mysqld at line 9: Could not open 'abstractions/mysql'
Setting up mysql-server (5.7.37-0ubuntu0.18.04.1) ...
Processing triggers for systemd (237-3ubuntu10.53) ...
Processing triggers for man-db (2.8.3-2ubuntu0.1) ...
Processing triggers for ureadahead (0.100.0-21) …
有人请指导我如何解决mysqld问题。
祖尔菲。
我正在使用 ubuntu 18.04。我正在尝试运行必须使用 Python 的 Oyente 工具。
我找到了以下链接:
我在以下命令中收到错误:
@lc2530hz:~$ source env/bin/activate
bash: env/bin/activate: 没有这样的文件或目录
我没有“env”目录。我应该创建目录吗?我为上述错误找到了几个链接,但每个链接都使用不同的链接。我无法理解他们的解决方案。有人请指导我。
祖尔菲。
我正在尝试在 Ubuntu 18.04 上运行 Netwox 工具 78,并尝试在 Ubuntu Osboxes 映像上运行;但是,我收到以下错误:
$ sudo netwox 78 --filter 10.161.25.252 Error 4081 :
error in pcap_compile() hint: errno = 22 = Invalid argument hint:
can't parse filter expression: syntax error osboxes@osboxes:~$ sudo
netwox 78 --filter "10.161.25.252" Error 4081 : error in
pcap_compile() hint: errno = 22 = Invalid argument hint: can't parse
filter expression: syntax error osboxes@osboxes:~$
我该如何解决这个问题?
我正在尝试从我的 ubuntu VM2 到 ubuntu VM1 的 ssh。Ping 正常工作,ssh 处于活动状态,ufw 也处于活动状态。但是 ssh 命令超时。
Machine2 的状态如下:
osboxes@osboxes:~/virt-utils$ ifconfig
enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 10.0.0.12 netmask 255.255.255.0 broadcast 10.0.0.255
inet6 fe80::b5a8:7e0f:1980:254f prefixlen 64 scopeid 0x20<link>
ether 08:00:27:31:40:2c txqueuelen 1000 (Ethernet)
RX packets 388285 bytes 563502310 (563.5 MB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 99408 bytes 10177352 (10.1 MB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 2009 bytes 281204 (281.2 KB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2009 bytes 281204 (281.2 KB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
osboxes@osboxes:~/virt-utils$ sudo ufw status
[sudo] password for osboxes:
Status: active
osboxes@osboxes:~/virt-utils$ service sshd status
● ssh.service - OpenBSD Secure Shell server
Loaded: loaded (/lib/systemd/system/ssh.service; enabled;
Active: active (running) since Sun 2019-11-17 12:41:19 ES
Docs: man:sshd(8)
man:sshd_config(5)
Process: 29449 ExecStartPre=/usr/sbin/sshd -t (code=exited
Main PID: 29466 (sshd)
Tasks: 1 (limit: 4544)
Memory: 1.2M
CGroup: /system.slice/ssh.service
└─29466 /usr/sbin/sshd -D
Nov 17 12:41:19 osboxes systemd[1]: Starting OpenBSD Secure
Nov 17 12:41:19 osboxes sshd[29466]: Server listening on 0.0
Nov 17 12:41:19 osboxes sshd[29466]: Server listening on ::
Nov 17 12:41:19 osboxes systemd[1]: Started OpenBSD Secure S
lines 1-16/16 (END)
osboxes@osboxes:~/virt-utils$
有人请指导我如何解决这个问题。我在所有虚拟机上使用桥接网络。
祖尔菲。