真是愚蠢的问题,Ubuntu 20,我安装了 apache2,没有太多其他的。我想要sudo visudo /etc/hosts添加一个别名“dummy.com”域别名作为指向服务器的黑客,仅用于本地测试学习网站,我得到了这个不寻常的结果
>> /etc/hosts: syntax error near line 1 <<<
>>> /etc/hosts: syntax error near line 2 <<<
>>> /etc/hosts: syntax error near line 5 <<<
>>> /etc/hosts: syntax error near line 6 <<<
>>> /etc/hosts: syntax error near line 7 <<<
>>> /etc/hosts: syntax error near line 8 <<<
>>> /etc/hosts: syntax error near line 9 <<<
What now? Q
Run Code Online (Sandbox Code Playgroud)
我删除了该127.0.0.1 localhost notmydomain.com行,所以现在这是我的文件,为什么每当我编辑它时它都会出现如上所述的语法错误?
conrad@conrad-VirtualBox:~$ cat /etc/hosts
127.0.0.1 localhost
127.0.1.1 conrad-VirtualBox
# The …Run Code Online (Sandbox Code Playgroud) 我注意到 docker-compose 1.x 正在逐渐被放弃,取而代之的是新的 v2:
\n https://www.docker.com/blog/announcing-compose-v2-general-availability/
因此,我删除了docker-composev1.x 命令(我认为这是可行的方法,但我无法再找到有关如何安装/卸载 docker-compose 的旧文档):
$ sudo rm -rf /usr/local/bin/docker-compose\nRun Code Online (Sandbox Code Playgroud)\n然后我根据文档安装了新版本:
\n$ sudo apt-get install docker-compose-plugin\nRun Code Online (Sandbox Code Playgroud)\n并查看\xc3\xa0:
\n$ docker compose version\nDocker Compose version v2.5.0\nRun Code Online (Sandbox Code Playgroud)\n但我所有用来调用docker-compose(用破折号)的脚本都不再工作了。明显地。
因此我的问题是:我如何将新的 compose 命令别名为docker-compose?
将此行添加到文件中是否足够.bashrc?
$ echo "alias docker-compose=\'docker compose\'" >> ~/.bashrc\n$ source ~/.bashrc\nRun Code Online (Sandbox Code Playgroud)\n 您好,我想在 Raspberry Pi 4 上安装 Ubuntu Desktop 20.04 Desktop。不幸的是,我看不到该名称下的任何内容,而是只能看到 20.04 上的 Ubuntu Server 版本。
因为我们的硬件驱动程序仅支持 Ubuntu 20.04。我们还没有准备好其他版本。如果我安装预构建服务器 20.04 变体,然后安装 gnome-desktop:这会完全转换为桌面变体吗?
有人有 Pi 的 Ubuntu 20.04 Desktop 的镜像文件吗?
由于我的 apt 版本,我似乎无法从 20.04 升级到 22.04.1 LTS,但它也是最新的。
我已经跑了
sudo apt update
sudo apt upgrade
sudo apt dist-upgrade
sudo apt full-upgrade
Run Code Online (Sandbox Code Playgroud)
并且所有软件包似乎都是最新的。
但是,当我运行时sudo do-release-upgrade,它失败并出现错误
Reading cache
Checking package manager
Reading package lists... Done
Building dependency tree
Reading state information... Done
Required depends are not installed
The required dependency 'apt (>= 2.0.4)' is not installed.
Run Code Online (Sandbox Code Playgroud)
跑步apt --version确实给了apt 2.0.2 (amd64)。
在此处检查焦点上可用的 apt 版本https://launchpad.net/ubuntu/+source/apt似乎表明 2.0.2 是分支上可用的最新版本release (main),尽管 2.0.9 在 下可用updates (main)。
是否可以以某种方式安装 …
例如,看起来我需要从 Ubuntu 23.04 开始才能获得对我的硬件的支持。截至撰写本文时,这是非 LTS 版本,只有 9 个月的支持。当相应的 LTS 版本可用时,是否可以直接从该版本升级到该版本?
使用可以很方便地apt-get找到未使用的软件包并删除它们以保持系统干净sudo apt-get autoremove。
apt但是将包定义为“未使用”的确切标准是什么?
我想用它来清理我的 Ubuntu 安装,但如果它在某种程度上是推测性的或有破坏共享库的风险,我宁愿生活在我的服务器的污秽中。
我一直在用 编辑我的 crontab crontab -e -u,这是内容:
*/1 * * * * export DISPLAY=:0 && xset dpms force off
*/1 * * * * export DISPLAY=:0 && xset dpms force on
Run Code Online (Sandbox Code Playgroud)
如何使准时保持 1 分钟,使显示屏关闭 1 分钟,然后再打开 1 分钟?
我删除了目录“/usr/lib64”中“/lib/x86_64-linux-gnu/ld-2.31.so”的符号链接。突然间,几乎一切都停止了。我什至无法发出简单的 Linux 命令,如“pwd”、“ls”、“sudo”。由于“sudo”消失了,我什至无法恢复我删除的符号链接。
我是DIW。如果您知道我应该做什么才能恢复,请帮忙。
作为记录,我在台式机上运行 Ubuntu Mate 20.04 LTS。
我试图删除包含文件的目录,但permission denied在 Ubuntu 22.04.1 上出现错误。
我已更改777目录和父目录的权限,但仍然收到错误。
$ sudo rm *.*
rm: cannot remove 'Real Economy v1.5.1-4267-1-5-1-1588544476': Permission denied
rm: cannot remove 'Witcher 3 input.settings file backup for 1.32-5844-1-32-1626358844': Permission denied
Run Code Online (Sandbox Code Playgroud)
包含我尝试删除的目录/文件的目录是 Brave 浏览器和 Firefox 的默认下载目的地。它位于系统磁盘 (SSD) 上。浏览器也不允许我更改下载目的地,这很奇怪。这些文件在此处下载,适用于 Windows(《巫师 3》的模组)。
另一个奇怪的事情是这些是提取的档案(7-zip 文件等)。
我可以删除原始存档文件,但是一旦提取它,我就无法删除提取的目录/文件。
我为 arm64 架构下载了Ubuntu Server 20.04。很好。现在我想知道,我在哪里可以得到armhf架构(如果有这样的图像)?
20.04 ×2
apt ×2
server ×2
sudo ×2
22.04 ×1
alias ×1
architecture ×1
arm ×1
arm64 ×1
command-line ×1
cron ×1
docker ×1
hosts ×1
konsole ×1
localhost ×1
lubuntu ×1
permissions ×1
playonlinux ×1
raspberrypi ×1
rm ×1
updates ×1
upgrade ×1
visudo ×1